@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
22 lines (21 loc) • 2.71 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { useOnePageAdaptableWizardContext } from '../../Wizard/OnePageAdaptableWizard';
import { EntityRulesEditor } from '../../Components/EntityRulesEditor';
import { Box, Flex } from '../../../components/Flex';
import { Card } from '../../../components/Card';
import { getRuleViewItems } from '../../../Utilities/getRuleViewItems';
import { renderSummaryStringTags } from '../../Wizard/SummaryColorTag';
export const renderFlashingAlertRulesSummary = (flashingAlert, api) => {
const { values } = getRuleViewItems(flashingAlert.Rule, api);
return renderSummaryStringTags(values ?? ['No condition']);
};
export const FlashingAlertRulesWizardSection = (props) => {
const { data, api, moduleInfo } = useOnePageAdaptableWizardContext();
const predicateDefs = api.flashingCellApi.getFlashingCellPredicateDefsForScope(data.Scope);
return (_jsx(Flex, { flexDirection: "column", className: "twa:h-full twa:gap-3 twa:p-3", children: _jsxs(Card, { shadow: false, className: "twa:flex-1 twa:min-h-0", children: [_jsxs(Card.Title, { children: [_jsx(Box, { className: "twa:font-medium", children: "Rule" }), _jsx(Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Build the rule that determines when cells should flash on a data change" })] }), _jsx(Card.Body, { className: "twa:flex-1 twa:min-h-0", children: _jsx(EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "AnyChange", data: data, predicateDefs: predicateDefs, getPredicateDefsForColId: (colId) => api.flashingCellApi.getFlashingCellPredicateDefsForScope({ ColumnIds: [colId] }), onChange: props.onChange, showAggregation: false, showObservable: false, showBoolean: true, showPredicate: true, descriptions: {
selectPredicate: 'Select a Flashing Cell Rule - to be applied when data changes',
useBooleanQuery: (_jsxs(_Fragment, { children: ["Use an BooleanQuery if ", _jsx("i", { children: "Scope" }), " is 'All Columns' - so any data change may be evaluated in a complex BooleanExpression"] })),
useObservableQuery: (_jsxs(_Fragment, { children: ["Use an ObservableQuery if ", _jsx("i", { children: "Scope" }), " is 'All Columns' - so any data change may be evaluated in a complex ObservableExpression"] })),
useAggregationQuery: (_jsxs(_Fragment, { children: ["Use an AggregatedBooleanQuery if ", _jsx("i", { children: "Scope" }), " is 'All Columns' - so any data change may be evaluated in a complex AggregatedBooleanExpression"] })),
} }) })] }) }));
};