-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added Components Metadata #161 #186
Conversation
@sk593 Can you add a screenshot showing the new UX; that often helps with reviews. |
I initially pushed changes to address the comments but it caused some Linux package checks to fail. I accidentally uncommitted those changes when trying to fix the error so the original PR doesn't have the initial commits I made. But the last commit should have all the original changes, as well as the requested updates @philliphoff |
|
||
|
||
export default class DaprComponentsNode implements TreeNode { | ||
constructor(public readonly metadata: string, public readonly application: DaprApplication) { | ||
constructor(public readonly application: DaprApplication, public readonly daprClient: DaprClient) { |
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.
Nit: unless they have to be accessible outside of the class, use private readonly
.
if(components.length > 0) { | ||
return components.map(comp => new DaprMetadataNode(comp.name, 'database')); | ||
} | ||
return [new DaprMetadataNode(label, 'warning')]; | ||
} | ||
|
||
private async getMetadata(application: DaprApplication, token?: vscode.CancellationToken | undefined): Promise<DaprMetadata> { |
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.
Nit: as this is now only a single line function, used from a single location, is it necessary?
@@ -5,15 +5,15 @@ import * as vscode from 'vscode'; | |||
import TreeNode from "../treeNode"; | |||
|
|||
export default class DaprMetadataNode implements TreeNode { | |||
constructor(public readonly metadata: string) { | |||
constructor(public readonly metadata: string, public readonly icon: string) { |
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.
Perhaps themeIconId: string
to reinforce its usage (as opposed to a resource path string, which is another way to specify an icon)?
@sk593 A couple of final nits, but otherwise looks good. Let's also make sure there is an issue filed (maybe assigned to @AaronCrawfis) to get a better set of icons into the product at some point. |
Added component metadata (name of component) to the application tree view. this addresses one aspect of issue #161 and addresses #167 that requests to expose more metadata. An example of the components view is shown below