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.

54 lines
1.4 KiB

import { $t } from 'platform-core';
class ExecutionFlow {
public static getToolbarAction(parameter: any) {
return {
extend: 'add',
name: 'executionFlow',
label: $t('io.sc.engine.rule.core.enums.ProcessorType.EXECUTION_FLOW'),
icon: 'bi-bounding-box-circles',
enableIf: (args: any) => {
return parameter.type !== 'RULE_RESULT' && parameter.type !== 'SINGLE_RULE_RESULT';
},
afterClick: (args: any) => {
args.grid.getEditorForm().setFieldValue('type', 'EXECUTION_FLOW');
},
};
}
public static format(row: any) {
const div = document.createElement('div');
div.textContent = row.executionFlow;
const result = div.outerHTML;
div.parentNode?.removeChild(div);
return result;
}
public static getEditorFields(properties: any) {
return [
{
colSpan: 5,
name: 'executionFlow',
label: $t('re.resources.designer.processor.grid.entity.executionFlow'),
type: 'w-code-mirror',
rows: 20,
lineNumber: true,
toolbar: false,
showIf: (args: any) => {
return 'EXECUTION_FLOW' === args.form.getFieldValue('type');
},
},
];
}
public static getViewerFields(properties: any) {
return [];
}
public static beforeEditorDataSubmit(args: any) {}
public static afterEditorOpen(args: any) {}
}
export { ExecutionFlow };