-
Notifications
You must be signed in to change notification settings - Fork 201
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
kie-issues#1741: Sandbox: Add “Open Boxed Expression Editor” button in the DMN Runner table output columns #2849
base: main
Are you sure you want to change the base?
Conversation
…n in the DMN Runner form output cards Closes: apache/incubator-kie-issues#1595
@tiagobento @kbowers-ibm @ljmotta or anyone else, I will write down my analysis of the problem #2849 (comment), it is the thing that runner output columns are not resizable, there is missing the resize handler. It was introduced by changes regarding The missing resize handler in dmn runner outputs columns is a problem because of this two things Too long header textMakes header unreadable and in combination with new arrow up button quite 'messy'. Too long data textSo here are some options I see. Please comment them or bring other so we can decide what option is the best. 01 'Weak' ReadOnly modeWe could change the Pros
Cons
02 'allowResizing' propertyWe could introduce additional property Pros
Cons
03 'width' computationWe could reuse the column width computation for given text as we have here: https://github.com/apache/incubator-kie-tools/blob/main/packages/dmn-editor/src/boxedExpressions/getDefaultColumnWidth.tsx directly in Pros
Cons
|
Thanks for the detailed analysis @jomarko - you've clearly put a lot of thought and effort into this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jomarko Thanks for the PR, I've made some comments inline. Please let me know if you have any questions or need further explanation.
!isLegacyDmnEditor | ||
? (nodeId: string) => { | ||
const newDmnEditorEnvelopeApi = props.editor?.getEnvelopeServer() | ||
.envelopeApi as unknown as MessageBusClientApi<NewDmnEditorEnvelopeApi>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the as unknown
is required?
|
||
export function DmnRunnerTable() { | ||
export function DmnRunnerTable(props: { editor: EmbeddedEditorRef | undefined }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm don't think we want to have an undefined
editor
as props of the DmnRunnerTable
. Also, the getEnvelopeServer()
is the only property of editor
that is used, which could be accordlying typed to avoid casting.
@@ -468,6 +468,7 @@ Error details: ${err}`); | |||
workspaceFile={file.workspaceFile} | |||
workspaces={workspaces} | |||
dmnLanguageService={dmnLanguageService} | |||
editor={editor} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, we could pass the editorEnvelopeServer
.
@@ -186,7 +189,7 @@ export function EditorPageDockContextProvider({ | |||
case PanelId.DMN_RUNNER_TABLE: | |||
return ( | |||
<DmnRunnerErrorBoundary> | |||
<DmnRunnerTable /> | |||
<DmnRunnerTable editor={editor} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
@@ -99,3 +99,9 @@ | |||
font-size: smaller; | |||
color: #1b515f; | |||
} | |||
|
|||
.kie-tools--bee--header-cell-element-extension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to be picky here, but for this particular case, we don't use the kie-tools--bee
prefix. For the boxed-expression-component
we are using multiple classes.
const onOpenBoxedExpressionHeaderButtonClick = useCallback( | ||
(clickedDecisionId: string) => { | ||
(results?.[0] ?? []).flatMap(({ decisionId: resultDecisionId }) => { | ||
if (clickedDecisionId === resultDecisionId) { | ||
openBoxedExpressionEditor?.(resultDecisionId); | ||
} | ||
}); | ||
}, | ||
[openBoxedExpressionEditor, results] | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, everytime we click on the button we will search the array to check if decisionId
is part of the results
. Why not save the result
decisionIds
in a set
?
const resultsDecisionIds = useMemo(() => results?.[0]?.reduce((set, result) => {
set.add(result.decisionId);
return set;
}, new Set()), [results]);
...
onClick={() => resultsDecisionIds.has(decisionId) && openBoxedExpressionEditor?.(decisionId)}
(I didn't test the code above)
@jomarko I agree with @kbowers-ibm . Both option 1 and 2 would require to persist the column size, or closing and opening the DMN Runner Table would reset to the original size. |
Closes apache/incubator-kie-issues#1741
The dmn runner outputs table introduces a button in the header cell top right corner for navigating into the bound expression. It means the boxed expression editor is open for the given dmn runner result.