mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-16 20:01:35 +01:00
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 <kenji@gaillac.eu> * fix(ui): remove redundant condition Signed-off-by: Kenji Gaillac <kenji@gaillac.eu> --------- Signed-off-by: Kenji Gaillac <kenji@gaillac.eu>
This commit is contained in:
parent
f58dc2dbec
commit
a1effcbb98
@ -430,7 +430,8 @@
|
||||
<hbr-label-piece
|
||||
*ngIf="artifact.labels?.length"
|
||||
[label]="artifact.labels[0]"
|
||||
[labelWidth]="90">
|
||||
[labelWidth]="90"
|
||||
[withTooltip]="true">
|
||||
</hbr-label-piece>
|
||||
<div
|
||||
class="signpost-item"
|
||||
@ -447,7 +448,8 @@
|
||||
class="margin-5px">
|
||||
<hbr-label-piece
|
||||
[labelWidth]="130"
|
||||
[label]="label">
|
||||
[label]="label"
|
||||
[withTooltip]="true">
|
||||
</hbr-label-piece>
|
||||
</div>
|
||||
</clr-signpost-content>
|
||||
|
@ -1,18 +1,27 @@
|
||||
<label
|
||||
class="label"
|
||||
[ngStyle]="{
|
||||
'background-color': labelColor?.color,
|
||||
color: labelColor?.textColor,
|
||||
border: labelColor?.color === '#FFFFFF' ? '1px solid #A1A1A1' : 'none'
|
||||
}"
|
||||
[style.max-width.px]="labelWidth">
|
||||
<span>
|
||||
<clr-icon
|
||||
*ngIf="hasIcon && label.scope === 'p'"
|
||||
shape="organization"></clr-icon>
|
||||
<clr-icon
|
||||
*ngIf="hasIcon && label.scope === 'g'"
|
||||
shape="administrator"></clr-icon>
|
||||
</span>
|
||||
<span class="label-name">{{ label.name }}</span>
|
||||
</label>
|
||||
<clr-tooltip>
|
||||
<label
|
||||
clrTooltipTrigger
|
||||
class="label"
|
||||
[ngStyle]="{
|
||||
'background-color': labelColor?.color,
|
||||
color: labelColor?.textColor,
|
||||
border:
|
||||
labelColor?.color === '#FFFFFF' ? '1px solid #A1A1A1' : 'none'
|
||||
}"
|
||||
[style.max-width.px]="labelWidth">
|
||||
<span>
|
||||
<clr-icon
|
||||
*ngIf="hasIcon && label.scope === 'p'"
|
||||
shape="organization"></clr-icon>
|
||||
<clr-icon
|
||||
*ngIf="hasIcon && label.scope === 'g'"
|
||||
shape="administrator"></clr-icon>
|
||||
</span>
|
||||
<span class="label-name">{{ label.name }}</span>
|
||||
</label>
|
||||
<clr-tooltip-content
|
||||
[clrPosition]="'right'"
|
||||
*ngIf="withTooltip && label.description">
|
||||
<span>{{ label.description }}</span>
|
||||
</clr-tooltip-content>
|
||||
</clr-tooltip>
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user