Skip to content

Commit abb35de

Browse files
authored
Remove Node V4 preview label and make it the default (#3834)
1 parent d1249d4 commit abb35de

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

src/commands/createFunctionApp/stacks/getStackPicks.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AzExtPipelineResponse, createGenericClient } from '@microsoft/vscode-az
99
import { IAzureQuickPickItem, openUrl, parseError } from '@microsoft/vscode-azext-utils';
1010
import { FuncVersion, funcVersionLink } from '../../../FuncVersion';
1111
import { hiddenStacksSetting, noRuntimeStacksAvailableLabel } from '../../../constants';
12+
import { previewDescription } from '../../../constants-nls';
1213
import { localize } from '../../../localize';
1314
import { requestUtils } from '../../../utils/requestUtils';
1415
import { getWorkspaceSetting } from '../../../vsCodeConfig/settings';
@@ -37,7 +38,7 @@ export async function getStackPicks(context: IFunctionAppWizardContext): Promise
3738
const previewOs = getFlagOs(minorVersion.stackSettings, 'isPreview');
3839
switch (previewOs) {
3940
case 'All':
40-
description = localize('preview', '(Preview)');
41+
description = previewDescription;
4142
break;
4243
case 'Linux':
4344
case 'Windows':

src/commands/createNewProject/ProgrammingModelStep.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,20 @@ import { AzureWizardPromptStep, IAzureQuickPickItem, IAzureQuickPickOptions, non
77
import { localize } from '../../localize';
88
import { IProjectWizardContext } from './IProjectWizardContext';
99

10-
type ProgrammingModel = { modelVersion: number | undefined, label: string };
1110
export class ProgrammingModelStep extends AzureWizardPromptStep<IProjectWizardContext> {
1211
public hideStepCount: boolean = true;
13-
private _models: ProgrammingModel[] = [];
12+
private _models: IAzureQuickPickItem<number | undefined>[] = [];
1413
private _learnMoreLink: string | undefined;
1514

16-
public constructor(options: { models: ProgrammingModel | ProgrammingModel[], learnMoreLink?: string }) {
15+
public constructor(options: { models: IAzureQuickPickItem<number | undefined>[], learnMoreLink?: string }) {
1716
super();
1817
this._models = Array.isArray(options.models) ? options.models : [options.models];
1918
this._learnMoreLink = options.learnMoreLink;
2019
}
2120

2221
public async prompt(context: IProjectWizardContext): Promise<void> {
23-
const modelsPick: IAzureQuickPickItem<number | undefined>[] = this._models.map(model => {
24-
return {
25-
label: model.label,
26-
data: model.modelVersion
27-
}
28-
});
22+
// duplicate the array so we don't modify the original
23+
const modelsPick: IAzureQuickPickItem<number | undefined>[] = this._models.slice();
2924

3025
const learnMoreQp = { label: localize('learnMore', '$(link-external) Learn more about Model V4...'), description: '', data: undefined };
3126
if (this._learnMoreLink) {
@@ -53,7 +48,7 @@ export class ProgrammingModelStep extends AzureWizardPromptStep<IProjectWizardCo
5348
public shouldPrompt(context: IProjectWizardContext): boolean {
5449
// auto-select the default model if there is only one
5550
if (this._models.length === 1) {
56-
context.languageModel = this._models[0].modelVersion;
51+
context.languageModel = this._models[0].data;
5752
}
5853

5954
// this only impacts node for now so only check the feature flag for node

src/constants.ts

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

6+
import { IAzureQuickPickItem } from "@microsoft/vscode-azext-utils";
7+
import { defaultDescription } from "./constants-nls";
68
import { localize } from "./localize";
79

810
export const extensionId: string = 'ms-azuretools.vscode-azurefunctions';
@@ -167,10 +169,10 @@ export const azureWebJobsFeatureFlags: string = 'AzureWebJobsFeatureFlags';
167169
* Any significantly changed new model should use an incremented number.
168170
*/
169171
export const nodeV4ModelVersion: number = 4;
170-
export const nodeV4Model: { modelVersion: number, label: string } = { modelVersion: nodeV4ModelVersion, label: localize('modelV4', 'Model V4 (Preview)') };
171-
export const nodeDefaultModel: { modelVersion: undefined, label: string } = { modelVersion: undefined, label: localize('modelV3', 'Model V3') }
172+
export const nodeDefaultModel: IAzureQuickPickItem<number | undefined> = { data: nodeV4ModelVersion, label: localize('modelV4', 'Model V4'), description: defaultDescription };
173+
export const nodeV3Model: IAzureQuickPickItem<number | undefined> = { data: undefined, label: localize('modelV3', 'Model V3') }
172174

173-
export const nodeModels = [nodeDefaultModel, nodeV4Model];
175+
export const nodeModels = [nodeDefaultModel, nodeV3Model];
174176
export const nodeLearnMoreLink = 'https://aka.ms/AzFuncNodeV4';
175177

176178
export const webProvider: string = 'Microsoft.Web';

0 commit comments

Comments
 (0)