refactoring
This commit is contained in:
parent
2833164968
commit
f8d88387fa
@ -205,7 +205,8 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
|
||||
additionalDebugActionConfig: this.additionalDebugActionConfig,
|
||||
getTestScriptDialogFn: this.getTestScriptDialog.bind(this),
|
||||
isDirty
|
||||
}
|
||||
},
|
||||
...(isDirty ? { enterAnimationDuration: 0 } : {})
|
||||
})
|
||||
.afterClosed();
|
||||
}
|
||||
@ -265,7 +266,7 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
|
||||
disableClose: true,
|
||||
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-fullscreen-dialog-gt-xs'],
|
||||
data: {
|
||||
arguments: argumentsObj ?? Object.keys(calculatedField.configuration.arguments).reduce((acc, key) => ({...acc, [key]: '' }), {}),
|
||||
arguments: argumentsObj ?? Object.keys(calculatedField.configuration.arguments).reduce((acc, key) => { acc[key] = ''; return acc; }, {}),
|
||||
expression: calculatedField.configuration.expression,
|
||||
}
|
||||
}).afterClosed()
|
||||
|
||||
@ -33,7 +33,7 @@ import {
|
||||
import { noLeadTrailSpacesRegex } from '@shared/models/regex.constants';
|
||||
import { AttributeScope } from '@shared/models/telemetry/telemetry.models';
|
||||
import { EntityType } from '@shared/models/entity-type.models';
|
||||
import { filter, map, startWith } from 'rxjs/operators';
|
||||
import { map, startWith } from 'rxjs/operators';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { ScriptLanguage } from '@shared/models/rule-node.models';
|
||||
|
||||
@ -121,11 +121,7 @@ export class CalculatedFieldDialogComponent extends DialogComponent<CalculatedFi
|
||||
}
|
||||
|
||||
onTestScript(): void {
|
||||
this.data.getTestScriptDialogFn(this.fromGroupValue)
|
||||
.pipe(filter(Boolean)).subscribe((expression: string) => {
|
||||
this.configFormGroup.get('expressionSCRIPT').setValue(expression);
|
||||
this.configFormGroup.get('expressionSCRIPT').markAsDirty();
|
||||
});
|
||||
this.data.getTestScriptDialogFn(this.fromGroupValue).subscribe();
|
||||
}
|
||||
|
||||
private applyDialogData(): void {
|
||||
|
||||
@ -360,7 +360,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
||||
this.columns[1].width = '20%';
|
||||
this.columns.push(
|
||||
new EntityTableColumn<Event>('entityId', 'event.entity-id', '85px',
|
||||
(entity) => `<span style="display: inline-block; width: 7ch">${entity.body.entityId.substring(0, 8)}…</span>`,
|
||||
(entity) => `<span style="display: inline-block; width: 9ch">${entity.body.entityId.substring(0, 8)}…</span>`,
|
||||
() => ({padding: '0 12px 0 0'}),
|
||||
false,
|
||||
() => ({padding: '0 12px 0 0'}),
|
||||
@ -380,7 +380,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
|
||||
}
|
||||
),
|
||||
new EntityTableColumn<Event>('messageId', 'event.message-id', '85px',
|
||||
(entity) => `<span style="display: inline-block; width: 7ch">${entity.body.msgId?.substring(0, 8)}…</span>`,
|
||||
(entity) => `<span style="display: inline-block; width: 9ch">${entity.body.msgId?.substring(0, 8)}…</span>`,
|
||||
() => ({padding: '0 12px 0 0'}),
|
||||
false,
|
||||
() => ({padding: '0 12px 0 0'}),
|
||||
|
||||
@ -209,7 +209,7 @@ export interface EntityTestScriptResult {
|
||||
}
|
||||
|
||||
export interface AdditionalDebugActionConfig<Action = (...args: unknown[]) => void> {
|
||||
action?: Action;
|
||||
action: Action;
|
||||
title: string;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user