From ba2e9d867236978d75ebd4423625648fb2aafa6f Mon Sep 17 00:00:00 2001 From: Erwin-N Date: Sat, 21 Mar 2026 20:52:14 +0100 Subject: [PATCH] fix comments --- libs/ui/src/lib/value/value.component.html | 9 +++-- libs/ui/src/lib/value/value.component.scss | 4 --- libs/ui/src/lib/value/value.component.ts | 38 +++++++++------------- 3 files changed, 23 insertions(+), 28 deletions(-) diff --git a/libs/ui/src/lib/value/value.component.html b/libs/ui/src/lib/value/value.component.html index 636f5caa8..2698220c5 100644 --- a/libs/ui/src/lib/value/value.component.html +++ b/libs/ui/src/lib/value/value.component.html @@ -11,8 +11,13 @@ @if (enableCopyToClipboardButton) { - - + + } diff --git a/libs/ui/src/lib/value/value.component.scss b/libs/ui/src/lib/value/value.component.scss index 7df2d17c4..087bf31e1 100644 --- a/libs/ui/src/lib/value/value.component.scss +++ b/libs/ui/src/lib/value/value.component.scss @@ -7,8 +7,4 @@ font-variant-numeric: initial; line-height: 1; } - .mdc-copy { - display: inline-flex; - vertical-align: middle; - } } diff --git a/libs/ui/src/lib/value/value.component.ts b/libs/ui/src/lib/value/value.component.ts index 39565fd9e..6daf268d0 100644 --- a/libs/ui/src/lib/value/value.component.ts +++ b/libs/ui/src/lib/value/value.component.ts @@ -80,15 +80,6 @@ export class GfValueComponent implements AfterViewInit, OnChanges { return precision !== undefined && precision >= 0; } - private initializeVariables() { - this.absoluteValue = 0; - this.formattedValue = ''; - this.isNumber = false; - this.isString = false; - this.locale = this.locale || getLocale(); - this.useAbsoluteValue = false; - } - public ngAfterViewInit() { const el = this.labelContent.nativeElement; this.hasLabel = el.textContent.trim().length > 0 || el.children.length > 0; @@ -173,19 +164,22 @@ export class GfValueComponent implements AfterViewInit, OnChanges { } public onCopyValueToClipboard() { - if (this.value || this.value === 0) { - this.clipboard.copy(this.formattedValue); - this.snackBar.open( - '✅ ' + $localize`Value has been copied to the clipboard`, - undefined, - { - duration: ms('3 seconds') - } - ); - } else { - this.snackBar.open($localize`Value is empty`, undefined, { + this.clipboard.copy(this.formattedValue); + this.snackBar.open( + '✅ ' + $localize`Value has been copied to the clipboard`, + undefined, + { duration: ms('3 seconds') - }); - } + } + ); + } + + private initializeVariables() { + this.absoluteValue = 0; + this.formattedValue = ''; + this.isNumber = false; + this.isString = false; + this.locale = this.locale || getLocale(); + this.useAbsoluteValue = false; } }