Open alexweininger opened 2 years ago
I now have a basic implementation working with SWA and Functions displaying in the tree. 🌴
Note: not much effort was put into naming
Each extension implements and exports AzExtTreeItemProvider
. Adding a function like this to the API:
getTreeItemProvider: () => new TreeItemProvider()
export interface AzExtTreeItemProvider {
getTreeItem(resourceGroupName: string, name: string, treeItem: AzExtParentTreeItem): Promise<AzExtTreeItem>;
}
In resource groups, I added a method getTreeItemProvider(): Promise<AzExtTreeItemProvider | undefined>
to AzExtWrapper
.
From there it's as simple as checking if the extension for a given resource exports this function, and calling it.
Snippet from loadMoreChildrenImpl
of ResourceGroupTreeItem
:
const azExt: AzExtWrapper | undefined = extensions.find((azExt) => azExt.matchesResourceType(resource));
if (azExt) {
const provider = await azExt.getTreeItemProvider();
if (provider) {
return provider?.getTreeItem(this.name, resource.name!, this);
}
}
A. When should the full details of a resource be loaded?
Options:
B. How do we handle loading more items while maintaining sorting/grouping?
Ex: If we load and sort 25/100 resources, how do we handle loading additional resources?
C. What is the best way to display the grouping, sorting, and filtering options available to users?
D. Where will the local project tree items be? How will the design of this API be different from the resources?
Goal: Quickly implement a unified tree view using the Resource Groups extension. And look for technical challenges and design decisions that need discussion.
In the unified tree view users will be able to drill into the individual resources as they would normally in the resource specific extension, but all together in the Resource Groups view.
Example: