|
|
@ -14,7 +14,7 @@ |
|
|
/// limitations under the License.
|
|
|
/// limitations under the License.
|
|
|
///
|
|
|
///
|
|
|
|
|
|
|
|
|
import { Component, ElementRef, Inject, OnInit, Renderer2, ViewChild } from '@angular/core'; |
|
|
import { Component, ElementRef, Inject, OnDestroy, OnInit, Renderer2, ViewChild } from '@angular/core'; |
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; |
|
|
import { Store } from '@ngrx/store'; |
|
|
import { Store } from '@ngrx/store'; |
|
|
import { AppState } from '@core/core.state'; |
|
|
import { AppState } from '@core/core.state'; |
|
|
@ -33,7 +33,7 @@ export interface AuditLogDetailsDialogData { |
|
|
templateUrl: './audit-log-details-dialog.component.html', |
|
|
templateUrl: './audit-log-details-dialog.component.html', |
|
|
styleUrls: ['./audit-log-details-dialog.component.scss'] |
|
|
styleUrls: ['./audit-log-details-dialog.component.scss'] |
|
|
}) |
|
|
}) |
|
|
export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDetailsDialogComponent> implements OnInit { |
|
|
export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDetailsDialogComponent> implements OnInit, OnDestroy { |
|
|
|
|
|
|
|
|
@ViewChild('actionDataEditor', {static: true}) |
|
|
@ViewChild('actionDataEditor', {static: true}) |
|
|
actionDataEditorElmRef: ElementRef; |
|
|
actionDataEditorElmRef: ElementRef; |
|
|
@ -45,6 +45,7 @@ export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDeta |
|
|
displayFailureDetails: boolean; |
|
|
displayFailureDetails: boolean; |
|
|
actionData: string; |
|
|
actionData: string; |
|
|
actionFailureDetails: string; |
|
|
actionFailureDetails: string; |
|
|
|
|
|
aceEditors: Ace.Editor[] = []; |
|
|
|
|
|
|
|
|
constructor(protected store: Store<AppState>, |
|
|
constructor(protected store: Store<AppState>, |
|
|
protected router: Router, |
|
|
protected router: Router, |
|
|
@ -66,6 +67,11 @@ export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDeta |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ngOnDestroy(): void { |
|
|
|
|
|
this.aceEditors.forEach(editor => editor.destroy()); |
|
|
|
|
|
super.ngOnDestroy(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
createEditor(editorElementRef: ElementRef, content: string): void { |
|
|
createEditor(editorElementRef: ElementRef, content: string): void { |
|
|
const editorElement = editorElementRef.nativeElement; |
|
|
const editorElement = editorElementRef.nativeElement; |
|
|
let editorOptions: Partial<Ace.EditorOptions> = { |
|
|
let editorOptions: Partial<Ace.EditorOptions> = { |
|
|
@ -86,6 +92,7 @@ export class AuditLogDetailsDialogComponent extends DialogComponent<AuditLogDeta |
|
|
getAce().subscribe( |
|
|
getAce().subscribe( |
|
|
(ace) => { |
|
|
(ace) => { |
|
|
const editor = ace.edit(editorElement, editorOptions); |
|
|
const editor = ace.edit(editorElement, editorOptions); |
|
|
|
|
|
this.aceEditors.push(editor); |
|
|
editor.session.setUseWrapMode(false); |
|
|
editor.session.setUseWrapMode(false); |
|
|
editor.setValue(content, -1); |
|
|
editor.setValue(content, -1); |
|
|
this.updateEditorSize(editorElement, content, editor); |
|
|
this.updateEditorSize(editorElement, content, editor); |
|
|
|