Commit Graph
95 Commits
Author SHA1 Message Date
Michael 3f0c74b845 Allow webauthn to be passed when issuing certs for web-based scp (#22864)
* Allow webauthn to be passed when issuing certs for web-based scp

* Remove extra line
2023-03-16 02:03:37 +00:00
Grzegorz Zdunek 2a2b08dbfd Use 13px font size in a Notification (#22842) 2023-03-10 10:08:15 +00:00
Yassine Bounekhla f8c5cd0441 fix select box sizing (#21212) 2023-03-06 22:59:54 +00:00
Jeff Pihach 016141c1ea Resolve dependabot CVE issues (#22605)
* update storybook dependencies to resolve some dependabot issues.

* remove config that's already set to the default

* Resolve prettier issues after dep update.

* Pin x-default-browser version to resolve dependabot vulnerability.
2023-03-03 23:45:17 +00:00
Grzegorz ZdunekandRafał Cieślak 4830ea16e5 Connect: Enable keyboard shortcuts configuration (#22194)
* Use event.code for non A-z keys

Without this fix, shortcuts like "Shift+1" can't work, because the reported character is "!".

* Add Zod schema to validate keyboard shortcuts

* Render better formatted error notification, add a link to docs

* Notify about duplicated accelerators

* Improve the error message for re-parsing failure (it can happen when a default value does not pass validation)

* A bunch of renames

* Allow spaces in accelerators

* Rename `isContentAnObject`

* Allow `Notification` to render links and lists

* Split by optional whitespace and "+"

* Allow lowercase letters

* Require a modifier for non-function keys

* Move VALID_SHORTCUT_MESSAGE to `initUi`

* Always return from `getDuplicateAccelerators`

* Use 'Cmd' and 'Ctrl' for mac

* Add comments

* Fix notification not rendering content

* Add more comments, rename `getKeyCode` to `getKeyName`

* Fix incorrect size of <Link> text

* Remove "expected" prefix

* Revert `typeof content === 'object'` in `Notification`

* Remove a comment about disabled keys in `ConfigService`, add a note about `keymap.` prefix

* Improve `getKeyName` comment

* Extract an inline object to a variable in `getKeyName`

* Fix notification list padding

* Change text for doc link & description for config error

* Improve comment for `getKeyName`

* Remove special formatting for list === 1 in `Notification`

* Print valid modifiers

* Call `getKeyboardShortcutSchema()` once

* Collect issues from all validations, run `invalidModifiers` through a set

* Change error message for `missingModifierIssue`

* Convert duplicates warning to error

* Define ALLOWED_KEY_CODES in a more concise way

* Support both `IntlBackslash` and `Backquote`

* Restore modifiers for mac to full spelling, sort them in order recommended by platform guidelines

* Fix old comment about the shortcuts order

---------

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2023-03-03 14:05:38 +00:00
Yassine Bounekhla 10ca00a1a3 [Web] Refactor serverside filtering and pagination (#20823)
* refactor filtering

* stash

* fix errors

* tweaks

* fixes

* address comments

* fix missing searchAsRoles query param

* temp

* temp

* rename ClientSidePager

* temp

* rename

* update eref

* manually type returntype

* address comments

* type useServersidePagination

* revert default pageSize

* update snapshots

* remove useless act in test

* remove unused import

* address comment

* fixes

* update snapshot

* revert e

* revert e
2023-02-27 22:17:41 +00:00
Yassine Bounekhla 8d44d15fb8 [Web] Add custom element support to SearchPanel (#22186)
* fix apps totalCount and add support for custom elements in panel

* export kinds function

* revert totalcount change
2023-02-24 21:27:15 +00:00
Jeff Pihach 5eafe86fa4 Remove usage of lodash methods (#21567)
* Create new local util lib to replace lodash.

* Replace usage of isInteger and debounce from lodash with highbar.

* Create isObject and runOnce utility methods.

* remove use of at, isObject, and once lodash method usage.

* remove map and transform lodash calls.

* Add memoize function to highbar.

* remove memoize lodash usage.

* remove merge and isEqual lodash methods and update other missing refs to highbar.

* convert the throttle to debounce.

* add throttle method to highbar.

* use the new throttle method instead of debounce where necessary.

* Add mergeDeep function for init config merge.

* remove lodash from the build process.

* Fix introduced bug in workspacesService.

* Added tests for highbar mergeDeep and expanded its functionality to support arrays.

* review updates.

* Added types to mergeDeep function.

* Add missing MapCache prototype methods.

* Add license notices, types and missing hash code.

* First pass at compare an array objects function.

* use new compareArrayObjs fn

* Add missing not

* Added types to arrayObjectIsEqual

* Add tests for arrayObjectIsEqual and fix some edge case bugs.

* update util fn name
2023-02-21 17:25:36 +00:00
Jeff Pihach 3f75acb163 Add license headers to web files that were missing it. (#21315)
* Lint the web files but not node_modules or vendored files.

* Add license headers to web files that were missing it.

* Add missing licenses.
2023-02-07 16:27:31 +00:00
Rafał Cieślak 644e85336c Move Connect-specific MenuLogin story out of shared package (#21157)
* Move Connect-specific MenuLogin story out of shared package

* Copyright 2019 -> Copyright 2023
2023-02-07 10:24:27 +00:00
Lisa Kim 8aefef1ae6 [Web:Discover] Bring back db service checker (#21062)
* [Backend]: allow more db fields to be updatable

* Add preventing duplicate keys for label creator

* Add sort compare fn helper

* Update db request update object

* Update CreateDatabase component

- Uncomment and touch up db service checker
- Fix db service label checking
- Allow user to make changes to updatable db fields
- Split defining db name and the other fields into
  two views, to prevent user from changing the db name
  which is not allowed with the update action

* Address CR: use nil value to determine CACert update

* Few more touch ups
- address CR: don't OR update db request field CACert
  and use consistent camelCasing
- remove the skip button for deploying service since
  we have the service checker now, which auto skips it
  for user if detects service
- refactor label matching for both register database
  and deploy service steps

* Address CR: make all fields updatable

* Update service polling after rebase
2023-02-06 18:44:39 +00:00
Ryan ClarkandLisa Kim 9a605331f3 Remove timeouts from discover flows, fix desktop discovery (#20829)
* Allow for inputs to be disabled

* Remove timeouts from the discover workflows

* Correct the resource type to be cleared on unmount

* Update test snapshots

* Rename useJoinToken to useJoinTokenSuspender

* Remove TODO

* Simplify usePoll

* Simplify the hint box code, add a shared hook

* Add the generte command button back to db flow

* Store the joinToken in PingTeleportContext state instead of using the hook

* Fix rebase diff mistake

* Fix bug with polling for result

- once we get the result, we set the result
  back to null, so we can't proceed to next step

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>
2023-02-06 17:52:30 +00:00
Grzegorz Zdunek 3a0fc94aa6 Connect: wait for process to exit before closing app (#20673) 2023-01-26 14:34:14 +00:00
Ryan Clark 42ec01c88a Refactor features, implement new design for navigation & user menu (#20553) 2023-01-25 17:53:59 +00:00
Lisa Kim e38f665de5 [Discover] Add database service checker and various db tweaks (#1481)
* Create ToolTipInfo component
* Update FieldInput to accept optional tool tip content
* Temp fix for story viewing timed out polling state
* Support different informational texts depending on database
* Add database service checker to determine if we can skip next step
* Enable AWS RDS postgres flow
2023-01-05 06:47:22 +00:00
Rafał Cieślak de66460718 Notifications: Add showcase story, fix types & icon alignment (#1474) 2023-01-04 09:50:10 +00:00
Rafał Cieślak eafdaf04a4 Connect: Implement tshd event handlers for db cert renewal (#1383)
* tshd events: Wait for listeners before responding

When tshd is sending the relogin event, it needs to be able to know when
the Electron app has finished relogging the user. I wanted to implement
this by simply waiting for the response from the RPC.

I'm so glad we did not use gRPC streams for tshd events as this would be
much harder to implement with streams.

* Return a function from ModalsService.openDialog which closes dialog

With the introduction of important and regular modals, this will help us
close the specific dialog if need arises.

* Make tshd events listeners aware of request cancellation

This will be useful in the upcoming commits. Basically, tshd is going to
ask the Electron app to relogin the user, with a 1 minute timeout.
The Electron app will show a login modal but if the user doesn't submit
it within 1 minute, tshd is going to cancel the request.

In that situation, we need to be able to close the modal.

* Add support for passing reason in DialogClusterConnect

* Add support for important modals

This will let us show the relogin modal on expired cert, even if the user
was using some other modal at that moment.

* Remove title attr from notification text

The user can read more by expanding the notification. The title attribute
persisted even after expanding the notification, making reading it harder.

* Add WindowsManager.forceFocusWindow

* Use IAppContext instead of AppContext

The next commit is going to add a private method to AppContext.
IAppContext is an interface which enables us to pass a mocked version of
AppContext in tests. That mock is not going have that private method,
so any place accepting AppContext wouldn't be able to accept the mocked
AppContext.

Instead, classes & functions should accept IAppContext rather than AppContext.

* Implement handlers for new tshd events

tshd needs to be able to do two things:

- Ask the user to log in again.
- Forward errors from goroutines running gateways to the Electron app
  in form of a notification. Otherwise those error would be visible
  only in the logs.

* Don't restart gateways after logging in

Restarting the gateways on login was a workaround from times where gateways
didn't manage their own certs.

In the new flow, a gateway takes care of refreshing the certs itself
through the middleware passed to alpnproxy.LocalProxy.

syncRootClusterAndRestartClusterGatewaysAndCatchErrors used to call two
functions:

- syncRootClusterAndCatchErrors
- restartClusterGatewaysAndCatchErrors

The second function is no longer necessary, so we can make any place that
was calling syncRootClusterAndRestartClusterGatewaysAndCatchErrors
call just syncRootClusterAndCatchErrors instead.
2022-12-06 12:31:15 +01:00
Isaiah Becker-Mayer 9d3ff66b88 Fixes onRemove console error (#1387) 2022-11-29 22:36:46 +00:00
Michael 48fa737a78 [Connect] Use server side search in resource tables (Advanced Search) (#1307)
Adds serverside search and pagination to the resource tables in Connect
2022-11-24 10:04:45 +09:00
Isaiah Becker-Mayer b0b5c3c930 Adds support for TDP Notifications, shows "warning" level notifications in a dismissible dropdown rather than a fullscreen modal (#1333) 2022-11-16 04:16:13 +00:00
Lisa Kim eb1e69b60e [Discover] Implement Kube Flow Day 1 (#1268)
* In addition set up msw lib for storybook with suspense
2022-10-21 16:21:17 +00:00
Grzegorz Zdunek 0a27881238 File Transfer UI fixes (#1276) 2022-10-21 16:01:10 +02:00
Grzegorz Zdunek e16340c5fe Add file transfer to Connect (#1225) 2022-10-10 18:38:42 +02:00
Ryan Clark 503d099edb [Discover] Desktop Setup Flow (#1172) 2022-09-23 22:22:14 +00:00
jkaczmarkiewiczandRyan Clark 09f08ab93e Enforce react-testing-library eslint rules (#1150)
* Add `eslint-plugin-{jest-dom,testing-library}`

* Enable `eslint-plugin-{jest-dom,testing-library}` rules

* Run `eslint --fix`

* refactor: apply eslint hints in FormPassword.test.tsx

* refactor: fix test in Table.test.tsx

* refactor: apply eslint hints in Table.test.tsx

* refactor: apply eslint hints in multiplefiles

* refactor: apply eslint hints in multiple files

* refactor: allow direct node access

* test: fix

* refactor: ButtonSso FileldInput

* refactor: FieldSelect

* refactor: FieldSelect

* refactor: MenuAction

* refactor: ShareFeedback

* refactor: FormLogin

* refactor: LabelSelector

* refactor: Welcome

* refactor: useUrlFiltering

* refactor: Login

* refactor: LoginTrait

* refactor: apply eslint hints in multiple files

* refactor: apply eslint hints in multiple files

* refactor: apply eslint hints in MenageDevices

* refactor: Indicator and FieldSelect tests

* refactor: Portal tests

* fix: use @testing-library/react instead of react-test-renderer

* refactor: use find without assertion

* fix: add webapps.e

* refactor: find by instead of get by+wait for

* fix: remove unused waitFor

* test: LoginTrait checkboxes count

* test: SlideTabs check tabs len

Co-authored-by: Ryan Clark <ryan@ryanclark.me>
2022-08-29 10:57:55 +02:00
Lisa Kim 91afcd3ad2 [Connect] Refactor FormLogin and add passwordless capabilities (#1019)
* Make SSO buttons be more noticeable on focus/hover state
2022-08-05 17:33:47 +00:00
Grzegorz Zdunek e9875a6966 Refactor input focusing after transition (#1071) 2022-08-03 18:05:04 +02:00
Grzegorz ZdunekandRafał Cieślak bd4866d5a4 Add ability to change port for db proxy (#900)
* Refactor `DocumentGateway`

* Update protobuf files

* Do not hide port input on reconnect

* Update port of gateway connection when doc gets updated

Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
2022-07-29 11:09:21 +02:00
Jeff Pihach 991856e137 Added eslint rule to enforce the order of file imports (#1030)
* 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.
2022-07-25 16:21:23 -06:00
Lisa Kim b86c9bcdfe [2/3] Prettify shared, build, and teleport packages (#955)
* Update prettier ignore
2022-07-06 14:57:40 +00:00
Lisa Kim 631aa2f6e2 [1/3] Prettify Design Package (#953)
* Update snapshots
* Add prettier ignore file
* Update e-ref
2022-07-06 14:35:42 +00:00
Grzegorz Zdunek b1b8e141fb Add default username for Redis (#919) 2022-06-28 11:05:48 +02:00
Grzegorz Zdunek fb8d6e6ee4 Add ability to change db name for db proxy (#883) 2022-06-27 15:54:19 +02:00
Grzegorz Zdunek f2c8477a89 Add TextArea and FieldTextArea components (#870) 2022-06-14 11:07:27 +02:00
Lisa Kim b3398d0884 Refactor Teleport Reset/Invite Flow (#818)
* Create/Use buttons for text button so users can focus with keyboard
* Various small tweaks
 - Add a refocus indicator to FieldInput
 - Tweaked StepSlider to handle edge cases like growing height
   from error dialogues on initial render
 - Pass on deviceName to reset endpoints

* Update e-ref
2022-05-12 10:17:28 -07:00
Lisa Kim d8cc096ea1 Refactor Teleport Login Flow (#816)
- Display primary and secondary logins on different cards
- Use sliding transitions
- Allow to add passwordless device through dashboard
- Update e-ref
2022-05-10 13:04:56 -07:00
Rafał Cieślak 12097e645e Teleport Connect: Add dropdown for database name (#757)
* Add required prop to MenuLogin

This will be needed for the db name dropdown, where the value is optional.

* Update proto files

* Include targetSubresourceName when creating a gateway

* Set better title for gateway tab

* Fix long document titles breaking connection tracker's UI
2022-04-26 11:40:32 +02:00
Rafał CieślakandGrzegorz Zdunek 6f48403327 Show database username suggestions in Teleport Connect (#754)
* 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>
2022-04-22 12:56:33 +02:00
Matheus 8ccfeac7dc Add IAM method to web ui (#690) 2022-04-19 13:25:24 +00:00
Rafał Cieślak 614746c378 Use dropdown for the db connect button (#732)
* Remove unnecessary code related to gateway creation

* Rename MenuSshLogin to MenuLogin

* MenuLogin: Accept placeholder as a prop

* Use dropdown for the db connect button

* Rename MenuLogin's onOpen to getLoginItems

* MenuLogin: Convert default export to named export
2022-04-14 10:54:45 +00:00
Lisa Kim d343e5618c Remove u2f components and logic (#711)
* Also updates e-ref
2022-04-04 17:56:49 -07:00
Lisa Kim f916657669 Update getMfaOptions to createMfaOptions 2022-03-30 17:30:43 -07:00
Lisa Kim 28dabc20ba Fix half auto-filling OTP's for input boxes meant for it (#706)
* Update's e-ref
2022-03-30 10:59:21 -07:00
Grzegorz Zdunek 2d07c288a4 Use connection dropdown instead of modal for supplying SSH username 2022-03-24 17:16:34 +01:00
Grzegorz Zdunek 4f8704c083 Render ssh menu item as NavLink only when URL is provided 2022-03-24 17:16:34 +01:00
t-rutterandZac Bergquist 6fa7a9cacf Update FormLogin.tsx (#608)
* Update FormLogin.tsx

* Update FormLogin.story.test.tsx.snap

Updated FormLogin story snapshot

* Update FieldInput.tsx

Added  type 'tel' to FieldInput

Co-authored-by: Zac Bergquist <zmb3@users.noreply.github.com>
2022-03-02 23:34:38 +00:00
Zac BergquistandLisa Kim 20f5ff1814 Disable autocomplete on the SSH login input (#605)
This prevents password managers like 1password from attempting to
autocomplete the SSH login, which is not a standard password field.

Fixes gravitational/teleport#10356

Co-authored-by: Lisa Kim <lisa@goteleport.com>
2022-03-02 23:11:38 +00:00
Alexey Kontsevoyandgzdunek b55dd4f2f1 Teleterm Preview (beta) (#590)
* first version

* Fix build

* Fix

* fixes

* add app context

* Add Navigator

* more screens

* add cluster

* grpc

* Add gateways

* add node-pty

* add tshd daemon

* add main process quick reload

* add tsh access

* Use default terminal shell and add context menu (#444)

* node-pty errors

* Fix build process and include `tsh` in the package  (#451)

* Use single `package.json` config

* Include `tsh` in app package

* fix linux package target

* add global search

* fix tsc (errors) build step

* Add mocks

* Add logging to file (#455)

* minor cleanups

* Add keyboard shortcuts service (#462)

* add sync statuses for teleport resources

* add teleterm icon (#470)

* Fix dev reloads of main process

* minore bug fixes

* implement auth

* update webpack configs to v5 (#492)

* arrange the cards evenly depending on the available space & add drag and drop (#486)

* fix text truncation on tabs

* Add logout and cluster removal

* Add context menu to clusters (#500)

* Add tabs shortcuts & open new tab basing on active tab (#495)

* Make xterm understand resize sequence (#507)

* use `Immer` in teleterm store (#516)

* Add apps and kubes

* Teleterm bugfixes (#519)

* add command palette

* Replace Gateways with Connections

* add tc

* Clean up

* Add basic config service (#526)

* add fonts config (#528)

* Fix resize bug

* Minor teleterm fixes (#531)

* remove exit code checking before closing a tab

* prevent closing `home` tab

* Fix crashing errors

* Remove Roles and Activities

* Remove GlobalSearch

* Add context menu to tab items (#533)

* make quickIInput always visible on top

* Add workspace service (#538)

* Add recently opened documents to workspace (#547)

* add recently opened documents to workspace

* review fixes

* review fixes

* add `ClusterConnect` component

* remove the `close` item and electron help items from the app menu (#560)

* improve navigator behaviour (#565)

* improve navigator behaviour

* Add new connection handling

* Add username to gateways

* add kube connect command

* Gateway should render instructions per DB protocol

* Address design changes

Co-authored-by: gzdunek <gzdunek@users.noreply.github.com>
2022-02-08 18:40:28 -05:00
Grzegorz Zdunek 181fe61a20 Replace waitForElement and wait with waitFor in tests (#529) 2022-01-05 11:50:46 +01:00
Lisa Kim 0a66e17a62 Add pagination to SelectFilters component (#518) 2021-12-23 14:14:02 -08:00