Browse Source

only last arguments fix

pull/12650/head
mpetrov 2 years ago
parent
commit
934a8daa4e
  1. 9
      ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts
  2. 2
      ui-ngx/src/app/modules/home/components/event/event-table-config.ts

9
ui-ngx/src/app/modules/home/components/calculated-fields/calculated-fields-table-config.ts

@ -261,12 +261,19 @@ export class CalculatedFieldsTableConfig extends EntityTableConfig<CalculatedFie
}
private getTestScriptDialog(calculatedField: CalculatedField, argumentsObj?: Record<string, unknown>, openCalculatedFieldEdit = true): Observable<string> {
const emptyArguments = Object.keys(calculatedField.configuration.arguments).reduce((acc, key) => { acc[key] = ''; return acc; }, {});
const filledArguments = Object.keys(argumentsObj ?? {}).reduce((acc, key) => {
if (emptyArguments.hasOwnProperty(key)) {
acc[key] = argumentsObj[key];
}
return acc;
}, {});
return this.dialog.open<CalculatedFieldScriptTestDialogComponent, CalculatedFieldTestScriptDialogData, string>(CalculatedFieldScriptTestDialogComponent,
{
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] = ''; return acc; }, {}),
arguments: { ...emptyArguments, ...filledArguments },
expression: calculatedField.configuration.expression,
openCalculatedFieldEdit
}

2
ui-ngx/src/app/modules/home/components/event/event-table-config.ts

@ -357,7 +357,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
break;
case DebugEventType.DEBUG_CALCULATED_FIELD:
this.columns[0].width = '80px';
this.columns[1].width = '20%';
this.columns[1].width = '100px';
this.columns.push(
new EntityTableColumn<Event>('entityId', 'event.entity-id', '85px',
(entity) => `<span style="display: inline-block; width: 9ch">${entity.body.entityId.substring(0, 8)}…</span>`,

Loading…
Cancel
Save