[NIFI-14024] - Improve Bulletin ToolTip (#9534)

This closes #9534
This commit is contained in:
Rob Fellows 2024-11-20 13:50:34 -05:00 committed by GitHub
parent a3f4f7b964
commit bac6300e95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 32 additions and 10 deletions

View File

@ -138,6 +138,7 @@
@if (hasBulletins()) {
<button
nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletins()"
[position]="getBulletinTooltipPosition()"

View File

@ -50,7 +50,7 @@
@if (hasBulletins(item)) {
<div
class="pointer fa fa-sticky-note-o primary-color"
[delayClose]="false"
[delayClose]="true"
nifiTooltip
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(item)"></div>

View File

@ -42,6 +42,7 @@
<div
class="mr-3 pointer fa fa-sticky-note-o primary-color"
nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(item)"></div>
}

View File

@ -50,7 +50,7 @@
@if (hasBulletins(item)) {
<div
class="pointer fa fa-sticky-note-o primary-color"
[delayClose]="false"
[delayClose]="true"
nifiTooltip
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(item)"></div>

View File

@ -107,7 +107,7 @@
nifiTooltip
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(reference)"
[delayClose]="false"></div>
[delayClose]="true"></div>
}
@if (hasActiveThreads(reference.component)) {
<div>({{ reference.component.activeThreadCount }})</div>
@ -142,6 +142,7 @@
<div
class="pointer fa fa-sticky-note-o primary-color"
nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(service)"></div>
}

View File

@ -51,7 +51,7 @@
<div
class="pointer fa fa-sticky-note-o primary-color"
nifiTooltip
[delayClose]="false"
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(item)"></div>
}

View File

@ -73,6 +73,7 @@
<div
class="pointer fa fa-sticky-note-o primary-color"
nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(reference)"></div>
}
@ -109,6 +110,7 @@
<div
class="pointer fa fa-sticky-note-o primary-color"
nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletinsTipData(service)"></div>
}

View File

@ -21,11 +21,15 @@
@if (bulletinEntity.canRead) {
<li>
<div class="inline-flex flex-wrap gap-x-1.5">
<div>{{ bulletinEntity.bulletin.timestamp }}</div>
@if (bulletinEntity.nodeAddress) {
<div>{{ bulletinEntity.nodeAddress }}</div>
}
<div class="font-bold">{{ bulletinEntity.bulletin.level }}</div>
<div class="inline-flex flex-wrap gap-x-1.5" [copy]="bulletinEntity.bulletin.message">
<div>{{ bulletinEntity.bulletin.timestamp }}</div>
@if (bulletinEntity.nodeAddress) {
<div>{{ bulletinEntity.nodeAddress }}</div>
}
<div class="font-bold {{ getSeverity(bulletinEntity.bulletin.level) }}">
{{ bulletinEntity.bulletin.level }}
</div>
</div>
<pre class="whitespace-pre-wrap">{{ bulletinEntity.bulletin.message }}</pre>
</div>
</li>

View File

@ -17,14 +17,27 @@
import { Component, Input } from '@angular/core';
import { BulletinsTipInput } from '../../../../state/shared';
import { CopyDirective } from '@nifi/shared';
@Component({
selector: 'bulletins-tip',
standalone: true,
templateUrl: './bulletins-tip.component.html',
imports: [],
imports: [CopyDirective],
styleUrls: ['./bulletins-tip.component.scss']
})
export class BulletinsTip {
@Input() data: BulletinsTipInput | undefined;
getSeverity(severity: string) {
switch (severity.toLowerCase()) {
case 'error':
return 'bulletin-error error-color';
case 'warn':
case 'warning':
return 'bulletin-warn caution-color';
default:
return 'bulletin-normal success-color-default';
}
}
}