Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { AppRunnerImageRepositoryWizard } from './imageRepositoryWizard'
import { AppRunnerCodeRepositoryWizard } from './codeRepositoryWizard'
import { GitExtension } from '../../../shared/extensions/git'
import { makeDeploymentButton } from './deploymentButton'
import { apprunnerCreateServiceDocsUrl } from '../../../shared/constants'
import { createExitPrompter } from '../../../shared/ui/common/exitPrompter'
import { DefaultIamClient } from '../../../shared/clients/iamClient'
import { DefaultEcrClient } from '../../../shared/clients/ecrClient'
import { DefaultAppRunnerClient } from '../../../shared/clients/apprunnerClient'
import { getAppRunnerCreateServiceDocUrl } from '../../../shared/extensionUtilities'

const localize = nls.loadMessageBundle()

Expand Down Expand Up @@ -68,7 +68,7 @@ function createInstanceStep(): Prompter<AppRunner.InstanceConfiguration> {

return picker.createQuickPick(items, {
title: localize('AWS.apprunner.createService.selectInstanceConfig.title', 'Select instance configuration'),
buttons: createCommonButtons(apprunnerCreateServiceDocsUrl),
buttons: createCommonButtons(getAppRunnerCreateServiceDocUrl()),
})
}

Expand All @@ -92,7 +92,7 @@ function createSourcePrompter(

return picker.createQuickPick([ecrPath, repositoryPath], {
title: localize('AWS.apprunner.createService.sourceType.title', 'Select a source code location type'),
buttons: [autoDeployButton, ...createCommonButtons(apprunnerCreateServiceDocsUrl)],
buttons: [autoDeployButton, ...createCommonButtons(getAppRunnerCreateServiceDocUrl())],
})
}

Expand Down Expand Up @@ -137,7 +137,7 @@ export class CreateAppRunnerServiceWizard extends Wizard<AppRunner.CreateService
input.createInputBox({
title: localize('AWS.apprunner.createService.name.title', 'Name your service'),
validateInput: validateName, // TODO: we can check if names match any already made services
buttons: createCommonButtons(apprunnerCreateServiceDocsUrl),
buttons: createCommonButtons(getAppRunnerCreateServiceDocUrl()),
})
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ import { AppRunnerClient } from '../../../shared/clients/apprunnerClient'
import { makeDeploymentButton } from './deploymentButton'
import { createLabelQuickPick, createQuickPick, QuickPickPrompter } from '../../../shared/ui/pickerPrompter'
import { createInputBox, InputBoxPrompter } from '../../../shared/ui/inputPrompter'
import {
apprunnerConnectionHelpUrl,
apprunnerConfigHelpUrl,
apprunnerRuntimeHelpUrl,
apprunnerCreateServiceDocsUrl,
} from '../../../shared/constants'
import { apprunnerConnectionHelpUrl, apprunnerConfigHelpUrl, apprunnerRuntimeHelpUrl } from '../../../shared/constants'
import { Wizard, WIZARD_BACK } from '../../../shared/wizards/wizard'
import { openUrl } from '../../../shared/utilities/vsCodeUtils'
import { getAppRunnerCreateServiceDocUrl } from '../../../shared/extensionUtilities'

const localize = nls.loadMessageBundle()

Expand Down Expand Up @@ -140,7 +136,7 @@ function createPortPrompter(): InputBoxPrompter {
validateInput: validatePort,
title: localize('AWS.apprunner.createService.selectPort.title', 'Enter a port for the new service'),
placeholder: 'Enter a port',
buttons: createCommonButtons(apprunnerCreateServiceDocsUrl),
buttons: createCommonButtons(getAppRunnerCreateServiceDocUrl()),
})
}

Expand Down Expand Up @@ -220,7 +216,7 @@ function createCodeRepositorySubForm(git: GitExtension): WizardForm<AppRunner.Co
codeConfigForm.body.StartCommand.bindPrompter((state) => createStartCommandPrompter(state.Runtime!))
codeConfigForm.body.Port.bindPrompter(createPortPrompter)
codeConfigForm.body.RuntimeEnvironmentVariables.bindPrompter(() =>
createVariablesPrompter(createCommonButtons(apprunnerCreateServiceDocsUrl))
createVariablesPrompter(createCommonButtons(getAppRunnerCreateServiceDocUrl()))
)
// TODO: ask user if they would like to save their parameters into an App Runner config file

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import * as vscode from 'vscode'
import { AppRunner, IAM } from 'aws-sdk'
import { createCommonButtons, QuickInputButton, QuickInputToggleButton } from '../../../shared/ui/buttons'
import { toArrayAsync } from '../../../shared/utilities/collectionUtils'
Expand All @@ -21,8 +20,7 @@ import { makeDeploymentButton } from './deploymentButton'
import { IamClient } from '../../../shared/clients/iamClient'
import { createRolePrompter } from '../../../shared/ui/common/roles'
import { getLogger } from '../../../shared/logger/logger'
import { isCloud9 } from '../../../shared/extensionUtilities'
import { apprunnerCreateServiceDocsUrl } from '../../../shared/constants'
import { getAppRunnerCreateServiceDocUrl, isCloud9 } from '../../../shared/extensionUtilities'
import { createExitPrompter } from '../../../shared/ui/common/exitPrompter'

const localize = nls.loadMessageBundle()
Expand Down Expand Up @@ -162,7 +160,7 @@ function createPortPrompter(): Prompter<string> {
validateInput: validatePort,
title: localize('AWS.apprunner.createService.selectPort.title', 'Enter a port for the new service'),
placeholder: 'Enter a port',
buttons: createCommonButtons(apprunnerCreateServiceDocsUrl),
buttons: createCommonButtons(getAppRunnerCreateServiceDocUrl()),
})
}

Expand Down Expand Up @@ -249,7 +247,7 @@ function createImageRepositorySubForm(

form.ImageConfiguration.Port.bindPrompter(() => createPortPrompter())
form.ImageConfiguration.RuntimeEnvironmentVariables.bindPrompter(() =>
createVariablesPrompter(createCommonButtons(apprunnerCreateServiceDocsUrl))
createVariablesPrompter(createCommonButtons(getAppRunnerCreateServiceDocUrl()))
)

return subform
Expand All @@ -262,7 +260,7 @@ export class AppRunnerImageRepositoryWizard extends Wizard<AppRunner.SourceConfi
const createAccessRolePrompter = () => {
return createRolePrompter(iamClient, {
title: localize('AWS.apprunner.createService.selectRole.title', 'Select a role to pull from ECR'),
helpUrl: vscode.Uri.parse(apprunnerCreateServiceDocsUrl),
helpUrl: getAppRunnerCreateServiceDocUrl(),
roleFilter: (role) => (role.AssumeRolePolicyDocument ?? '').includes(appRunnerEcrEntity),
createRole: createEcrRole.bind(undefined, iamClient),
}).transform((resp) => resp.Arn)
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import * as nls from 'vscode-nls'
import globals, { initialize, isWeb } from './shared/extensionGlobals'
import { join } from 'path'
import { Commands } from './shared/vscode/commands2'
import { documentationUrl, endpointsFileUrl, githubCreateIssueUrl, githubUrl } from './shared/constants'
import { getIdeProperties, aboutExtension, isCloud9 } from './shared/extensionUtilities'
import { endpointsFileUrl, githubCreateIssueUrl, githubUrl } from './shared/constants'
import { getIdeProperties, aboutExtension, isCloud9, getDocUrl } from './shared/extensionUtilities'
import { logAndShowError, logAndShowWebviewError } from './shared/utilities/logAndShowUtils'
import { AuthStatus, telemetry } from './shared/telemetry/telemetry'
import { openUrl } from './shared/utilities/vsCodeUtils'
Expand Down Expand Up @@ -149,7 +149,7 @@ export async function activateCommon(
),
// register URLs in extension menu
Commands.register(`aws.toolkit.help`, async () => {
void openUrl(vscode.Uri.parse(documentationUrl))
void openUrl(getDocUrl())
telemetry.aws_help.emit()
})
)
Expand Down
12 changes: 8 additions & 4 deletions packages/core/src/lambda/commands/createNewSamApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ import { isTemplateTargetProperties } from '../../shared/sam/debugger/awsSamDebu
import { TemplateTargetProperties } from '../../shared/sam/debugger/awsSamDebugConfiguration'
import { openLaunchJsonFile } from '../../shared/sam/debugger/commands/addSamDebugConfiguration'
import { waitUntil } from '../../shared/utilities/timeoutUtils'
import { debugNewSamAppUrl, launchConfigDocUrl } from '../../shared/constants'
import { getIdeProperties, isCloud9 } from '../../shared/extensionUtilities'
import {
getIdeProperties,
getDebugNewSamAppDocUrl,
isCloud9,
getLaunchConfigDocUrl,
} from '../../shared/extensionUtilities'
import { execFileSync } from 'child_process'
import { writeFile } from 'fs-extra'
import { checklogs } from '../../shared/localizedText'
Expand Down Expand Up @@ -316,7 +320,7 @@ export async function createNewSamApplication(
)
.then(async (buttonText) => {
if (buttonText === helpText) {
void openUrl(vscode.Uri.parse(launchConfigDocUrl))
void openUrl(getLaunchConfigDocUrl())
}
})
}
Expand Down Expand Up @@ -441,7 +445,7 @@ async function showCompletionNotification(appName: string, configs: string): Pro
if (action === openJson) {
await openLaunchJsonFile()
} else if (action === learnMore) {
void openUrl(vscode.Uri.parse(debugNewSamAppUrl))
void openUrl(getDebugNewSamAppDocUrl())
}
}

Expand Down
19 changes: 9 additions & 10 deletions packages/core/src/lambda/wizards/samDeployWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const localize = nls.loadMessageBundle()

import * as path from 'path'
import * as vscode from 'vscode'
import { samDeployDocUrl } from '../../shared/constants'
import * as localizedText from '../../shared/localizedText'
import { getLogger } from '../../shared/logger'
import { createHelpButton } from '../../shared/ui/buttons'
Expand All @@ -35,7 +34,7 @@ import { minSamCliVersionForImageSupport } from '../../shared/sam/cli/samCliVali
import { ExtContext } from '../../shared/extensions'
import { validateBucketName } from '../../awsService/s3/util'
import { showViewLogsMessage } from '../../shared/utilities/messages'
import { getIdeProperties, isCloud9 } from '../../shared/extensionUtilities'
import { getIdeProperties, getSamDeployDocUrl, isCloud9 } from '../../shared/extensionUtilities'
import { recentlyUsed } from '../../shared/localizedText'
import globals from '../../shared/extensionGlobals'
import { SamCliSettings } from '../../shared/sam/cli/samCliSettings'
Expand Down Expand Up @@ -252,7 +251,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down Expand Up @@ -292,7 +291,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down Expand Up @@ -336,7 +335,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down Expand Up @@ -385,7 +384,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down Expand Up @@ -459,7 +458,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
} else if (button === createBucket) {
resolve([{ label: CREATE_NEW_BUCKET }])
} else if (button === enterBucket) {
Expand Down Expand Up @@ -515,7 +514,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
} else if (bucketProps.buttonHandler) {
bucketProps.buttonHandler(button, inputBox, resolve, reject)
}
Expand Down Expand Up @@ -559,7 +558,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down Expand Up @@ -612,7 +611,7 @@ export class DefaultSamDeployWizardContext implements SamDeployWizardContext {
if (button === vscode.QuickInputButtons.Back) {
resolve(undefined)
} else if (button === this.helpButton) {
void openUrl(vscode.Uri.parse(samDeployDocUrl))
void openUrl(getSamDeployDocUrl())
}
},
})
Expand Down
17 changes: 9 additions & 8 deletions packages/core/src/lambda/wizards/samInitWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as path from 'path'
import * as vscode from 'vscode'
import { SchemasDataProvider } from '../../eventSchemas/providers/schemasDataProvider'
import { DefaultSchemaClient } from '../../shared/clients/schemaClient'
import { eventBridgeSchemasDocUrl, samInitDocUrl } from '../../shared/constants'
import { eventBridgeSchemasDocUrl } from '../../shared/constants'
import {
Architecture,
createRuntimeQuickPick,
Expand All @@ -37,6 +37,7 @@ import { Region } from '../../shared/regions/endpoints'
import { createCommonButtons } from '../../shared/ui/buttons'
import { createExitPrompter } from '../../shared/ui/common/exitPrompter'
import { getNonexistentFilename } from '../../shared/filesystemUtilities'
import { getSamInitDocUrl } from '../../shared/extensionUtilities'

const localize = nls.loadMessageBundle()

Expand All @@ -55,7 +56,7 @@ export interface CreateNewSamAppWizardForm {
function createRuntimePrompter(samCliVersion: string): QuickPickPrompter<RuntimeAndPackage> {
return createRuntimeQuickPick({
showImageRuntimes: semver.gte(samCliVersion, minSamCliVersionForImageSupport),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
})
}

Expand All @@ -73,7 +74,7 @@ function createSamTemplatePrompter(

return createQuickPick(items, {
title: localize('AWS.samcli.initWizard.template.prompt', 'Select a SAM Application Template'),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
})
}

Expand All @@ -91,7 +92,7 @@ function createDependencyPrompter(currRuntime: Runtime): QuickPickPrompter<Depen

return createLabelQuickPick(items, {
title: localize('AWS.samcli.initWizard.dependencyManager.prompt', 'Select a Dependency Manager'),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
})
}

Expand All @@ -117,7 +118,7 @@ function createRegistryPrompter(region: string, credentials?: AWS.Credentials):

return createLabelQuickPick(items, {
title: localize('AWS.samcli.initWizard.schemas.registry.prompt', 'Select a Registry'),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
})
}

Expand Down Expand Up @@ -179,15 +180,15 @@ function createNamePrompter(defaultValue: string): InputBoxPrompter {
return createInputBox({
value: defaultValue,
title: localize('AWS.samcli.initWizard.name.prompt', 'Enter a name for your new application'),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
validateInput: validateName,
})
}

function createArchitecturePrompter(): QuickPickPrompter<Architecture> {
return createLabelQuickPick<Architecture>([{ label: 'x86_64' }, { label: 'arm64' }], {
title: localize('AWS.samcli.initWizard.architecture.prompt', 'Select an Architecture'),
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
})
}

Expand Down Expand Up @@ -266,7 +267,7 @@ export class CreateNewSamAppWizard extends Wizard<CreateNewSamAppWizardForm> {

this.form.location.bindPrompter(() =>
createFolderPrompt(vscode.workspace.workspaceFolders ?? [], {
buttons: createCommonButtons(samInitDocUrl),
buttons: createCommonButtons(getSamInitDocUrl()),
title: localize('AWS.samInit.location.title', 'Select the folder for your new SAM application'),
browseFolderDetail: localize(
'AWS.samInit.location.detail',
Expand Down
Loading
Loading