-
Notifications
You must be signed in to change notification settings - Fork 74
[BI Data Mapper] Add support for the join clause #969
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
Changes from 20 commits
8a57d5d
e0ab1c9
91e06a1
7d6492d
15f0c9e
5391f85
1c77867
6ae1e87
1e00af8
91a02ba
f365913
b1f92db
2d5c990
aef51f4
75b1275
fc3a180
22a322c
7f337ff
0f3b842
5949afc
75d4c7b
d972369
f6a978a
420e998
880cbd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -467,7 +467,8 @@ export function expandDMModel( | |||||||||
| query: model.query, | ||||||||||
| source: "", | ||||||||||
| rootViewId, | ||||||||||
| triggerRefresh: model.triggerRefresh | ||||||||||
| triggerRefresh: model.triggerRefresh, | ||||||||||
| focusInputRootMap: model.focusInputRootMap | ||||||||||
| }; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
@@ -485,13 +486,18 @@ function processInputRoots(model: DMModel): IOType[] { | |||||||||
| inputs.push(input); | ||||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| model.focusInputRootMap = {}; | ||||||||||
|
||||||||||
| model.focusInputRootMap = {}; | |
| if (!model.focusInputRootMap) { | |
| model.focusInputRootMap = {}; | |
| } |
Copilot
AI
Nov 20, 2025
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.
The condition checks if (model.traversingRoot) but traversingRoot could be an empty string, which would be falsy. If an empty string is a valid value, use a more explicit check:
if (model.traversingRoot !== undefined && model.traversingRoot !== null) {
model.focusInputRootMap[parentId] = model.traversingRoot;
}| if (model.traversingRoot){ | |
| if (model.traversingRoot !== undefined && model.traversingRoot !== null){ |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ import React from "react"; | |||||||||
| import { EditorContainer } from "./styles"; | ||||||||||
| import { Divider, Dropdown, OptionProps, Typography } from "@wso2/ui-toolkit"; | ||||||||||
| import { DMFormProps, DMFormField, DMFormFieldValues, IntermediateClauseType, IntermediateClause, IntermediateClauseProps } from "@wso2/ballerina-core"; | ||||||||||
| import { useDMQueryClausesPanelStore } from "../../../../store/store"; | ||||||||||
|
|
||||||||||
| export interface ClauseEditorProps { | ||||||||||
| clause?: IntermediateClause; | ||||||||||
|
|
@@ -32,24 +33,26 @@ export interface ClauseEditorProps { | |||||||||
|
|
||||||||||
| export function ClauseEditor(props: ClauseEditorProps) { | ||||||||||
| const { clause, onSubmitText, isSaving, onSubmit, onCancel, generateForm } = props; | ||||||||||
| const { type: _clauseType, properties: clauseProps } = clause ?? {}; | ||||||||||
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore.getState(); | ||||||||||
|
||||||||||
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore.getState(); | |
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore(); |
Copilot
AI
Nov 20, 2025
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.
The setClauseToAdd function is retrieved from getState() instead of the hook, which means it won't have the proper reactive context. This should be moved to use the hook pattern for consistency with line 35.
const { clauseToAdd } = useDMQueryClausesPanelStore();
const setClauseToAdd = useDMQueryClausesPanelStore(state => state.setClauseToAdd);| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore.getState(); | |
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore(); |
Outdated
Copilot
AI
Nov 20, 2025
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.
Missing article "the" before "variable". Should be "Enter the name for the variable".
| documentation: clauseType === IntermediateClauseType.JOIN ? "Represents each record in the joined collection" : "Enter the name for variable", | |
| documentation: clauseType === IntermediateClauseType.JOIN ? "Represents each record in the joined collection" : "Enter the name for the variable", |
madushajg marked this conversation as resolved.
Show resolved
Hide resolved
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |||||
| * under the License. | ||||||
| */ | ||||||
|
|
||||||
| import React from "react"; | ||||||
| import React, { useEffect } from "react"; | ||||||
|
|
||||||
| import { Button, Codicon, SidePanel, SidePanelBody, SidePanelTitleContainer, ThemeColors } from "@wso2/ui-toolkit"; | ||||||
| import { useDMQueryClausesPanelStore } from "../../../../store/store"; | ||||||
|
|
@@ -35,6 +35,7 @@ export interface ClausesPanelProps { | |||||
|
|
||||||
| export function ClausesPanel(props: ClausesPanelProps) { | ||||||
| const { isQueryClausesPanelOpen, setIsQueryClausesPanelOpen } = useDMQueryClausesPanelStore(); | ||||||
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore.getState(); | ||||||
|
||||||
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore.getState(); | |
| const { clauseToAdd, setClauseToAdd } = useDMQueryClausesPanelStore(); |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,8 +22,8 @@ import { DiagramEngine } from '@projectstorm/react-diagrams'; | |||||||
|
|
||||||||
| import { ExpressionLabelModel } from './ExpressionLabelModel'; | ||||||||
| import { ExpressionLabelWidget } from './ExpressionLabelWidget'; | ||||||||
| import { QueryExprLabelWidget } from './QueryExprLabelWidget'; | ||||||||
| import { MappingOptionsWidget } from './MappingOptionsWidget'; | ||||||||
| import { MappingType } from '../Link'; | ||||||||
|
|
||||||||
| export class ExpressionLabelFactory extends AbstractReactFactory<ExpressionLabelModel, DiagramEngine> { | ||||||||
| constructor() { | ||||||||
|
|
@@ -35,10 +35,10 @@ export class ExpressionLabelFactory extends AbstractReactFactory<ExpressionLabel | |||||||
| } | ||||||||
|
|
||||||||
| generateReactWidget(event: GenerateWidgetEvent<ExpressionLabelModel>): JSX.Element { | ||||||||
| if (event.model.isQuery) { | ||||||||
| return <QueryExprLabelWidget model={event.model} />; | ||||||||
| } | ||||||||
| if (event.model.link?.pendingMappingType) { | ||||||||
| if(event.model.link.pendingMappingType === MappingType.ArrayJoin) { | ||||||||
| return <></>; | ||||||||
|
||||||||
| return <></>; | |
| // JOIN clause mappings don't require a label as they use ClauseConnectorNode | |
| return null; |
Uh oh!
There was an error while loading. Please reload this page.