Skip to content

Commit

Permalink
Change to nonNullPropAndValue
Browse files Browse the repository at this point in the history
  • Loading branch information
motm32 committed Sep 18, 2023
1 parent c01f652 commit 084bbdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions serviceconnector/src/createLinker/LinkerCreateStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { AzureWizardExecuteStep, GenericTreeItem, nonNullProp, randomUtils } from "@microsoft/vscode-azext-utils";
import { AzureWizardExecuteStep, GenericTreeItem, nonNullProp, nonNullValueAndProp, randomUtils } from "@microsoft/vscode-azext-utils";
import * as vscode from 'vscode';
import { TargetServiceTypeName } from "../../constants";
import { createLinkerClient } from "../linkerClient";
Expand Down Expand Up @@ -45,11 +45,11 @@ export class LinkerCreateStep extends AzureWizardExecuteStep<ICreateLinkerContex
private getSourceResourceId(context: ICreateLinkerContext): string {
switch (context.targetServiceType?.type) {
case TargetServiceTypeName.Storage:
return nonNullProp(nonNullProp(context, 'storageAccount'), 'id');
return nonNullValueAndProp(context.storageAccount, 'id');
case TargetServiceTypeName.CosmosDB:
return nonNullProp(nonNullProp(context, 'databaseAccount'), 'id');
return nonNullValueAndProp(context.databaseAccount, 'id');
case TargetServiceTypeName.KeyVault:
return nonNullProp(nonNullProp(context, 'keyVaultAccount'), 'id');
return nonNullValueAndProp(context.keyVaultAccount, 'id');
default:
throw new Error(vscode.l10n.t('No target type found'));
}
Expand Down
4 changes: 2 additions & 2 deletions serviceconnector/src/createLinker/LinkerNameStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { AzureWizardPromptStep, nonNullProp, randomUtils } from '@microsoft/vscode-azext-utils';
import { AzureWizardPromptStep, nonNullValueAndProp, randomUtils } from '@microsoft/vscode-azext-utils';
import * as vscode from 'vscode';
import { ICreateLinkerContext } from './ICreateLinkerContext';

export class LinkerNameStep extends AzureWizardPromptStep<ICreateLinkerContext>{
public async prompt(context: ICreateLinkerContext): Promise<void> {
context.linkerName = await context.ui.showInputBox({
prompt: vscode.l10n.t('Enter a name for the connection'),
value: nonNullProp(nonNullProp(context, 'targetServiceType'), 'name') + '_' + randomUtils.getRandomHexString(5),
value: nonNullValueAndProp(context.targetServiceType, 'name') + '_' + randomUtils.getRandomHexString(5),
validateInput: this.validateInput
});
}
Expand Down

0 comments on commit 084bbdd

Please sign in to comment.