From a1effcbb98f9baf8feca4794e66364faad0adb37 Mon Sep 17 00:00:00 2001 From: Kenji Gaillac <48765390+Nhqml@users.noreply.github.com> Date: Tue, 24 Oct 2023 03:52:35 +0200 Subject: [PATCH] Add label's description as tooltip (#19421) * feat(ui): add label's description as tooltip Will only display the tooltip on artifact-list-page. Signed-off-by: Kenji Gaillac * fix(ui): remove redundant condition Signed-off-by: Kenji Gaillac --------- Signed-off-by: Kenji Gaillac --- .../artifact-list-tab.component.html | 6 ++- .../label-piece/label-piece.component.html | 45 +++++++++++-------- .../label-piece/label-piece.component.ts | 1 + 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html index fb90facf5..33117a053 100644 --- a/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html +++ b/src/portal/src/app/base/project/repository/artifact/artifact-list-page/artifact-list/artifact-list-tab/artifact-list-tab.component.html @@ -430,7 +430,8 @@ + [labelWidth]="90" + [withTooltip]="true">
+ [label]="label" + [withTooltip]="true">
diff --git a/src/portal/src/app/shared/components/label/label-piece/label-piece.component.html b/src/portal/src/app/shared/components/label/label-piece/label-piece.component.html index 9429f78b4..8f3f1647d 100644 --- a/src/portal/src/app/shared/components/label/label-piece/label-piece.component.html +++ b/src/portal/src/app/shared/components/label/label-piece/label-piece.component.html @@ -1,18 +1,27 @@ - + + + + {{ label.description }} + + diff --git a/src/portal/src/app/shared/components/label/label-piece/label-piece.component.ts b/src/portal/src/app/shared/components/label/label-piece/label-piece.component.ts index 4607df24b..5c2c289dc 100644 --- a/src/portal/src/app/shared/components/label/label-piece/label-piece.component.ts +++ b/src/portal/src/app/shared/components/label/label-piece/label-piece.component.ts @@ -24,6 +24,7 @@ export class LabelPieceComponent implements OnChanges { @Input() label: Label; @Input() labelWidth: number; @Input() hasIcon: boolean = true; + @Input() withTooltip: boolean = false; labelColor: { [key: string]: string }; ngOnChanges(): void {