Skip to content

Remove emulator option for non-windows #1246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2019
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
1 change: 0 additions & 1 deletion src/commands/appSettings/AzureWebJobsStorageExecuteStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export class AzureWebJobsStorageExecuteStep<T extends IAzureWebJobsStorageWizard

public async execute(wizardContext: IAzureWebJobsStorageWizardContext): Promise<void> {
let value: string;
wizardContext.actionContext.properties.azureWebJobsStorageType = wizardContext.azureWebJobsStorageType;
if (wizardContext.azureWebJobsStorageType === 'emulator') {
value = localEmulatorConnectionString;
} else {
Expand Down
16 changes: 14 additions & 2 deletions src/commands/appSettings/AzureWebJobsStoragePromptStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { MessageItem } from 'vscode';
import { AzureWizardPromptStep, ISubscriptionWizardContext, IWizardOptions, StorageAccountKind, StorageAccountListStep, StorageAccountPerformance, StorageAccountReplication } from 'vscode-azureextensionui';
import { localSettingsFileName } from '../../constants';
import { isWindows, localSettingsFileName } from '../../constants';
import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { IAzureWebJobsStorageWizardContext } from './IAzureWebJobsStorageWizardContext';
Expand All @@ -14,14 +14,26 @@ export class AzureWebJobsStoragePromptStep<T extends IAzureWebJobsStorageWizardC
public async prompt(wizardContext: T): Promise<void> {
const selectAccount: MessageItem = { title: localize('selectAzureAccount', 'Select storage account') };
const useEmulator: MessageItem = { title: localize('userEmulator', 'Use local emulator') };
const skipForNow: MessageItem = { title: localize('skipForNow', 'Skip for now') };

const message: string = localize('selectAzureWebJobsStorage', 'AzureWebJobsStorage must be set in "{0}" to debug non-HTTP triggers locally.', localSettingsFileName);
const result: MessageItem = await ext.ui.showWarningMessage(message, { modal: true }, selectAccount, useEmulator);

const buttons: MessageItem[] = [selectAccount];
if (isWindows) {
// Only show on Windows until this is fixed: https://github.com/Microsoft/vscode-azurefunctions/issues/1245
buttons.push(useEmulator);
}
buttons.push(skipForNow);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only have skipForNow if it's not Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm meh on that button, but figured I might as well add it and see what people do in the telemetry. We can remove it if no one picks it


const result: MessageItem = await ext.ui.showWarningMessage(message, { modal: true }, ...buttons);
if (result === selectAccount) {
wizardContext.azureWebJobsStorageType = 'azure';
} else if (result === useEmulator) {
wizardContext.azureWebJobsStorageType = 'emulator';
}

// tslint:disable-next-line: strict-boolean-expressions
wizardContext.actionContext.properties.azureWebJobsStorageType = wizardContext.azureWebJobsStorageType || 'skipForNow';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have telemetry on the os right?

Copy link
Contributor Author

@ejizba ejizba Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's part of the default stuff collected for all events

}

public shouldPrompt(wizardContext: T): boolean {
Expand Down