Skip to content

Commit e045943

Browse files
committed
added tooltip and url to label option
1 parent b87c8bc commit e045943

3 files changed

Lines changed: 21 additions & 2 deletions

File tree

ui/src/app/components/options/options.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@
3636
</div>
3737

3838
<!-- Label -->
39-
<div *ngIf="option.type === 'label'">
39+
<div *ngIf="option.type === 'label'"
40+
[class]="option.url ? 'clickable' : ''"
41+
(click)="openUrl(option.url)"
42+
[eqmTooltip]="option.tooltip"
43+
>
4044
<eqm-label>{{option.label}}</eqm-label>
4145
</div>
4246

ui/src/app/components/options/options.component.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@
55
padding: 0 2.5%;
66
z-index: 5;
77
}
8+
9+
.clickable {
10+
cursor: pointer !important;
11+
}

ui/src/app/components/options/options.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, Input, Output, EventEmitter, ChangeDetectorRef } from '@angular/core'
2+
import { ApplicationService } from '../../services/app.service'
23

34
interface BaseOptions {
45
key: string
@@ -20,6 +21,8 @@ export interface DividerOption extends Omit<BaseOptions, 'key' | 'label'> {
2021

2122
export interface LabelOption extends Omit<BaseOptions, 'key'> {
2223
type: 'label'
24+
url?: string
25+
tooltip?: string
2326
}
2427

2528
export interface HTMLOption extends Omit<BaseOptions, 'key' | 'label'> {
@@ -68,7 +71,10 @@ export class OptionsComponent {
6871
@Input() options: Options = []
6972
@Output() checkboxToggled = new EventEmitter<CheckboxOption>()
7073

71-
constructor (public ref: ChangeDetectorRef) {}
74+
constructor (
75+
public app: ApplicationService,
76+
public ref: ChangeDetectorRef
77+
) {}
7278

7379
getOptionStyle (option: Option) {
7480
let style: any = {}
@@ -102,4 +108,9 @@ export class OptionsComponent {
102108
option.selected(selectOption.id)
103109
}
104110
}
111+
112+
openUrl (url?: string) {
113+
if (!url) return
114+
this.app.openURL(new URL(url))
115+
}
105116
}

0 commit comments

Comments
 (0)