Skip to content

Commit e4c84b8

Browse files
authored
Prompt and update for save even when a configuration has an empty label field (#666)
1 parent e47da9e commit e4c84b8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/commands/deployWorkspaceProject/deploymentConfiguration/workspace/DeploymentConfigurationListStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class DeploymentConfigurationListStep extends AzureWizardPromptStep<Works
6666
private getPicks(deploymentConfigurations: DeploymentConfigurationSettings[]): IAzureQuickPickItem<(DeploymentConfigurationSettings & { configurationIdx?: number }) | undefined>[] {
6767
const picks: IAzureQuickPickItem<DeploymentConfigurationSettings | undefined>[] = deploymentConfigurations.map((deploymentConfiguration, i) => {
6868
return {
69-
label: deploymentConfiguration.label ?? localize('unnamedApp', 'Unnamed app'),
69+
label: deploymentConfiguration.label || localize('unnamedApp', 'Unnamed app'),
7070
// Show the container app name as the description by default, unless the label has the same name
7171
description: deploymentConfiguration.label === deploymentConfiguration.containerApp ? undefined : deploymentConfiguration.containerApp,
7272
data: { ...deploymentConfiguration, configurationIdx: i }

src/commands/deployWorkspaceProject/internal/DeployWorkspaceProjectSaveSettingsStep.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ export class DeployWorkspaceProjectSaveSettingsStep extends ExecuteActivityOutpu
2727
const rootFolder: WorkspaceFolder = nonNullProp(context, 'rootFolder');
2828
const deploymentConfigurations: DeploymentConfigurationSettings[] = await dwpSettingUtilsV2.getWorkspaceDeploymentConfigurations(rootFolder) ?? [];
2929

30+
const configurationLabel: string | undefined = context.configurationIdx !== undefined ? deploymentConfigurations?.[context.configurationIdx].label : undefined;
3031
const deploymentConfiguration: DeploymentConfigurationSettings = {
31-
label: context.configurationIdx !== undefined && deploymentConfigurations?.[context.configurationIdx].label || removeCaSuffixIfExists(nonNullValueAndProp(context.containerApp, 'name')),
32+
label: configurationLabel || removeCaSuffixIfExists(nonNullValueAndProp(context.containerApp, 'name')),
3233
type: 'AcrDockerBuildRequest',
3334
dockerfilePath: path.relative(rootFolder.uri.fsPath, nonNullProp(context, 'dockerfilePath')),
3435
srcPath: path.relative(rootFolder.uri.fsPath, context.srcPath || rootFolder.uri.fsPath) || ".",

src/commands/deployWorkspaceProject/internal/ShouldSaveDeploySettingsPromptStep.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export class ShouldSaveDeploySettingsPromptStep extends AzureWizardPromptStep<De
2121
const setting: DeploymentConfigurationSettings | undefined = settings?.[context.configurationIdx];
2222

2323
const hasNewSettings: boolean =
24+
!setting?.label ||
2425
setting?.type !== 'AcrDockerBuildRequest' ||
2526
(context.dockerfilePath && convertRelativeToAbsolutePath(rootPath, setting?.dockerfilePath) !== context.dockerfilePath) ||
2627
(context.envPath && convertRelativeToAbsolutePath(rootPath, setting?.envPath) !== context.envPath) ||

0 commit comments

Comments
 (0)