Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

[v9] Backport Teleport Connect (2 of 5) #763

Merged
merged 26 commits into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4340b06
Take `localClusterUri` into account in `QuickInput` (#679)
gzdunek Mar 18, 2022
a28389d
Display cluster name for each connection
gzdunek Mar 17, 2022
d20a545
Automatically try to connect a connection when possible
gzdunek Mar 17, 2022
9cbf880
Update connection icon
gzdunek Mar 17, 2022
5022e8c
Always use root cluster URI to obtain `documentsService` in `useServe…
gzdunek Mar 17, 2022
3837f1a
Don't close the tab on non-zero exit code
ravicious Mar 18, 2022
eac4024
Autocomplete database names for tsh proxy db
ravicious Mar 18, 2022
bc3b5ae
Change placeholder text in `ClusterAdd`
gzdunek Mar 18, 2022
52a2ce1
Show leaf cluster name when possible in Connections list
gzdunek Mar 18, 2022
36e956c
Hide kubes and apps
gzdunek Mar 18, 2022
be813e9
Force `TopBar` items to take full height
gzdunek Mar 18, 2022
1bdf1ce
Change shortcut to open `QuickInput`
gzdunek Mar 18, 2022
5c0877b
Update electron-builder to 23.0.3
ravicious Mar 22, 2022
a46e0a4
remove `Navigator` code (#685)
gzdunek Mar 22, 2022
6a35c75
Prevent breaking layout on long cluster name (#688)
gzdunek Mar 22, 2022
0059bdb
Show username when possible in identity list (#687)
gzdunek Mar 22, 2022
a28666a
Update command for updating proto files
ravicious Mar 24, 2022
8e0ef96
Update protobufs for Teleterm (LoginRequest params)
ravicious Mar 24, 2022
93114bb
Render ssh menu item as `NavLink` only when URL is provided
gzdunek Mar 23, 2022
3525cbb
Use connection dropdown instead of modal for supplying SSH username
gzdunek Mar 23, 2022
fbb5107
Adjust `Identity` layout, combine `logout` and `clusterRemove` into a…
gzdunek Mar 22, 2022
a7f9012
Change command `cluster-remove` to `cluster-logout`
gzdunek Mar 23, 2022
1de0d8d
Apply `Identity` design changes
gzdunek Mar 23, 2022
80ef60c
Enable `babel-plugin-styled-components` in production and tests (#697)
gzdunek Mar 25, 2022
cb51f29
Make connections icon bigger
gzdunek Mar 23, 2022
5ded89c
Properly use `css` prop
gzdunek Mar 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/build/.babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ module.exports = {
development: {
plugins: [
...plugins,
'babel-plugin-styled-components',
['babel-plugin-styled-components', { displayName: true, ssr: false }],
],
},
},
presets: makePresents(),
plugins,
plugins: [
...plugins,
['babel-plugin-styled-components', { displayName: false, ssr: false }],
],
};
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"cross-env": "5.0.5",
"cross-spawn": "6.0.5",
"css-loader": "^6.5.1",
"electron-builder": "22.14.13",
"electron-builder": "23.0.3",
"eslint": "^8.3.0",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-babel": "^5.3.1",
Expand Down
16 changes: 11 additions & 5 deletions packages/shared/components/MenuSshLogin/MenuSshLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { NavLink } from 'react-router-dom';
import Menu, { MenuItem } from 'design/Menu';
import { space } from 'design/system';
import { MenuSshLoginProps } from './types';
import { ButtonBorder } from 'design';
import { ButtonBorder, Flex } from 'design';
import { CarrotDown } from 'design/Icon';

class MenuSshLogin extends React.Component<MenuSshLoginProps> {
Expand Down Expand Up @@ -100,7 +100,7 @@ export const LoginItemList = ({ logins, onClick, onKeyPress }) => {
key={key}
px="2"
mx="2"
as={NavLink}
as={url ? NavLink : StyledButton}
to={url}
onClick={(e: Event) => {
onClick(e, login);
Expand All @@ -112,7 +112,7 @@ export const LoginItemList = ({ logins, onClick, onKeyPress }) => {
});

return (
<React.Fragment>
<Flex flexDirection="column">
<Input
p="2"
m="2"
Expand All @@ -123,10 +123,16 @@ export const LoginItemList = ({ logins, onClick, onKeyPress }) => {
autoComplete="off"
/>
{$menuItems}
</React.Fragment>
</Flex>
);
};

const StyledButton = styled.button`
color: inherit;
border: none;
flex: 1;
`;

const StyledMenuItem = styled(MenuItem)(
({ theme }) => `
color: ${theme.colors.grey[400]};
Expand All @@ -150,7 +156,7 @@ const Input = styled.input(
border: 1px solid ${theme.colors.subtle};
border-radius: 4px;
box-sizing: border-box;
color: #263238;
color: ${theme.colors.grey[900]};
height: 32px;
outline: none;

Expand Down
2 changes: 1 addition & 1 deletion packages/teleterm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,6 @@ lib/teleterm/api/protogen/

```sh
$ cd teleport
$ rm -rf ./../webapps/packages/teleterm/src/services/tshd/v1/ && cp -R lib/teleterm/api/protogen/js/v1/ ./../webapps/packages/teleterm/src/services/tshd/
$ rm -rf ./../webapps/packages/teleterm/src/services/tshd/v1/ && cp -R lib/teleterm/api/protogen/js/v1 ./../webapps/packages/teleterm/src/services/tshd/v1
```

This file was deleted.

2 changes: 0 additions & 2 deletions packages/teleterm/src/mainProcess/mainProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
import { ChildProcess, spawn } from 'child_process';
import { Logger, RuntimeSettings } from 'teleterm/types';
import { getAssetPath } from './runtimeSettings';
import { subscribeToClusterContextMenuEvent } from './contextMenus/clusterContextMenu';
import { subscribeToTerminalContextMenuEvent } from './contextMenus/terminalContextMenu';
import {
ConfigService,
Expand Down Expand Up @@ -103,7 +102,6 @@ export default class MainProcess {
});

subscribeToTerminalContextMenuEvent();
subscribeToClusterContextMenuEvent();
subscribeToTabContextMenuEvent();
subscribeToConfigServiceEvents(this.configService);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/teleterm/src/mainProcess/mainProcessClient.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ipcRenderer } from 'electron';
import { openClusterContextMenu } from './contextMenus/clusterContextMenu';
import { openTerminalContextMenu } from './contextMenus/terminalContextMenu';
import { MainProcessClient } from './types';
import { createConfigServiceClient } from '../services/config';
Expand All @@ -11,7 +10,6 @@ export default function createMainProcessClient(): MainProcessClient {
return ipcRenderer.sendSync('main-process-get-runtime-settings');
},
openTerminalContextMenu,
openClusterContextMenu,
openTabContextMenu,
configService: createConfigServiceClient(),
};
Expand Down
9 changes: 0 additions & 9 deletions packages/teleterm/src/mainProcess/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type RuntimeSettings = {
export type MainProcessClient = {
getRuntimeSettings(): RuntimeSettings;
openTerminalContextMenu(): void;
openClusterContextMenu(options: ClusterContextMenuOptions): void;
openTabContextMenu(options: TabContextMenuOptions): void;
configService: ConfigService;
};
Expand All @@ -41,18 +40,10 @@ export interface TabContextMenuOptions {
onDuplicatePty(): void;
}

export const ClusterContextMenuEventChannel = 'ClusterContextMenuEventChannel';
export const TerminalContextMenuEventChannel = 'TerminalContextMenuEventChannel';
export const TabContextMenuEventChannel = 'TabContextMenuEventChannel';
export const ConfigServiceEventChannel = 'ConfigServiceEventChannel';

export enum ClusterContextMenuEventType {
Refresh = 'Refresh',
Login = 'Login',
Logout = 'Logout',
Remove = 'Remove',
}

export enum TabContextMenuEventType {
Close = 'Close',
CloseOthers = 'CloseOthers',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type KeyboardShortcutType =
| 'tab-new'
| 'tab-previous'
| 'tab-next'
| 'focus-global-search'
| 'open-quick-input'
| 'toggle-connections'
| 'toggle-clusters'
| 'toggle-identity';
Expand All @@ -44,7 +44,7 @@ export const keyboardShortcutsConfigProvider: ConfigServiceProvider<KeyboardShor
'tab-new': 'Command-T',
'tab-previous': 'Control-Shift-Tab',
'tab-next': 'Control-Tab',
'focus-global-search': 'F1',
'open-quick-input': 'Command-K',
'toggle-connections': 'Command-O',
'toggle-clusters': 'Command-E',
'toggle-identity': 'Command-I',
Expand All @@ -64,7 +64,7 @@ export const keyboardShortcutsConfigProvider: ConfigServiceProvider<KeyboardShor
'tab-new': 'Ctrl-Shift-T',
'tab-previous': 'Ctrl-PageUp',
'tab-next': 'Ctrl-PageDown',
'focus-global-search': 'F1',
'open-quick-input': 'Ctrl-K',
'toggle-connections': 'Ctrl-O',
'toggle-clusters': 'Ctrl-E',
'toggle-identity': 'Ctrl-I',
Expand Down
19 changes: 12 additions & 7 deletions packages/teleterm/src/services/tshd/createClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ export default function createClient(addr: string) {
},

async login(params: types.LoginParams, abortSignal?: types.TshAbortSignal) {
const ssoParams = params.oss
const ssoParams = params.sso
? new api.LoginRequest.SsoParams()
.setProviderName(params.oss.providerName)
.setProviderType(params.oss.providerType)
.setProviderName(params.sso.providerName)
.setProviderType(params.sso.providerType)
: null;

const localParams = params.local
Expand All @@ -163,10 +163,15 @@ export default function createClient(addr: string) {
: null;

return withAbort(abortSignal, callRef => {
const req = new api.LoginRequest()
.setClusterUri(params.clusterUri)
.setSso(ssoParams)
.setLocal(localParams);
const req = new api.LoginRequest().setClusterUri(params.clusterUri);

// LoginRequest has oneof on `Local` and `Sso`, which means that setting one of them clears
// the other.
if (ssoParams) {
req.setSso(ssoParams);
} else {
req.setLocal(localParams);
}

return new Promise<void>((resolve, reject) => {
callRef.current = tshd.login(req, err => {
Expand Down
2 changes: 1 addition & 1 deletion packages/teleterm/src/services/tshd/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type TshAbortSignal = {

export type LoginParams = {
clusterUri: string;
oss?: {
sso?: {
providerType: string;
providerName: string;
};
Expand Down

This file was deleted.

108 changes: 0 additions & 108 deletions packages/teleterm/src/services/tshd/v1/auth_challenge_pb.d.ts

This file was deleted.

Loading