Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dmn editor #117

Closed
wants to merge 506 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
506 commits
Select commit Hold shift + click to select a range
0a5d0a8
Adding titles to Palette buttons
tiagobento Oct 9, 2023
c590e23
DocumentationLinksFormGroup adjustments
ljmotta Oct 9, 2023
9b8311d
Improve keyboard navigation and add autoFocus
ljmotta Oct 9, 2023
5da4375
Adding xsdType and fromType to meta types
tiagobento Oct 9, 2023
ace288e
Updating comments
tiagobento Oct 10, 2023
aab4774
Randomizing IDs on Paste operations for Diagram and Data Types.
tiagobento Oct 10, 2023
b8d97a6
Allow pasting top-level Data Types
tiagobento Oct 11, 2023
aa25bc3
Disable the Edit button on external Decisions/BKMs
tiagobento Oct 11, 2023
8952193
Min-sizes per node
tiagobento Oct 12, 2023
fbee615
Allow re-generating ID and Namespace. Also made ID and Namespace copy…
tiagobento Oct 12, 2023
42fa002
Selected nodes and edges now respect whateever is displayed, not what…
tiagobento Oct 12, 2023
381abff
Separate between DEFAULT and MIN node sizes
tiagobento Oct 12, 2023
73d6c65
Fix min sizes for Decision Service and Groups
tiagobento Oct 12, 2023
1314bd7
Better 'select all' mechanism
tiagobento Oct 12, 2023
227425a
WIP drag and drop
ljmotta Oct 11, 2023
65eda6e
Extract Draggable component
ljmotta Oct 13, 2023
92c52c1
Extract classes
ljmotta Oct 16, 2023
68119b8
Better error screen
tiagobento Oct 17, 2023
0e6c2ad
Render an unknown node when a external node has a broken reference
tiagobento Oct 17, 2023
f55c622
Ignore external nodes when creating the clipboard
tiagobento Oct 17, 2023
015bbdd
Keep expanded state after reorder
ljmotta Oct 17, 2023
d883fc8
Refactor properties panel header
ljmotta Oct 17, 2023
7921c8b
Fix widths not being correct on new nested expresison o BEE
tiagobento Oct 18, 2023
f5924ff
Copy widths ids from boxed expressions on Diagram's clipboard
tiagobento Oct 18, 2023
8d23f76
Cleanup...
tiagobento Oct 18, 2023
6b67e4c
Delete widths when deleting nodes
tiagobento Oct 18, 2023
b5ba3e2
Improve properties panel styles
ljmotta Oct 19, 2023
62ce8da
Copying struct data types fixed
tiagobento Oct 20, 2023
2815674
Fix Decision Services and improve comments
tiagobento Oct 20, 2023
8ffcba4
Deleting an included model will make nodes become unknown nodes, inst…
tiagobento Oct 20, 2023
def95b0
Keep PMML functions synced with the PMML included model
tiagobento Oct 20, 2023
ed3d917
Improve draggable component styles
ljmotta Oct 19, 2023
1699ade
Improve documentation links key
ljmotta Oct 20, 2023
c8ada24
Diagram Empty State + dispatch refactoring
tiagobento Oct 20, 2023
1b47a31
Add url validation and adds is dragging style
ljmotta Oct 21, 2023
44eb03f
Improve documentation links validation
ljmotta Oct 23, 2023
d1c58b4
Show remove button on hover
ljmotta Oct 23, 2023
c84b4fc
During drag operation erase the component after it left the origin
ljmotta Oct 23, 2023
c52928b
Resizing DS
tiagobento Oct 23, 2023
a174706
Allow moving the Decision Service divider line
tiagobento Oct 23, 2023
715d5f8
Better empty state for diagram
tiagobento Oct 23, 2023
2d09124
Improve url validation rules
ljmotta Oct 23, 2023
b32279a
Polishing the code and improving URL validation
ljmotta Oct 24, 2023
10599f5
Adds missing try catch on the url parse
ljmotta Oct 24, 2023
da37b8e
Fix multiple re-renders on changes on the properties panel
ljmotta Oct 24, 2023
e4e9c42
Improve autofocus and documentation
ljmotta Oct 24, 2023
f47e1fd
Check for changes before calling onChange
ljmotta Oct 24, 2023
f04e839
Improve names and fix url update on toogle
ljmotta Oct 24, 2023
c30ad08
Don't allow cycles to form when editing the Diagram
tiagobento Oct 24, 2023
d962cbb
Show active top-level data type when a nested item compoennt is showing
tiagobento Oct 25, 2023
5794c04
Do not highlight drop targets when dragging nodes from the Palette
tiagobento Oct 25, 2023
2ffe4e7
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Oct 25, 2023
d349a36
Fix resize. And oops.... forgot to commit two files on the merge....
tiagobento Oct 25, 2023
e1d4ac6
Fix external nodes
tiagobento Oct 25, 2023
93690af
Fix DT generation with untyped inputs
tiagobento Oct 25, 2023
6e645ba
Allow source handles to be changed
tiagobento Oct 27, 2023
f4ae502
Minor fixes
tiagobento Oct 27, 2023
8c8cf0d
Fix source edge positioning when creating new edges
tiagobento Oct 27, 2023
fc74120
Fix problem with dephasing on isValidConnection
tiagobento Oct 27, 2023
cbe1101
Fix KnowledgeSource node svg
tiagobento Oct 30, 2023
42c82ee
Fix DecisionServiceNodeSvg to have readonly divider line and dragging…
tiagobento Oct 30, 2023
de7d5c5
Add support to kie:constraintType on the KIE extension XSD
ljmotta Oct 30, 2023
7156467
WIP constraint panel: added initial version of range constraint for n…
ljmotta Oct 30, 2023
549c323
Collapsed Decision Service is not transparent
tiagobento Oct 30, 2023
11ecad9
Uncontrolled name input should react to external prop changes
tiagobento Oct 31, 2023
87b425d
Fix horizontal limiting of Decision Services when resizing
tiagobento Oct 31, 2023
2cfeac0
Java functions now have the correct width
tiagobento Oct 31, 2023
1839dfd
Partially address FIXMEs
tiagobento Oct 31, 2023
1de2242
WIP constraint panel: create initial enum structure
ljmotta Nov 1, 2023
a1f58db
Improve range layout
ljmotta Nov 1, 2023
ce17b4f
Address almost all FIXMEs
tiagobento Nov 2, 2023
df465f9
DMN Marshaller now can upgrade DMN files to 1.3, 1.4, and 1.5
tiagobento Nov 2, 2023
55604d1
Adding tests to DMN Marshaller migrations and improving code a little…
tiagobento Nov 2, 2023
a404d07
Minor improvements
tiagobento Nov 2, 2023
4d75e9c
dmn-editor-envelope
tiagobento Nov 3, 2023
8316323
Fix restting top-level expression on Decision ndoes
tiagobento Nov 6, 2023
6828e37
Darker hover background on Docu links
tiagobento Nov 6, 2023
79d0bf5
Colorize & autocomplete (#114)
danielzhe Nov 6, 2023
6fe68e2
Data Types always opens with first on list
tiagobento Nov 6, 2023
c3c0389
Fix weirdest error caused by non-idempotent Zustand selectors. Browse…
tiagobento Nov 6, 2023
3be5982
External models on DMN Editor on KIE Sandbox
tiagobento Nov 7, 2023
d21486e
WIP constraint panel: range panel almost finished
ljmotta Nov 7, 2023
df0e6f6
Remove constraint on type change and code improvement
ljmotta Nov 7, 2023
b175529
Improve drag and drop handler and remove tooltips
ljmotta Nov 7, 2023
c5e902b
Fixes for DMN Runner and KIE Sandbox CSS
tiagobento Nov 7, 2023
b4f7b96
Reanme nodes onBlur
tiagobento Nov 7, 2023
e011d7f
Add typeRef isCollection indicator to TypeRefLabel and some layout is…
tiagobento Nov 7, 2023
2663ec1
Fix paddings and some imports
tiagobento Nov 7, 2023
e92bff7
Jump to definition correctly positioned on Data Types node panel
tiagobento Nov 7, 2023
af78c3a
Remove unnecessary CSS
tiagobento Nov 7, 2023
bdd765e
Readonly for documentation links
tiagobento Nov 7, 2023
e0a5469
Extracting CSS
tiagobento Nov 7, 2023
d5ede9c
Fix creating Data Type from empty state
tiagobento Nov 7, 2023
549717f
Data Types padding left
tiagobento Nov 7, 2023
14eca79
Improve consistency of DmnEditorRoot
tiagobento Nov 7, 2023
f287084
Removing unnecessary method
tiagobento Nov 7, 2023
ae9ef51
Better error handling
tiagobento Nov 7, 2023
43b2c25
Prepare for autolayout
tiagobento Nov 7, 2023
6f1cbe2
WIP constraint panel: improve enumeration and expression constraint
ljmotta Nov 8, 2023
5266696
Fix undo/redo on reorder
ljmotta Nov 8, 2023
ea48e44
WIP constraint panel: add drag and drop on enumeration and generation…
ljmotta Nov 8, 2023
d01c15b
Skip unexisting nodes from being painted
tiagobento Nov 8, 2023
b86ccfa
Handle weird data types
tiagobento Nov 8, 2023
ed6d1f6
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Nov 8, 2023
815b6d1
Skip rendering the BeePropertiesPanel if the open node id doesn't exist
tiagobento Nov 8, 2023
33ad600
Minor fixes
tiagobento Nov 8, 2023
1b9f5b5
Changed paths to relative. Supporting included PMMLs now.
tiagobento Nov 9, 2023
8184436
New prop to allow the editor to resolve relative paths
tiagobento Nov 9, 2023
8cdcf9b
WIP constraint panel: add number validation
ljmotta Nov 8, 2023
c8fe9ba
WIP constraint panel: add enum validation
ljmotta Nov 9, 2023
b44c153
Better position version label
tiagobento Nov 9, 2023
f44408c
WIP constraint panel: add duration constraint
ljmotta Nov 9, 2023
b9ea180
Update constraints column width
ljmotta Nov 9, 2023
3ae8a35
WIP constraint panel: persist invalid values
ljmotta Nov 9, 2023
cb0e0de
WIP constraint panel: code improvement and refactor
ljmotta Nov 10, 2023
ab69704
WIP constraint panel: improve enum code by removing unecessary re-ren…
ljmotta Nov 10, 2023
dcef89e
DRDs pseudo-support
tiagobento Nov 10, 2023
5acae8a
Oops! Forgot to commit some files
tiagobento Nov 10, 2023
c5651dd
Fix Paltte getting in the way of cursor
tiagobento Nov 10, 2023
bbe66e4
Adding nodes to other DRds
tiagobento Nov 10, 2023
152bc62
Better code on addOrGetDrd
tiagobento Nov 10, 2023
1b55a03
Better UX for unknown included models
tiagobento Nov 10, 2023
f6d066c
Added DRG nodes panel
tiagobento Nov 10, 2023
819f99a
Always add XML prolog when building
tiagobento Nov 10, 2023
c863225
DRD selector size fix
tiagobento Nov 10, 2023
cc8917f
Fix adding DRD
tiagobento Nov 10, 2023
a264f36
More multiple-DRDs fixes
tiagobento Nov 10, 2023
e038b02
WIP constraint panel: enum and range working
ljmotta Nov 10, 2023
5f99aab
WIP constraint panel: fix range first values
ljmotta Nov 10, 2023
07086ec
WIP constraint panel: support for date and inital support for time
ljmotta Nov 10, 2023
aeb5ca4
WIP constraint panel: add support for previous DMN versions
ljmotta Nov 11, 2023
4904ea7
WIP constraint panel: add initial support for date-time
ljmotta Nov 11, 2023
f4d7661
Drd selector better positioning
tiagobento Nov 12, 2023
fbb113f
Auto-close empty DMN to make it work on Firefox DOM parser
tiagobento Nov 12, 2023
106b3db
Fix insert row/column-n and adding expressions to lists (#115)
danielzhe Nov 13, 2023
b976765
WIP constraint panel: fix time component and general functionalities
ljmotta Nov 13, 2023
e512a87
constraint panel: depend exclusively on the itemDefinition
ljmotta Nov 14, 2023
ed5db35
Move draggable component to its on dir
ljmotta Nov 14, 2023
24a33bc
Improve DMN Editor top glass header
ljmotta Nov 14, 2023
5f390c9
Add overflow to typeRefSelector
ljmotta Nov 14, 2023
9d94fed
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Nov 14, 2023
0ee05b8
Improve sample.dmn
tiagobento Nov 15, 2023
a833140
BEE header
tiagobento Nov 15, 2023
35e4f12
Oops. Fix defautl DMN on dmn-editor Dev webapp
tiagobento Nov 15, 2023
c26db5d
More improvements to sample.dmn
tiagobento Nov 15, 2023
803f10b
Create data types from nodes. Fix node deletion removing widths
tiagobento Nov 15, 2023
b17518e
Oops
tiagobento Nov 15, 2023
4ab87aa
Responsive select
tiagobento Nov 15, 2023
a1bb44f
Oops
tiagobento Nov 16, 2023
f12a958
Fix external types referencing their own local types
tiagobento Nov 16, 2023
a6eb20e
External data types now working correctly
tiagobento Nov 16, 2023
4a7f5a4
Correctly genering Decision Table output columns widths
tiagobento Nov 16, 2023
f8f0a8d
Fix datatype header
ljmotta Nov 15, 2023
2dff33c
Improve data types constraint panel
ljmotta Nov 15, 2023
44c14e9
Fix data types
ljmotta Nov 16, 2023
98feed9
Add timezone to date field constraint and fix validation styles
ljmotta Nov 16, 2023
ee78bc1
Fix constraint range
ljmotta Nov 16, 2023
2ad636e
Fix draggable component
ljmotta Nov 16, 2023
5338c7e
Make timezone select always in-view
tiagobento Nov 16, 2023
59c124b
Fix draggable list pt2
ljmotta Nov 16, 2023
60e63ba
Fix extract data types
tiagobento Nov 16, 2023
554c7ad
Fix extract/cut/copy/paste data types
tiagobento Nov 16, 2023
0ffeefb
Fix drag & drop for DRG nodes on any DRDs
tiagobento Nov 16, 2023
1c49065
DRG/External nodes panel now have nice scroll
tiagobento Nov 16, 2023
36b1bf8
Add max-width
tiagobento Nov 16, 2023
977c09f
Adding button to close drg/external nodes panel
tiagobento Nov 16, 2023
018e373
Add timezone to time constraint
ljmotta Nov 16, 2023
1542b5b
Re struct constraint panel
ljmotta Nov 16, 2023
378a5ef
Remove all set states
ljmotta Nov 16, 2023
118ed6b
Fix date and time duration and years and months duration
ljmotta Nov 16, 2023
e12ce15
Fix text input components
ljmotta Nov 16, 2023
45205ff
Check if is disable on drag and drop component
ljmotta Nov 16, 2023
253b34e
Fixes for undefined variabels and included models on KIE Sandbox
tiagobento Nov 16, 2023
f721b5c
Add font tweak panel for single node
ljmotta Nov 17, 2023
188ca1c
Refine font selection
ljmotta Nov 17, 2023
32ff78a
Add multi font style edit
ljmotta Nov 17, 2023
8804155
Fix number input minimum
ljmotta Nov 17, 2023
fb2ec42
Add first support for bound tweaks
ljmotta Nov 17, 2023
0cb330c
Minor adjustments on the shape style
ljmotta Nov 17, 2023
f439fe6
Reorder components
tiagobento Nov 17, 2023
688aea1
Add reset button
ljmotta Nov 17, 2023
61708b4
Always 400px for nodes panel
tiagobento Nov 17, 2023
389c9eb
Auto-focus on new renameable stuff
tiagobento Nov 19, 2023
33ffff2
Auto-focus new nodes works even with properties panel open
tiagobento Nov 19, 2023
5b40185
Start font and shape properties expanded for multiple nodes
tiagobento Nov 19, 2023
83b3db3
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Nov 20, 2023
76bbc9c
Dependencies consistency
tiagobento Nov 20, 2023
e6b5a3d
Fixes for external nodes
tiagobento Nov 20, 2023
db60f24
Fix containment for nodes with aggressive snapping
tiagobento Nov 20, 2023
35bc6a0
Fix PMML discovery on included models
tiagobento Nov 20, 2023
3575dbb
Add missing timezones
ljmotta Nov 21, 2023
965f024
Improve shape style component
ljmotta Nov 21, 2023
e87f2fd
Remove fillColor and strokeColor from rect props
ljmotta Nov 21, 2023
acb1b0f
Fix default fill color and decision service and group colors
ljmotta Nov 21, 2023
7232958
Add overlay to enable styles
ljmotta Nov 21, 2023
8ae659a
Add text annotation fill color
ljmotta Nov 21, 2023
d998145
Feature flag on KIE Sandbox and settings not using Cookies anymore
tiagobento Nov 21, 2023
9dfc05f
Register new DMN Editor on VS Code
tiagobento Nov 22, 2023
694c283
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Nov 22, 2023
a1b8bb4
Fix build
tiagobento Nov 22, 2023
b8c71e2
Add debouncer to color picker
ljmotta Nov 22, 2023
e3727d9
Update boxed-expression-component e2e tests
ljmotta Nov 22, 2023
c0008b1
Better auto-focusing
tiagobento Nov 22, 2023
4292e81
Better description for included models
tiagobento Nov 22, 2023
3ee3cd7
Merge remote-tracking branch 'origin/main' into dmn-editor
ljmotta Nov 23, 2023
e69a395
Improve type casting
ljmotta Nov 27, 2023
1776f09
Merge remote-tracking branch 'origin/main' into dmn-editor
ljmotta Nov 27, 2023
4691958
Add missing path to enable SWF editor loading
ljmotta Nov 28, 2023
cbdce82
Merge remote-tracking branch 'origin/main' into dmn-editor
ljmotta Nov 28, 2023
e1f4b64
Fix negative numbers on duration constraint
ljmotta Nov 28, 2023
81a13af
Enable string range constraint
ljmotta Nov 28, 2023
06f089c
Fix range of float numbers
ljmotta Nov 28, 2023
5ac92ca
Enable to fill date only on the datetime constraint
ljmotta Nov 28, 2023
0fa9646
Update boxed expression title DOM path
ljmotta Nov 29, 2023
470b88d
Update kie sandbox e2e tests
ljmotta Dec 1, 2023
09371eb
Merge remote-tracking branch 'origin/main' into dmn-editor
ljmotta Dec 1, 2023
36b0eb9
Update screenshot
ljmotta Dec 1, 2023
47fe0ed
Prevent user to type the range separator
ljmotta Dec 4, 2023
66106c1
Change deprecated "project" over "screenToFlowPosition"
ljmotta Dec 4, 2023
6909192
Apache headers on TS/TSX files
tiagobento Dec 4, 2023
d3fa967
Merge remote-tracking branch 'origin/main' into dmn-editor
tiagobento Dec 4, 2023
5b3743a
Fix external typeRefs on data type node panel
tiagobento Dec 6, 2023
0f58cc7
Oops. Forgot to add new files.
tiagobento Dec 6, 2023
e708074
READMEs and SVG commands for DMN Editors on VS Code
tiagobento Dec 7, 2023
d33af59
Fix DMN vscode extension reading all files on the workspace before fi…
ljmotta Dec 11, 2023
dccc34f
Oops. forgot to change imports on test files
ljmotta Dec 11, 2023
519cc2a
Memoize values on included models tab
ljmotta Dec 13, 2023
5b1c9b3
Fix VS Code included models links and locationURI value
ljmotta Dec 14, 2023
c4e056d
Fix extended services config url
ljmotta Dec 14, 2023
a2fcc64
Fixes the multiline expression issue (#116)
danielzhe Dec 15, 2023
86ea058
Wait for external model manager before rendering the new DMN Editor
ljmotta Dec 18, 2023
a9f98fd
Oops
ljmotta Dec 18, 2023
4f8bd2f
Clarify dmn language service paths, and fix included models multi-lev…
ljmotta Dec 19, 2023
d1d1be5
Merge remote-tracking branch 'origin/main' into dmn-editor
ljmotta Dec 19, 2023
fc9e894
Fix dmn language service tests
ljmotta Dec 19, 2023
2a5e571
Oops. Missing change from merge
ljmotta Dec 19, 2023
8dd0f5c
Missing change from dmn-language-service
ljmotta Dec 19, 2023
d47e647
Fix getImportedModelPathRelativeToWorkspaceRoot on Windows
tiagobento Dec 19, 2023
e76cf57
For asset files use the returned workspace relative file path instead…
ljmotta Dec 20, 2023
0920273
Polyfill Buffer to enable extension usage on the github.dev, and fix …
ljmotta Dec 20, 2023
dae89ac
On dangling files use its path instead of relative path and set SVG p…
ljmotta Dec 20, 2023
b135b3b
Undo change where VS Code resource content was returning absolute pat…
ljmotta Dec 21, 2023
b73962c
Update VS Code resources content for dangling files and fix online ed…
ljmotta Dec 21, 2023
758bab4
Keep old behavior for get dangling file and keep all paths on DmnEdit…
ljmotta Dec 22, 2023
bc4daf0
Make dangling methods always return path relative to open file
ljmotta Dec 22, 2023
f71e88b
The runtimes doesn't support DMN 1.5. This flag ignores the validatio…
ljmotta Dec 22, 2023
6386ef7
Add Buffer polyfill for all vscode extensions
ljmotta Dec 22, 2023
2ea015b
Try and see the error on Windows.
tiagobento Dec 24, 2023
505b93b
Make all paths be posix
tiagobento Dec 24, 2023
debd2c2
Embracing platform-specific temporarily
tiagobento Dec 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export const environment = {
production: true,
};
19 changes: 19 additions & 0 deletions examples/ping-pong-view-angular/src/test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import "zone.js/testing";
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
}
},
"patchedDependencies": {
"[email protected]": "patches/[email protected]"
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]"
}
},
"kieTools": {
Expand Down
4 changes: 0 additions & 4 deletions packages/boxed-expression-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
"@patternfly/react-styles": "^4.92.6",
"@patternfly/react-table": "^4.112.39",
"lodash": "^4.17.21",
"papaparse": "^5.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-id-generator": "^3.0.1",
"react-resizable": "^1.11.0",
"react-table": "^7.6.2",
"uuid": "^8.3.2"
Expand All @@ -58,7 +56,6 @@
"@storybook/react": "^7.3.2",
"@storybook/react-webpack5": "^7.3.2",
"@types/lodash": "^4.14.168",
"@types/papaparse": "^5.3.2",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-resizable": "^1.7.2",
Expand All @@ -67,7 +64,6 @@
"copy-webpack-plugin": "^11.0.0",
"copyfiles": "^2.4.1",
"file-loader": "^6.2.0",
"gh-pages": "^3.2.3",
"jest": "^26.6.3",
"jest-junit": "^14.0.0",
"jest-when": "^3.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { ExpressionDefinition } from "./ExpressionDefinition";
* This interface defines all the API methods which BoxedExpressionEditor component can use to dialog with GWT Layer
*/
export interface BeeGwtService {
getDefaultExpressionDefinition(logicType: string, dataType: string): ExpressionDefinition;
getDefaultExpressionDefinition(logicType: string, typeRef: string, isRoot?: boolean): ExpressionDefinition;
openDataTypePage: () => void; // Just open the data types tab
selectObject: (uuid?: string) => void; // Changes the Properties panel
}
13 changes: 12 additions & 1 deletion packages/boxed-expression-component/src/api/BeeTable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,13 @@ export interface BeeTableProps<R extends object> {
onRowDuplicated?: (args: { rowIndex: number }) => void;
onRowReset?: (args: { rowIndex: number }) => void;
onRowDeleted?: (args: { rowIndex: number }) => void;
onColumnAdded?: (args: { beforeIndex: number; currentIndex?: number; groupType: string | undefined }) => void;
onColumnAdded?: (args: {
beforeIndex: number;
currentIndex?: number;
groupType: string | undefined;
columnsCount: number;
insertDirection: InsertRowColumnsDirection;
}) => void;
onColumnDeleted?: (args: { columnIndex: number; groupType: string | undefined }) => void;
shouldRenderRowIndexColumn: boolean;
shouldShowRowsInlineControls: boolean;
Expand Down Expand Up @@ -135,3 +141,8 @@ export type BeeTableContextMenuAllowedOperationsConditions = {
column: ReactTable.ColumnInstance<any> | undefined;
columns: ReactTable.ColumnInstance<any>[] | undefined;
};

export enum InsertRowColumnsDirection {
AboveOrRight,
BelowOrLeft,
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ export enum DecisionTableExpressionDefinitionHitPolicy {
Unique = "UNIQUE",
First = "FIRST",
Priority = "PRIORITY",
Any = "ANY",
Collect = "COLLECT",
Any = "ANY",
RuleOrder = "RULE ORDER",
OutputOrder = "OUTPUT ORDER",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
} from "../../i18n";
import { ExpressionDefinitionRoot } from "../ExpressionDefinitionRoot";
import "./base-no-reset-wrapped.css";
import "../../@types/react-table";
import { BoxedExpressionEditorContextProvider } from "./BoxedExpressionEditorContext";
import { FeelVariables } from "@kie-tools/dmn-feel-antlr4-parser";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
ExpressionDefinitionLogicType,
generateUuid,
getNextAvailablePrefixedName,
InsertRowColumnsDirection,
} from "../../api";
import { useBoxedExpressionEditorI18n } from "../../i18n";
import { useNestedExpressionContainerWithNestedExpressions } from "../../resizing/Hooks";
Expand All @@ -42,7 +43,7 @@ import {
CONTEXT_ENTRY_INFO_MIN_WIDTH,
CONTEXT_EXPRESSION_EXTRA_WIDTH,
} from "../../resizing/WidthConstants";
import { useBeeTableSelectableCellRef, useBeeTableCoordinates } from "../../selection/BeeTableSelectionContext";
import { useBeeTableCoordinates, useBeeTableSelectableCellRef } from "../../selection/BeeTableSelectionContext";
import { BeeTable, BeeTableColumnUpdate } from "../../table/BeeTable";
import {
useBoxedExpressionEditor,
Expand All @@ -66,6 +67,7 @@ export function ContextExpression(
}
) {
const { i18n } = useBoxedExpressionEditorI18n();
const { decisionNodeId } = useBoxedExpressionEditor();
const { setExpression } = useBoxedExpressionEditorDispatch();
const { variables } = useBoxedExpressionEditor();

Expand Down Expand Up @@ -139,10 +141,10 @@ export function ContextExpression(
const beeTableColumns = useMemo<ReactTable.Column<ROWTYPE>[]>(() => {
return [
{
accessor: contextExpression.id as any, // FIXME: https://github.com/kiegroup/kie-issues/issues/169
accessor: decisionNodeId as any, // FIXME: https://github.com/kiegroup/kie-issues/issues/169
label: contextExpression.name ?? DEFAULT_EXPRESSION_NAME,
isRowIndexColumn: false,
dataType: contextExpression.dataType ?? CONTEXT_ENTRY_DEFAULT_DATA_TYPE,
dataType: contextExpression.dataType,
width: undefined,
columns: [
{
Expand All @@ -166,7 +168,7 @@ export function ContextExpression(
],
},
];
}, [contextExpression.id, contextExpression.name, contextExpression.dataType, entryInfoWidth, setEntryInfoWidth]);
}, [decisionNodeId, contextExpression.name, contextExpression.dataType, entryInfoWidth, setEntryInfoWidth]);

const onColumnUpdates = useCallback(
([{ name, dataType }]: BeeTableColumnUpdate<ROWTYPE>[]) => {
Expand Down Expand Up @@ -253,7 +255,7 @@ export function ContextExpression(
return {
entryInfo: {
id: generateUuid(),
dataType: DmnBuiltInDataType.Undefined,
dataType: CONTEXT_ENTRY_DEFAULT_DATA_TYPE,
name:
name ||
getNextAvailablePrefixedName(
Expand All @@ -264,7 +266,7 @@ export function ContextExpression(
entryExpression: {
id: generateUuid(),
logicType: ExpressionDefinitionLogicType.Undefined,
dataType: DmnBuiltInDataType.Undefined,
dataType: CONTEXT_ENTRY_DEFAULT_DATA_TYPE,
},
};
},
Expand Down Expand Up @@ -304,21 +306,36 @@ export function ContextExpression(
);

const onRowAdded = useCallback(
(args: { beforeIndex: number }) => {
(args: { beforeIndex: number; rowsCount: number; insertDirection: InsertRowColumnsDirection }) => {
setExpression((prev: ContextExpressionDefinition) => {
const newContextEntries = [...(prev.contextEntries ?? [])];
const defaultContextEntry = getDefaultContextEntry();
addVariable(args, newContextEntries, prev, defaultContextEntry);

newContextEntries.splice(args.beforeIndex, 0, defaultContextEntry);
const newEntries = [];
const names = contextExpression.contextEntries.map((e) => e.entryInfo.name);
for (let i = 0; i < args.rowsCount; i++) {
const name = getNextAvailablePrefixedName(names, "ContextEntry");
names.push(name);

const defaultContextEntry = getDefaultContextEntry(name);
addVariable(args, newContextEntries, prev, defaultContextEntry);
newEntries.push(defaultContextEntry);
}

for (const newEntry of newEntries) {
let index = args.beforeIndex;
newContextEntries.splice(index, 0, newEntry);
if (args.insertDirection === InsertRowColumnsDirection.AboveOrRight) {
index++;
}
}

return {
...prev,
contextEntries: newContextEntries,
};
});
},
[addVariable, getDefaultContextEntry, setExpression]
[addVariable, contextExpression.contextEntries, getDefaultContextEntry, setExpression]
);

const onRowDeleted = useCallback(
Expand Down Expand Up @@ -449,7 +466,7 @@ export function ContextResultInfoCell() {

useEffect(() => {
if (isActive) {
beeGwtService?.selectObject("");
beeGwtService?.selectObject(""); // FIXME: Tiago --> This should actually be the id of the parent expression, as the <result> of a context follows its parent's data type.
}
}, [beeGwtService, isActive]);

Expand Down
Loading
Loading