|
5 | 5 | * This module sets up the necessary components
|
6 | 6 | * for the webview to be shown.
|
7 | 7 | */
|
8 |
| -import globals, { isWeb } from '../../../shared/extensionGlobals' |
| 8 | +import globals from '../../../shared/extensionGlobals' |
9 | 9 | import { getIdeProperties, isCloud9 } from '../../../shared/extensionUtilities'
|
10 | 10 | import { VueWebview } from '../../../webviews/main'
|
11 | 11 | import * as vscode from 'vscode'
|
@@ -35,26 +35,24 @@ import {
|
35 | 35 | hasSso,
|
36 | 36 | BuilderIdKind,
|
37 | 37 | findSsoConnections,
|
38 |
| - authCommands, |
39 | 38 | } from '../../utils'
|
40 | 39 | import { Region } from '../../../shared/regions/endpoints'
|
41 | 40 | import { CancellationError } from '../../../shared/utilities/timeoutUtils'
|
42 | 41 | import { validateSsoUrl, validateSsoUrlFormat } from '../../sso/validation'
|
43 |
| -import { awsIdSignIn, showCodeWhispererConnectionPrompt } from '../../../codewhisperer/util/showSsoPrompt' |
44 |
| -import { AuthError, ServiceItemId, isServiceItemId, authFormTelemetryMapping, userCancelled } from './types' |
| 42 | +import { awsIdSignIn } from '../../../codewhisperer/util/showSsoPrompt' |
| 43 | +import { AuthError, ServiceItemId, authFormTelemetryMapping, userCancelled } from './types' |
45 | 44 | import { connectToEnterpriseSso } from '../../../codewhisperer/util/getStartUrl'
|
46 | 45 | import { trustedDomainCancellation } from '../../sso/model'
|
47 | 46 | import { CredentialSourceId, Result, telemetry } from '../../../shared/telemetry/telemetry'
|
48 | 47 | import { AuthFormId } from './authForms/types'
|
49 | 48 | import { handleWebviewError } from '../../../webviews/server'
|
50 |
| -import { Commands, RegisteredCommand, VsCodeCommandArg, placeholder } from '../../../shared/vscode/commands2' |
| 49 | +import { placeholder } from '../../../shared/vscode/commands2' |
51 | 50 | import { ClassToInterfaceType } from '../../../shared/utilities/tsUtils'
|
52 | 51 | import { debounce } from 'lodash'
|
53 | 52 | import { submitFeedback } from '../../../feedback/vue/submitFeedback'
|
54 | 53 | import { InvalidGrantException } from '@aws-sdk/client-sso-oidc'
|
55 | 54 | import { ExtStartUpSources } from '../../../shared/telemetry'
|
56 |
| -import { CommonAuthWebview } from '../../../login/webview/vue/backend' |
57 |
| -import { AuthSource, AuthSources } from '../../../login/webview/util' |
| 55 | +import { AuthSource } from '../../../login/webview/util' |
58 | 56 | import { focusAmazonQPanel } from '../../../codewhispererChat/commands/registerCommands'
|
59 | 57 |
|
60 | 58 | // This file has some used functions, but most of it should be removed soon. We have a new
|
@@ -714,47 +712,6 @@ const Panel = VueWebview.compilePanel(AuthWebview)
|
714 | 712 | let activePanel: InstanceType<typeof Panel> | undefined
|
715 | 713 | let subscriptions: vscode.Disposable[] | undefined
|
716 | 714 |
|
717 |
| -let showManageConnections: RegisteredCommand<any> | undefined |
718 |
| -export function getShowManageConnections(): RegisteredCommand<any> { |
719 |
| - if (!showManageConnections) { |
720 |
| - throw new Error('showManageConnections not registered') |
721 |
| - } |
722 |
| - return showManageConnections |
723 |
| -} |
724 |
| - |
725 |
| -export function registerCommands(context: vscode.ExtensionContext, prefix: string) { |
726 |
| - showManageConnections = Commands.register( |
727 |
| - { id: `aws.${prefix}.auth.manageConnections`, compositeKey: { 1: 'source' } }, |
728 |
| - async (_: VsCodeCommandArg, source: AuthSource, serviceToShow?: ServiceItemId) => { |
729 |
| - if (_ !== placeholder) { |
730 |
| - source = AuthSources.vscodeComponent |
731 |
| - } |
732 |
| - |
733 |
| - // The auth webview page does not make sense to use in C9, |
734 |
| - // so show the auth quick pick instead. |
735 |
| - if (isCloud9('any') || isWeb()) { |
736 |
| - if (source.toLowerCase().includes('codewhisperer')) { |
737 |
| - // Show CW specific quick pick for CW connections |
738 |
| - return showCodeWhispererConnectionPrompt() |
739 |
| - } |
740 |
| - return authCommands().addConnection.execute() |
741 |
| - } |
742 |
| - |
743 |
| - if (!isServiceItemId(serviceToShow)) { |
744 |
| - serviceToShow = undefined |
745 |
| - } |
746 |
| - |
747 |
| - // TODO: hack |
748 |
| - if (prefix === 'toolkit') { |
749 |
| - CommonAuthWebview.authSource = source |
750 |
| - await vscode.commands.executeCommand('aws.explorer.setLoginService', serviceToShow) |
751 |
| - await vscode.commands.executeCommand('setContext', 'aws.explorer.showAuthView', true) |
752 |
| - await vscode.commands.executeCommand('aws.toolkit.AmazonCommonAuth.focus') |
753 |
| - } |
754 |
| - } |
755 |
| - ) |
756 |
| -} |
757 |
| - |
758 | 715 | //todo: delete?
|
759 | 716 | export async function showAuthWebview(
|
760 | 717 | ctx: vscode.ExtensionContext,
|
|
0 commit comments