You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "jomarko (via GitHub)" <gi...@apache.org> on 2024/11/01 14:03:36 UTC
[PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
jomarko opened a new pull request, #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720
Closes: https://github.com/apache/incubator-kie-issues/issues/1595
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1891857572
##########
packages/editor/src/api/KogitoEditorEnvelopeApi.ts:
##########
@@ -51,6 +51,7 @@ export interface EditorInitArgs {
export interface KogitoEditorEnvelopeApi extends KeyboardShortcutsEnvelopeApi, I18nEnvelopeApi {
kogitoEditor_contentChanged(content: EditorContent, args: { showLoadingOverlay: boolean }): Promise<void>;
+ kogitoEditor_openBoxedExpressionEditor(nodeId: string): void;
Review Comment:
yes, thank you @tiagobento , @ljmotta gave me a tip to look on:
- `YardChannelComponent`
- `WebToolsEmbeddedEditor`
- `yardTextEditor_moveCursorToPosition`
working on it currently
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1916982525
##########
packages/form-dmn/src/FormDmnOutputs.tsx:
##########
@@ -258,7 +262,18 @@ export function FormDmnOutputs({ openExecutionTab, ...props }: FormDmnOutputsPro
onAnimationEnd={(e) => onAnimationEnd(e, index)}
>
<CardTitle>
- <Title headingLevel={"h2"}>{dmnFormResult.decisionName}</Title>
+ <Flex justifyContent={{ default: "justifyContentSpaceBetween" }}>
+ <Title headingLevel={"h2"}>{dmnFormResult.decisionName}</Title>
+ {props.openBoxedExpressionEditor !== undefined && (
+ <Button
+ variant={"plain"}
+ title={`Open ${dmnFormResult.decisionName} expression`}
+ icon={<ArrowUpIcon />}
+ data-navigate-to-expression-id={dmnFormResult.decisionId}
+ onClick={() => props.openBoxedExpressionEditor?.(dmnFormResult.decisionId)}
+ />
+ )}
+ </Flex>
Review Comment:
should be fixed now
##########
packages/online-editor/src/dmnRunner/DmnRunnerDrawer.tsx:
##########
@@ -38,7 +41,7 @@ export function DmnRunnerDrawer(props: React.PropsWithChildren<{}>) {
}
panelContent={
<DmnRunnerErrorBoundary>
- <DmnRunnerDrawerPanelContent />
+ <DmnRunnerDrawerPanelContent {...props} />
Review Comment:
should be fixed now
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1891547615
##########
packages/editor/src/api/KogitoEditorEnvelopeApi.ts:
##########
@@ -51,6 +51,7 @@ export interface EditorInitArgs {
export interface KogitoEditorEnvelopeApi extends KeyboardShortcutsEnvelopeApi, I18nEnvelopeApi {
kogitoEditor_contentChanged(content: EditorContent, args: { showLoadingOverlay: boolean }): Promise<void>;
+ kogitoEditor_openBoxedExpressionEditor(nodeId: string): void;
Review Comment:
This method is specific to the DMN Editor so shouldn't be here in the generic Editor's interface.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1924828411
##########
packages/online-editor/src/dmnRunner/DmnRunnerContext.tsx:
##########
@@ -41,6 +42,8 @@ export interface DmnRunnerContextType {
results: Array<DecisionResult[] | undefined>;
resultsDifference: Array<Array<object>>;
status: DmnRunnerStatus;
+ dmnEditor: EmbeddedEditorRef | undefined;
+ isLegacyDmnEditor: boolean;
Review Comment:
done
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1916982029
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -42,7 +42,7 @@ export class DmnEditorFactory implements EditorFactory<Editor, KogitoEditorChann
}
export class DmnEditorInterface implements Editor {
- private self: DmnEditorRoot;
+ protected self: DmnEditorRoot;
Review Comment:
I think I do not have answer that you would like to hear. This was the only way I was able to access introduced `openBoxedExpressionEditor` from the `NewDmnEditorInterface`. My understanding is we need to have both:
- `DmnEditorFactory` and `NewDmnEditorFactory`
- `DmnEditorInterface` and `NewDmnEditorInterface`
to capture the fact, that new editor does support opening boxed expressions while the old one does not (from communication between packages point of view).
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#issuecomment-2604611099
@tiagobento thank you, your points are incorporated now.
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1923769816
##########
packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx:
##########
@@ -163,6 +166,10 @@ 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]);
Review Comment:
This line doesn't do much.. it tries to memoize a value based on itself, so you can use `props.dmnEditor` directly.
##########
packages/online-editor/src/dmnRunner/DmnRunnerContext.tsx:
##########
@@ -41,6 +42,8 @@ export interface DmnRunnerContextType {
results: Array<DecisionResult[] | undefined>;
resultsDifference: Array<Array<object>>;
status: DmnRunnerStatus;
+ dmnEditor: EmbeddedEditorRef | undefined;
+ isLegacyDmnEditor: boolean;
Review Comment:
I still don't understand why we need this `isLegacyDmnEditor` property. You can remove it and use `useMemo(() => settings.editors.useLegacyDmnEditor, [settings.editors.useLegacyDmnEditor]);` everywhere you need it...
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1924828206
##########
packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx:
##########
@@ -163,6 +166,10 @@ 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]);
Review Comment:
done
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento merged PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#1595: Sandbox: Add "Open in Boxed Expression Editor" button in the DMN Runner form output cards [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2720:
URL: https://github.com/apache/incubator-kie-tools/pull/2720#discussion_r1915074378
##########
packages/online-editor/src/dmnRunner/DmnRunnerDrawer.tsx:
##########
@@ -38,7 +41,7 @@ export function DmnRunnerDrawer(props: React.PropsWithChildren<{}>) {
}
panelContent={
<DmnRunnerErrorBoundary>
- <DmnRunnerDrawerPanelContent />
+ <DmnRunnerDrawerPanelContent {...props} />
Review Comment:
This can be potentially dangerous... try and find some resources about this :)
##########
packages/form-dmn/src/FormDmnOutputs.tsx:
##########
@@ -258,7 +262,18 @@ export function FormDmnOutputs({ openExecutionTab, ...props }: FormDmnOutputsPro
onAnimationEnd={(e) => onAnimationEnd(e, index)}
>
<CardTitle>
- <Title headingLevel={"h2"}>{dmnFormResult.decisionName}</Title>
+ <Flex justifyContent={{ default: "justifyContentSpaceBetween" }}>
+ <Title headingLevel={"h2"}>{dmnFormResult.decisionName}</Title>
+ {props.openBoxedExpressionEditor !== undefined && (
+ <Button
+ variant={"plain"}
+ title={`Open ${dmnFormResult.decisionName} expression`}
+ icon={<ArrowUpIcon />}
+ data-navigate-to-expression-id={dmnFormResult.decisionId}
+ onClick={() => props.openBoxedExpressionEditor?.(dmnFormResult.decisionId)}
+ />
+ )}
+ </Flex>
Review Comment:
Warnings from ESLint on this hook call.
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -42,7 +42,7 @@ export class DmnEditorFactory implements EditorFactory<Editor, KogitoEditorChann
}
export class DmnEditorInterface implements Editor {
- private self: DmnEditorRoot;
+ protected self: DmnEditorRoot;
Review Comment:
Why?
--
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: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org