Skip to content

Commit 15f370f

Browse files
committed
Misc
1 parent 9ef3efa commit 15f370f

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

src/commands/revisionDraft/RevisionDraftFileSystem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export class RevisionDraftFileSystem implements FileSystemProvider {
145145
}
146146

147147
const newContent: Uint8Array = Buffer.from(JSON.stringify(template, undefined, 4));
148-
const file: RevisionDraftFile | undefined = nonNullValue(this.draftStore.get(uri.path));
148+
const file: RevisionDraftFile = nonNullValue(this.draftStore.get(uri.path));
149149
if (file.contents === newContent) {
150150
return;
151151
}

src/commands/revisionDraft/RevisionDraftUpdateBaseStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IContainerAppContext } from "../IContainerAppContext";
1212

1313
export abstract class RevisionDraftUpdateBaseStep<T extends IContainerAppContext> extends AzureWizardExecuteStep<T> {
1414
/**
15-
* This property holds the template revisions that will be used to update when calling `updateRevisionDraftWithTemplate`
15+
* This property holds the active template revisions used for updating the revision draft
1616
*/
1717
protected revisionDraftTemplate: Template;
1818

src/commands/scaling/addScaleRule/AddScaleRuleStep.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import type { ScaleRule } from "@azure/arm-appcontainers";
6+
import { KnownActiveRevisionsMode, type ScaleRule } from "@azure/arm-appcontainers";
77
import { nonNullProp } from "@microsoft/vscode-azext-utils";
88
import { Progress } from "vscode";
99
import { ScaleRuleTypes } from "../../../constants";
@@ -22,7 +22,17 @@ export class AddScaleRuleStep<T extends IAddScaleRuleContext> extends RevisionDr
2222
}
2323

2424
public async execute(context: IAddScaleRuleContext, progress: Progress<{ message?: string | undefined; increment?: number | undefined }>): Promise<void> {
25-
context.activityTitle = localize('addingScaleRule', 'Add {0} rule "{1}" to "{2}" (draft)', context.ruleType, context.ruleName, context.containerApp.name);
25+
let adding: string | undefined;
26+
let added: string | undefined;
27+
if (context.containerApp.revisionsMode === KnownActiveRevisionsMode.Single) {
28+
adding = localize('addingScaleRuleSingle', 'Add {0} rule "{1}" to container app "{2}" (draft)', context.ruleType, context.ruleName, context.containerApp.name);
29+
added = localize('addedScaleRuleSingle', 'Added {0} rule "{1}" to container app "{2}" (draft).', context.ruleType, context.ruleName, context.containerApp.name);
30+
} else {
31+
adding = localize('addingScaleRuleMultiple', 'Add {0} rule "{1}" to revision "{2}" (draft)', context.ruleType, context.ruleName, this.baseItem.revision.name);
32+
added = localize('addedScaleRuleMultiple', 'Added {0} rule "{1}" to revision "{2}" (draft)', context.ruleType, context.ruleName, this.baseItem.revision.name);
33+
}
34+
35+
context.activityTitle = adding;
2636
progress.report({ message: localize('addingRule', 'Adding scale rule...') });
2737

2838
this.revisionDraftTemplate.scale ||= {};
@@ -35,7 +45,6 @@ export class AddScaleRuleStep<T extends IAddScaleRuleContext> extends RevisionDr
3545
// Artificial delay to make the activity log look like it's performing an action
3646
await delay(1000);
3747

38-
const added = localize('addedScaleRule', 'Added {0} rule "{1}" to "{2}" (draft).', context.ruleType, context.ruleName, context.containerApp.name);
3948
ext.outputChannel.appendLog(added);
4049
}
4150

src/commands/scaling/editScalingRange.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import { ProgressLocation, window } from "vscode";
88
import { ext } from "../../extensionVariables";
99
import { ScaleItem } from "../../tree/scaling/ScaleItem";
1010
import { localize } from "../../utils/localize";
11+
import { pickScale } from "../../utils/pickItem/pickScale";
1112
import { updateContainerApp } from "../../utils/updateContainerApp";
12-
import { getContainerAppAndRevision } from "./addScaleRule/addScaleRule";
1313

1414
export async function editScalingRange(context: IActionContext, node?: ScaleItem): Promise<void> {
15-
const { containerApp, revision, subscription } = node ?? await getContainerAppAndRevision(context);
15+
const { containerApp, revision, subscription } = node ?? await pickScale(context);
1616

1717
const scale = nonNullValue(revision?.template?.scale);
1818
const prompt: string = localize('editScalingRange', 'Set the range of application replicas that get created in response to a scale rule. Set any range within the minimum of 0 and the maximum of 10 replicas');

0 commit comments

Comments
 (0)