Skip to content
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

serviceconnector: Change nonNullValue to nonNullProp #1582

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

motm32
Copy link
Contributor

@motm32 motm32 commented Sep 13, 2023

Changing so error messages are more detailed.

@motm32 motm32 requested a review from a team as a code owner September 13, 2023 18:18
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: nonNullValue(context.targetServiceType?.name) + '_' + randomUtils.getRandomHexString(5),
value: nonNullProp(nonNullProp(context, 'targetServiceType'), 'name') + '_' + randomUtils.getRandomHexString(5),
Copy link
Member

Choose a reason for hiding this comment

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

I think you can use nonNullPropAndValue here as well, but this fine as well.

return linkers.map(linker => createServiceConnectorItem(this.subscription, this.item, linker));
});

return nonNullValue(result);
return nonNullValue(result, 'getChildren');
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this change here.

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 added 'getChildren' as a propertyNameOrMessage since I still wanted to have some context as to what value is nonNull. I couldn't change this to nonNullProp since result isn't a property. Not sure if this is actually what this optional parameter does since it doesn't give a description.

nturinski
nturinski previously approved these changes Sep 13, 2023
nturinski
nturinski previously approved these changes Sep 19, 2023
@motm32 motm32 merged commit 10be48e into main Sep 19, 2023
4 checks passed
@motm32 motm32 deleted the meganmott/nonNullProp branch September 19, 2023 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants