diff --git a/react-components/src/architecture/base/concreteCommands/PointCloudFilterCommand.ts b/react-components/src/architecture/base/concreteCommands/PointCloudFilterCommand.ts index 753b9b2c161..81b09377873 100644 --- a/react-components/src/architecture/base/concreteCommands/PointCloudFilterCommand.ts +++ b/react-components/src/architecture/base/concreteCommands/PointCloudFilterCommand.ts @@ -103,7 +103,7 @@ class FilterItemCommand extends BaseFilterItemCommand { // ================================================== public override get tooltip(): TranslateKey { - return { fallback: this.displayName }; + return { fallback: this._pointClass.displayName }; } public override get isChecked(): boolean { @@ -136,21 +136,6 @@ class FilterItemCommand extends BaseFilterItemCommand { pointCloud.setClassVisible(this._pointClass.code, value); CommandsUpdater.update(this._renderTarget); } - - // ================================================== - // INSTANCE METHODS - // ================================================== - - private get displayName(): string { - const name = this._pointClass.name; - const changedName = name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, ' '); - - if (!name.startsWith('ReservedOr')) { - return changedName; - } - const betterKey = changedName.slice('ReservedOr'.length); - return `${betterKey} (legacy)`; - } } class PointClass { @@ -163,6 +148,17 @@ class PointClass { this.code = code; this.color = color; } + + public get displayName(): string { + const name = this.name; + const changedName = name.charAt(0).toUpperCase() + name.slice(1).replace(/_/g, ' '); + + if (!name.startsWith('ReservedOr')) { + return changedName; + } + const betterKey = changedName.slice('ReservedOr'.length); + return `${betterKey} (legacy)`; + } } function getFirstPointCloudWithClasses(