You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1001 B

import { $t } from 'platform-core';
1 year ago
import { Processor } from '../Processor';
1 year ago
class SingleRule extends Processor {
public getToolbarAction(target: any): any {
return {
extend: 'add',
name: 'singleRule',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.SINGLE_RULE'),
icon: 'bi-noise-reduction',
enableIf: (args: any) => {
1 year ago
return target.type === 'RULE_RESULT' || target.type === 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'SINGLE_RULE');
},
};
}
1 year ago
public format(row: any): any {
return row.singleRule;
}
1 year ago
public getEditorFields(context?: any): any {
return [];
}
1 year ago
public getViewerFields(context?: any): any {
return [{ name: 'singleRule', label: $t('re.resources.designer.processor.grid.entity.singleRule') }];
}
1 year ago
public beforeEditorDataSubmit(args: any): void {}
1 year ago
public afterEditorOpen(args: any): void {}
}
export { SingleRule };