Skip to content

Commit 3e3b834

Browse files
committed
Contribute activity children with SchedulerCreationStep
1 parent a86d7a7 commit 3e3b834

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/commands/durableTaskScheduler/createScheduler.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { type ResourceManagementClient } from '@azure/arm-resources';
77
import { type AzExtClientContext, createAzureClient, type ILocationWizardContext, type IResourceGroupWizardContext, LocationListStep, parseClientContext, ResourceGroupCreateStep, ResourceGroupListStep, VerifyProvidersStep } from "@microsoft/vscode-azext-azureutils";
8-
import { AzureWizard, AzureWizardExecuteStep, AzureWizardPromptStep, createSubscriptionContext, type ExecuteActivityContext, type IActionContext, type IAzureQuickPickItem, type ISubscriptionActionContext, subscriptionExperience } from "@microsoft/vscode-azext-utils";
8+
import { AzureWizard, AzureWizardExecuteStepWithActivityOutput, AzureWizardPromptStep, createSubscriptionContext, type ExecuteActivityContext, type IActionContext, type IAzureQuickPickItem, type ISubscriptionActionContext, subscriptionExperience } from "@microsoft/vscode-azext-utils";
99
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
1010
import { type Progress } from "vscode";
1111
import { DurableTaskProvider, DurableTaskSchedulersResourceType } from "../../constants";
@@ -59,16 +59,22 @@ class SchedulerSkuStep extends AzureWizardPromptStep<ICreateSchedulerContext> {
5959
}
6060
}
6161

62-
class SchedulerCreationStep extends AzureWizardExecuteStep<ICreateSchedulerContext> {
62+
class SchedulerCreationStep extends AzureWizardExecuteStepWithActivityOutput<ICreateSchedulerContext> {
6363
priority: number = 110;
64+
readonly stepName: string = 'schedulerCreationStep';
65+
66+
protected getTreeItemLabel = (context: ICreateSchedulerContext) => localize('createSchedulerLabel', 'Create Durable Task Scheduler "{0}"', context.schedulerName);
67+
protected getOutputLogSuccess = (context: ICreateSchedulerContext) => localize('createSchedulerSuccess', 'Successfully created Durable Task Scheduler "{0}".', context.schedulerName);
68+
protected getOutputLogFail = (context: ICreateSchedulerContext) => localize('createSchedulerFail', 'Failed to create Durable Task Scheduler "{0}".', context.schedulerName);
6469

6570
constructor(private readonly schedulerClient: DurableTaskSchedulerClient) {
6671
super();
6772
}
6873

69-
async execute(wizardContext: ICreateSchedulerContext, _: Progress<{ message?: string; increment?: number; }>): Promise<void> {
70-
const location = await LocationListStep.getLocation(wizardContext);
74+
async execute(wizardContext: ICreateSchedulerContext, progress: Progress<{ message?: string; increment?: number; }>): Promise<void> {
75+
progress.report({ message: localize('creatingScheduler', 'Creating Durable Task Scheduler...') });
7176

77+
const location = await LocationListStep.getLocation(wizardContext);
7278
const response = await this.schedulerClient.createScheduler(
7379
wizardContext.subscription as AzureSubscription,
7480
wizardContext.resourceGroup?.name as string,
@@ -117,7 +123,7 @@ export function createSchedulerCommandFactory(dataBranchProvider: DurableTaskSch
117123

118124
...actionContext,
119125
...createSubscriptionContext(subscription),
120-
...await createActivityContext()
126+
...await createActivityContext({ withChildren: true }),
121127
};
122128

123129
if (!await isDtsProviderRegistered(wizardContext)) {

0 commit comments

Comments
 (0)