Skip to content

feat(chaining): event creation drawer (#6297)#6312

Merged
camrrx merged 7 commits into
mainfrom
issue/6297-event-creation
Jun 29, 2026
Merged

feat(chaining): event creation drawer (#6297)#6312
camrrx merged 7 commits into
mainfrom
issue/6297-event-creation

Conversation

@camrrx

@camrrx camrrx commented Jun 19, 2026

Copy link
Copy Markdown
Member

Proposed changes

  • Implement the Event Creation Drawer allowing users to create events. The drawer must provide all required event configuration capabilities, including general information, trigger conditions, condition groups.

Testing Instructions

  1. First in the code go on SimulationLogic.tsx replace the <LogicV1... by
    return <Logic workflowId={exercise?.exercise_workflow_id} context="simulation" />;
  2. Then go on simulation page
  3. Create chaining simulation
  4. Go on logic page
  5. Click on "Add component"
  6. Choose "Event"
  7. Play with the creation of an event by creating event group, drag and drop condition from group to another one

Related issues

Checklist

  • I consider the submitted work as finished
  • I tested the code for its functionality
  • I wrote test cases for the relevant uses case
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality
  • For bug fix -> I implemented a test that covers the bug

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

Copilot AI review requested due to automatic review settings June 19, 2026 10:02
@github-actions github-actions Bot added the filigran team Item from the Filigran team. label Jun 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Not ready to approve

There are blocking frontend issues (type-check/runtime compatibility) and a save-path logic mismatch where operator selections can be ignored or misapplied.

Pull request overview

Adds an “Event” creation/edit drawer to the chaining logic UI, including trigger-condition group building with drag & drop, and updates the logic flow graph to open the event drawer when editing an event node.

Changes:

  • Introduces new event form types + UI components (drawer, condition groups, operator selector, condition rows).
  • Updates chaining logic flow to support editing events and to reconstruct event condition groups from the API response.
  • Extends i18n locale JSON files with new event/condition-related strings.
File summaries
File Description
openaev-front/src/utils/lang/zh.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/ru.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/ko.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/ja.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/it.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/fr.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/es.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/en.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/utils/lang/de.json Adds new i18n keys for event creation/editing and condition builder UI.
openaev-front/src/admin/components/chaining/logic/types.ts Refactors EventMeta to store eventId + structured EventFormData.
openaev-front/src/admin/components/chaining/logic/Logic.tsx Adds editing state and wiring for editing an event from the flow.
openaev-front/src/admin/components/chaining/logic/logic-flow-helpers.ts Reconstructs nested condition groups from API condition nodes when building event metas/nodes.
openaev-front/src/admin/components/chaining/logic/events/LogicalOperatorSelect.tsx New AND/OR selector used between groups and within group headers.
openaev-front/src/admin/components/chaining/logic/events/EventCreationForm.tsx New RHF/Zod-backed event form with group builder + DnD between groups.
openaev-front/src/admin/components/chaining/logic/events/EventConditionRow.tsx New condition row editor (field/operator/value + case sensitivity + delete).
openaev-front/src/admin/components/chaining/logic/events/event-types.ts New event form types, validation helpers, and API conversion helpers.
openaev-front/src/admin/components/chaining/logic/events/ConfigureEventDetail.tsx New drawer wrapper around the event creation/edit form.
openaev-front/src/admin/components/chaining/logic/events/ConditionGroupBuilder.tsx New condition-group component (operator + add/delete condition + droppable list).
openaev-front/src/admin/components/chaining/logic/chaining_flow/LogicFlow.tsx Enables editing events via node edit action and stores event metas for edit.
openaev-front/src/admin/components/chaining/logic/chaining_flow/ChainingFlowConfiguration.tsx Adds event drawer view and implements create/update event calls (via conditions endpoints).

Copilot's findings

  • Files reviewed: 20/20 changed files
  • Comments generated: 8

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.

Comment on lines +27 to +38
export const OPERATOR_LABELS: Record<ComparisonOperator, string> = {
EQ: 'Equals',
NEQ: 'Not equals',
IS_NULL: 'IsNull',
IS_NOT_NULL: 'IsNotNull',
GT: 'Greater than',
GTE: 'Greater than or equals',
LT: 'Less than',
LTE: 'Less than or equals',
IN: 'Contains',
NIN: 'Not contains',
};
Comment on lines +145 to +158
export const createEmptyCondition = (): EventCondition => ({
id: crypto.randomUUID(),
field: 'text',
operator: 'IN',
value: '',
caseSensitive: true,
});

export const createEmptyGroup = (operator: LogicalOperator = 'AND'): ConditionGroup => ({
id: crypto.randomUUID(),
operator,
conditions: [createEmptyCondition()],
subGroups: [],
});
Comment on lines +133 to +140
// Multiple groups → emit a root logical node that wraps them all
const rootTempId = nextTempId();
result.push({
condition_temporary_id: rootTempId,
condition_type: groupOperators[0] ?? 'AND',
});

groups.forEach(group => processGroup(group, rootTempId));
Comment on lines +110 to +123
// Remove any top-level group that became empty after the drag
const nonEmptyIndices: number[] = [];
const cleaned = next.filter((g, i) => {
const keep = g.conditions.length > 0 || g.subGroups.length > 0;
if (keep) nonEmptyIndices.push(i);
return keep;
});

// Keep only the operators between groups that both survived
setConditionGroups(cleaned.length > 0 ? cleaned : next);
if (cleaned.length < next.length) {
setGroupOperators(prev => prev.filter((_, i) => nonEmptyIndices.includes(i)));
}
}, [conditionGroups]);
Comment on lines +805 to +806
"Event added successfully.": "Event added successfully.",
"Event conditions are based on data produced by Actions. To access more options in the \"Field to inspect\", consider adding additional.": "Event conditions are based on data produced by Actions. To access more options in the \"Field to inspect\", consider adding additional.",
Comment on lines +257 to +261
handleCloseAll();
onStepCreated();
} catch {
MESSAGING$.notifyError(t('Failed to create event.'));
}
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.01338% with 287 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.75%. Comparing base (0d13d4f) to head (d083a82).

Files with missing lines Patch % Lines
...onents/chaining/logic/events/EventCreationForm.tsx 0.00% 64 Missing ⚠️
...in/components/chaining/logic/logic-flow-helpers.ts 0.00% 58 Missing ⚠️
...in/components/chaining/logic/events/event-types.ts 0.00% 41 Missing ⚠️
...ts/chaining/logic/events/ConditionGroupBuilder.tsx 0.00% 33 Missing ⚠️
...onents/chaining/logic/events/EventConditionRow.tsx 0.00% 27 Missing ⚠️
.../logic/chaining_flow/ChainingFlowConfiguration.tsx 0.00% 20 Missing ⚠️
...ts/chaining/logic/events/LogicalOperatorSelect.tsx 0.00% 13 Missing ⚠️
...ponents/chaining/logic/chaining_flow/LogicFlow.tsx 0.00% 11 Missing ⚠️
...ront/src/admin/components/chaining/logic/Logic.tsx 0.00% 10 Missing ⚠️
...nts/chaining/logic/events/ConfigureEventDetail.tsx 0.00% 7 Missing ⚠️
... and 1 more

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (2.89%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6312      +/-   ##
============================================
- Coverage     43.93%   43.75%   -0.18%     
- Complexity     7204     7208       +4     
============================================
  Files          2282     2289       +7     
  Lines         62906    63184     +278     
  Branches       8344     8420      +76     
============================================
+ Hits          27639    27648       +9     
- Misses        33509    33776     +267     
- Partials       1758     1760       +2     
Flag Coverage Δ
backend 66.38% <80.00%> (+<0.01%) ⬆️
e2e 18.37% <ø> (ø)
frontend 2.89% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@savacano28 savacano28 self-assigned this Jun 25, 2026
@camrrx camrrx force-pushed the issue/6297-event-creation branch 2 times, most recently from 91efe6f to 367b4df Compare June 26, 2026 14:54
Comment thread openaev-api/src/main/java/io/openaev/api/chaining/dto/ConditionCreateInput.java Outdated
@camrrx camrrx force-pushed the issue/6297-event-creation branch from 1953d1a to 0d85733 Compare June 29, 2026 08:44
@savacano28

Copy link
Copy Markdown
Contributor

Tested OK!

@camrrx camrrx merged commit ea7c849 into main Jun 29, 2026
36 checks passed
@camrrx camrrx deleted the issue/6297-event-creation branch June 29, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scope): event creation drawer

3 participants