tiagobento commented on code in PR #2720:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1922524408


##########
packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx:
##########
@@ -163,6 +166,9 @@ export function DmnRunnerContextProvider(props: 
PropsWithChildren<Props>) {
   const status = useMemo(() => (isExpanded ? DmnRunnerStatus.AVAILABLE : 
DmnRunnerStatus.UNAVAILABLE), [isExpanded]);
   const dmnRunnerAjv = useMemo(() => new DmnRunnerAjv().getAjv(), []);
 
+  const dmnEditor = useMemo(() => props.dmnEditor, [props.dmnEditor]);
+  const isLegacyDmnEditor = useMemo(() => props.isLegacyDmnEditor, 
[props.isLegacyDmnEditor]);

Review Comment:
   Don't need that...



##########
packages/online-editor/src/editor/EditorPage.tsx:
##########
@@ -475,6 +475,8 @@ Error details: ${err}`);
                   workspaceFile={file.workspaceFile}
                   isEditorReady={editor?.isReady}
                   dmnLanguageService={dmnLanguageService}
+                  dmnEditor={editor}
+                  isLegacyDmnEditor={settings.editors.useLegacyDmnEditor}

Review Comment:
   I guess this new property is not necessary as you can `useSettings` directly 
where you need it.



##########
packages/online-editor/src/dmnRunner/DmnRunnerDrawerPanelContent.tsx:
##########
@@ -324,6 +335,15 @@ export function DmnRunnerDrawerPanelContent() {
                       locale={locale}
                       notificationsPanel={true}
                       openExecutionTab={openExecutionTab}
+                      openBoxedExpressionEditor={
+                        !isLegacyDmnEditor
+                          ? (nodeId: string) => {
+                              const newDmnEditorEnvelopeApi = 
dmnEditor?.getEnvelopeServer()
+                                .envelopeApi as unknown as 
MessageBusClientApi<NewDmnEditorEnvelopeApi>;
+                              
newDmnEditorEnvelopeApi.notifications.dmnEditor_openBoxedExpressionEditor.send(nodeId);
+                            }
+                          : undefined
+                      }

Review Comment:
   Nice. This looks odd but it's the best solution possible right now given we 
have a single "Page" component for all Editors.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to