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