* Rename old "quick input" to the current "command bar" feature name
* Remove 'Droid Sans Fallback' from Linux fonts
* Add docs for config
* Link to the proper documentation section
* Apply suggestions from @ravicious and @ibeckermayer
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
* Adjust property descriptions with the names used in User Interface
* Drop `Courier New`
* Simplify `$schema` description
* Fix lint issues
* Add a break line after each heading
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
* Schema should not be modified
* Config file is created on first launch
---------
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
Co-authored-by: Isaiah Becker-Mayer <isaiah@goteleport.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
* Expose `openConfigFile` IPC
* Add "Open Config File" to `NavigationMenu`
* Make `NavigationMenu` more concise
* Remove unused imports
* Call "three dots" menu "More Options" to make it easier to refer to in the docs
* Show a notification with a config file path
* Render the icon component only in `NavigationItem`
* Render the separator only with access request items
* Use just `separator` string instead of an object
* Render `StyledListItem` as a button
* Shorten the notification
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
---------
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
* Fix uncaught exception handling in Connect's shared process
Without this patch, an uncaught exception being thrown would result in
the following error due to how binding methods to class instances works:
C:\Users\rav\AppData\Local\Programs\teleport-connect\resources\app.asar\
build\app\dist\main\sharedProcess.js:73614
this.getLogger().error(message, ...args);
^
TypeError: this.getLogger is not a function
at process.error (C:\Users\rav\AppData\Local\Programs\teleport-connect\
resources\app.asar\build\app\dist\main\sharedProcess.js:73614:10)
at process.emit (node:events:513:28)
at process._fatalException (node:internal/process/execution:167:25)
* Log the origin of the uncaught exception
* Add a function that returns error that might happen during loading the file
* Return validation and file loading errors from `ConfigService`
* Discard file storage updates when the file was not loaded correctly
* Do not show usage reporting dialog when the file was not loaded correctly
* Make title of notifications a little bit smaller, so longer titles do not look weird
* Get rid of sync fs functions wherever possible in file storage
* Move error handling code to `createFileStorage`
* Improve `getConfigError` comment
* Rename `discardUpdatesWhenLoadingFileFailed` to `discardUpdatesOnLoadError`
* Fix the error message in `notifyAboutConfigErrors`
* Revert "Make title of notifications a little bit smaller, so longer titles do not look weird"
* Make `writeSync` async too
* Return `unknown` from `FileStorage.get`
* Add a TODO comment about createFileStorage type
* Add "the" to "Using default config instead"
* Remove `toString()`
---------
Co-authored-by: Rafał Cieślak <rafal.cieslak@goteleport.com>
* Connect: Remove leftovers from resource cache removal
* GetAll* RPCs were used in the resource cache and are no longer used.
* ListApps was pretty much never actually used as we didn't ever list apps
in Connect.
* ClusterContext.state.searchValue ceased to be used after we moved to
fetching resources from the backend.
* Remove remaining leftovers from tshd client mock
* Remove unused imports
* Rename `putAllSync` to `writeSync`
* Extend `FileStorage` with functions to replace an entire state and return file path used to create it
* Add `updateJsonSchema` function
* Generate schema for the app config
* Always return a string from `createMockFileStorage().getFilePath()`
* Add missing license headers
* Rename 'teleport_connect_config_schema.json' to 'schema_app_config.json'
* Rename `getKeyboardShortcutDescription` to `getShortcutDesc`
* Rename `keyboardShortcutSchema` to `shortcutSchema`
* Update a valid shortcut message
* Rename `configJsonSchemaFile` to `jsonSchema`
* Simplify `updateJsonSchema`
* Set `$refStrategy` to none
* Add missing description for `usageReporting.enabled`
* Bump zod to the latest (improves TS performance)
* Move `configService` implementation to `configStore`
* Rename `configStore` to `configService`
* Move `updateJsonSchema` to `createConfigService`
* Move `validateStoredConfig` outside `createConfigService`
* Rename `createAppConfigSchema.ts` to `appConfigSchema.ts`, `getKeyboardShortcutSchema.ts` to `keyboardShortcutSchema.ts`
* Export `createKeyboardShortcutSchema`
* Add license header
* 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.
* 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>
* Make naming around keyboard shortcuts more consistent
Previously, we used words like: "key", "type", "shortcut" which were really confusing (and I wrote this code), because it was hard to tell what exactly they describe.
From now, we will use only "accelerator" (borrowed from Electron) and "action" words.
For example, in a shortcut "Command+1": "tab-1":
- "Command+1" is "accelerator"
- "tab-1" is "action"
* Use "+" instead of "-" as a separator
With "-" we are not able to use this symbol as a valid key code.
* Rename some config keys to follow the same naming pattern
* Rename keyboard shortcuts to match config keys
* Extract `mapAcceleratorsToActions` to a function
* Rename other "keyboard shortcuts" to "accelerators" and "actions"
* 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
Without this early return, createPtyProcess of PtyHostService would call
the callback twice on error. This doesn't have much negative implications
since the gRPC implementation will simply ignore the second call, however
it does pose some problems when trying to manually test PTY failures
by making `new PtyProcess` return an error.
* Remove sans serif from config
* Pass 'fonts.monoFamily' as style prop
* Get rid of `getSansSerif` function
* Use mono font from theme
* Add 'terminal.fontFamily' and 'terminal.fontSize' config options
* Require 'terminal.fontSize' size to be int
* Revert unneeded changes to mono font usage
* Add comment with a link to `ctrl.ts`
* Allow 'terminal.fontSize' to be in the range 1-256
* 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
* Update teleterm README
* Remove the Usage section in favor of linking to the docs.
* Mention that the OSS build is broken.
* Remove post-webapps-merge inconsistencies.
* Remove "Gravitational", align teleterm desc with teleport
* Update JS grpc-tools to 1.12.4
1.11.2 didn't have support for arm64 so we had to do all this extra stuff
in the Dockerfile.
1.11.3 added support for Darwin arm64 and 1.12.4 finally adds support for
Linux arm64. This means we can completely remove extra cruft and just
install grpc-tools 1.12.4 on all architectures.
* Add comment to ptyHostService.proto
* Adjust go_package of lib/prehog Go protobufs
This makes them follow the pattern set out by api/proto and proto.
* Adjust go_package of lib/teleterm Go protobufs
* Use single buf.gen.yaml to generate JS protos
This also entailed changing the location of lib/teleterm protos and changing
the value of their package specifier to match the conventions in other parts
of the codebase. This is a breaking change but that is fine for Connect
as the protos are used locally only and each build ships with matching
protobufs.
* Make web/packages/teleterm use protobufs from gen-proto-js
We used to copy protobufs over to web/packages/teleterm/src/services/tshd
since webapps used to be in a separate repo.
This is no longer the case, so we can just make teleterm use protobufs
from gen-proto-js.
* Move prehog & teleterm protos into proto/teleport/lib
* Generate JS protos to gen/proto/js
* Move lib/teleterm Go protobufs to gen/proto/go
* Move lib/prehog Go protobufs to gen/proto/go
* Rename lib/teleterm proto package
* Re-enable linter rules for teleterm & prehog
* Update prehogv1 path in usagereporter_test.go
* Use except instead of ignore_only to allow Google API-style responses
* Add UNARY_RPC to api/proto & proto
* Ignore gen/ when running addlicense
* buf-js.gen.yaml: Remove comment about lack of go_package for JS
* Move prehog protos to proto/prehog/v1alpha
* Adjust prehog's go_package to match proto package
* Initial pass at lint and test GHA for UI.
* Fix lint
* Add --frozen-lockfile
* Skip the e directory if it doesn't exist while linting.
* Update failing snapshots.
* use a more reasonable filter for eslint to support missing e
* ignore type check on e imports.
* ignore failing file that requires e teleterm file.
* fix lint
* quiet down the log output for prettier-write.
* Render loading screen when initialization is in progress
* Wait with showing the window until it is ready to prevent "empty screen" flash
* Add comments
* Remove CLANG_FORMAT from Makefiles
It was used to format protos but we use Buf for that since v10.
* Move installing grpc_node_plugin into Dockerfile
This commit basically takes grpc_node_plugin compilation from
Dockerfile-teleterm and moves it to Dockerfile.
* Replace Dockerfile-teleterm with Dockerfile
After moving grpc_node_plugin compilation to Dockerfile, the only remaining
thing that Dockerfile-teleterm does is installing rpm so that we can make
an RPM package for Connect during tag builds.
Installing this package can be simply moved to Dockerfile.
* Remove grpc-teleterm Make target in favor of grpc
* Add updated protobufs
It looks like they're a result of someone changing protos in lib/prehog
without running `make grpc-teleterm` separately. Which is why we're getting
rid of grpc-teleterm as a separate Make target in the first place. ;)
* Rename assets to build_resources
* Add resources\bin to Path during installation on Windows
* Adjust docs related to USE_SYSTEM_FPM
It turns out you need that for deb packages too.
* Create symlink to bundled tsh on Linux targets
* after-install: Get rid of old symlink removal
* Expand story for QuickInput
* Make command suggestions stay in place
* Align suggestion icons to the top rather than center
This makes it easier to tell when one suggestion ends and another starts.
* Add install & uninstall cmds to command bar
* Exclude new commands from OSes other than macOS
* Implement commands for symlinking tsh
This unbreaks some Connect stories which depend on keyboard shortcuts
config.
If we ever need to change the config in stories or tests, we should
revisit the mock. But it might be enough to call the `set` method on
the config service.