[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()) { @if (hasBulletins()) {
<button <button
nifiTooltip nifiTooltip
[delayClose]="true"
[tooltipComponentType]="BulletinsTip" [tooltipComponentType]="BulletinsTip"
[tooltipInputData]="getBulletins()" [tooltipInputData]="getBulletins()"
[position]="getBulletinTooltipPosition()" [position]="getBulletinTooltipPosition()"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -17,14 +17,27 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { BulletinsTipInput } from '../../../../state/shared'; import { BulletinsTipInput } from '../../../../state/shared';
import { CopyDirective } from '@nifi/shared';
@Component({ @Component({
selector: 'bulletins-tip', selector: 'bulletins-tip',
standalone: true, standalone: true,
templateUrl: './bulletins-tip.component.html', templateUrl: './bulletins-tip.component.html',
imports: [], imports: [CopyDirective],
styleUrls: ['./bulletins-tip.component.scss'] styleUrls: ['./bulletins-tip.component.scss']
}) })
export class BulletinsTip { export class BulletinsTip {
@Input() data: BulletinsTipInput | undefined; @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';
}
}
} }