UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

19 lines (18 loc) 754 B
import { isAdaptableRuleValid } from '../../Components/EntityRulesEditor/Utilities'; export const isValidFlashingCellRules = (flashingCell, api, context) => { if (!flashingCell.Rule?.Predicates?.length && !flashingCell.Rule.BooleanExpression) { return 'No Rule defined for Flashing Cell'; } const isRuleValid = isAdaptableRuleValid(flashingCell, api, context); if (typeof isRuleValid === 'string') { return isRuleValid; } // boolean expressions may also be saved as named queries if (context.namedQuery != false) { const isValidName = api.namedQueryApi.isValidNamedQuery(context.namedQuery); if (!isValidName.valid) { return isValidName.message; } } return true; };