-
Notifications
You must be signed in to change notification settings - Fork 30
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
Refactor quick pick filters #333
Conversation
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>[], |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
…ckpick' into alex/resource-api-qp-filters
…lex/resource-api-qp-filters
…lex/resource-api-qp-filters
2157818
to
6e9efec
Compare
…ckpick' into alex/resource-api-qp-filters
…ckpick' into alex/resource-api-qp-filters
Closing in favor of microsoft/vscode-azuretools#1229 |
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.