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

Refactor quick pick filters #333

Conversation

alexweininger
Copy link
Member

I think my implementation reduces the likelihood of breaking changes by making the interfaces and parameters used to control quick pick filtering more abstract.

Note: the app resource filter will be able to easily utilize microsoft/vscode-azuretools#1191 once we make those changes.

export class QuickPickAppResourceStep<TModel extends ResourceModelBase> extends AzureWizardPromptStep<QuickPickAppResourceWizardContext<TModel>> {
public constructor(
private readonly resourceProviderManager: ApplicationResourceProviderManager,
private readonly branchDataProviderManager: BranchDataProviderManager,
private readonly options: PickAppResourceOptions
private readonly filter?: Filter<AppResource> | Filter<AppResource>[],
Copy link
Member Author

Choose a reason for hiding this comment

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

I promoted filter from inside options to a top level parameter because in most cases we will want to filter the app resources.


constructor(private readonly options: AppResourceFilterOptions) { }

public matches(resource: AppResource): boolean {
Copy link
Member Author

Choose a reason for hiding this comment

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

Once microsoft/vscode-azuretools#1191 is merged, we can change the body of this method to

return resource.azureResourceType === this.azureResourceType

without having to make changes elsewhere.

@alexweininger alexweininger force-pushed the alex/resource-api-qp-filters branch from 2157818 to 6e9efec Compare August 22, 2022 20:44
@bwateratmsft
Copy link
Contributor

Closing in favor of microsoft/vscode-azuretools#1229

@microsoft microsoft locked and limited conversation to collaborators Oct 23, 2022
@alexweininger alexweininger deleted the alex/resource-api-qp-filters branch March 14, 2024 15:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants