|
|
|
@ -38,6 +38,7 @@ import { |
|
|
|
EventContentDialogComponent, |
|
|
|
EventContentDialogData |
|
|
|
} from '@home/components/event/event-content-dialog.component'; |
|
|
|
import { sortObjectKeys } from '@core/utils'; |
|
|
|
|
|
|
|
export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
|
|
|
|
|
|
|
@ -209,7 +210,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
|
|
|
icon: 'more_horiz', |
|
|
|
isEnabled: (entity) => entity.body.metadata ? entity.body.metadata.length > 0 : false, |
|
|
|
onAction: ($event, entity) => this.showContent($event, entity.body.metadata, |
|
|
|
'event.metadata', ContentType.JSON) |
|
|
|
'event.metadata', ContentType.JSON, true) |
|
|
|
}, |
|
|
|
'40px'), |
|
|
|
new EntityActionTableColumn<Event>('error', 'event.error', |
|
|
|
@ -229,10 +230,15 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
showContent($event: MouseEvent, content: string, title: string, contentType: ContentType = null): void { |
|
|
|
showContent($event: MouseEvent, content: string, title: string, contentType: ContentType = null, sortKeys = false): void { |
|
|
|
if ($event) { |
|
|
|
$event.stopPropagation(); |
|
|
|
} |
|
|
|
if (contentType === ContentType.JSON && sortKeys) { |
|
|
|
try { |
|
|
|
content = JSON.stringify(sortObjectKeys(JSON.parse(content))); |
|
|
|
} catch (e) {} |
|
|
|
} |
|
|
|
this.dialog.open<EventContentDialogComponent, EventContentDialogData>(EventContentDialogComponent, { |
|
|
|
disableClose: true, |
|
|
|
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], |
|
|
|
|