From f4b44d91a176824baa8a526a5984ebf1568a9c6b Mon Sep 17 00:00:00 2001 From: Marko Milic Date: Mon, 21 Oct 2024 13:19:30 +0200 Subject: [PATCH] refactor: simplify getLabel logic in PackageRootNode --- src/views/packageRootNode.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/views/packageRootNode.ts b/src/views/packageRootNode.ts index e64252d7..15581c86 100644 --- a/src/views/packageRootNode.ts +++ b/src/views/packageRootNode.ts @@ -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; }