Skip to content

Commit

Permalink
refactor: simplify getLabel logic in PackageRootNode
Browse files Browse the repository at this point in the history
  • Loading branch information
mamilic committed Oct 21, 2024
1 parent 39b10c7 commit f4b44d9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/views/packageRootNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ export class PackageRootNode extends DataNode {
}

public getLabel(): string {
if (this.getParent() instanceof ContainerNode) {
const parent = this.getParent() as ContainerNode;
if (parent.getContainerType() == ContainerType.Maven) {
return `${this._nodeData.metaData?.['maven.groupId']}:${this._nodeData.metaData?.['maven.artifactId']}:${this._nodeData.metaData?.['maven.version']}`;
}
if (this._nodeData.metaData?.['maven.groupId']) {
return `${this._nodeData.metaData?.['maven.groupId']}:${this._nodeData.metaData?.['maven.artifactId']}:${this._nodeData.metaData?.['maven.version']}`;
}
return this._nodeData.displayName ?? this._nodeData.name;
}
Expand Down

0 comments on commit f4b44d9

Please sign in to comment.