This is an automated email from the ASF dual-hosted git repository.

zhaoqingran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git


The following commit(s) were added to refs/heads/master by this push:
     new 06ce10ec3 [bugfix] fix tag select component display and select error 
(#2719)
06ce10ec3 is described below

commit 06ce10ec3a1c026032e787ce9d381e27d4341041
Author: tomsun28 <[email protected]>
AuthorDate: Mon Sep 16 11:07:17 2024 +0800

    [bugfix] fix tag select component display and select error (#2719)
    
    Signed-off-by: tomsun28 <[email protected]>
---
 .../src/app/shared/components/tags-select/tags-select.component.ts  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/web-app/src/app/shared/components/tags-select/tags-select.component.ts 
b/web-app/src/app/shared/components/tags-select/tags-select.component.ts
index 3ed1c72a8..a8b921474 100644
--- a/web-app/src/app/shared/components/tags-select/tags-select.component.ts
+++ b/web-app/src/app/shared/components/tags-select/tags-select.component.ts
@@ -100,7 +100,9 @@ export class TagsSelectComponent implements 
ControlValueAccessor {
   }
 
   sliceTagName(tag: any): string {
-    if (tag.value != undefined && tag.value.trim() != '') {
+    if (tag.name != undefined && tag.tagValue != undefined && 
tag.tagValue.trim() != '') {
+      return `${tag.name}:${tag.tagValue}`;
+    } else if (tag.name != undefined && tag.value != undefined && 
tag.value.trim() != '') {
       return `${tag.name}:${tag.value}`;
     } else {
       return tag.name;
@@ -121,7 +123,7 @@ export class TagsSelectComponent implements 
ControlValueAccessor {
     let value = this.value == undefined ? [] : this.value;
     this.checkedTags.forEach(item => {
       if (this.value.find((tag: { id: number }) => tag.id == item.id) == 
undefined) {
-        value.push(item);
+        value.push({ ...item, value: item.tagValue });
       }
     });
     this.onChange(value);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to