@finos/legend-application-studio 27.1.1 → 27.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/__lib__/LegendStudioDocumentation.d.ts +3 -1
- package/lib/__lib__/LegendStudioDocumentation.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioDocumentation.js +3 -0
- package/lib/__lib__/LegendStudioDocumentation.js.map +1 -1
- package/lib/__lib__/LegendStudioTesting.d.ts +1 -0
- package/lib/__lib__/LegendStudioTesting.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTesting.js +1 -0
- package/lib/__lib__/LegendStudioTesting.js.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +1 -1
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.js +29 -25
- package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/{DatabaseBuilder.d.ts → DatabaseBuilderWizard.d.ts} +4 -11
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +48 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts +32 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts.map +1 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js +99 -0
- package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js.map +1 -0
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +2 -2
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +47 -12
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +61 -11
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +24 -25
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js +3 -3
- package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +0 -7
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +20 -77
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +3 -3
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js +7 -1
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.js +6 -1
- package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +3 -3
- package/lib/stores/editor/ExplorerTreeState.d.ts +4 -4
- package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.js +4 -4
- package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +12 -12
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +46 -47
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +20 -29
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +60 -141
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts +33 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js +71 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +6 -2
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +39 -3
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +3 -48
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -1
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +12 -350
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +5 -0
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +26 -0
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.js +2 -2
- package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
- package/package.json +10 -10
- package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -1
- package/src/__lib__/LegendStudioDocumentation.ts +4 -0
- package/src/__lib__/LegendStudioTesting.ts +1 -0
- package/src/application/LegendStudioApplicationConfig.ts +1 -1
- package/src/components/editor/editor-group/FunctionEditor.tsx +137 -122
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +191 -0
- package/src/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.tsx +227 -0
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +5 -2
- package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +68 -17
- package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +137 -12
- package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +0 -1
- package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +354 -362
- package/src/components/editor/editor-group/uml-editor/EnumerationEditor.tsx +4 -4
- package/src/components/editor/editor-group/uml-editor/ProfileEditor.tsx +7 -7
- package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +4 -4
- package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +4 -4
- package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +47 -211
- package/src/components/editor/side-bar/Explorer.tsx +3 -3
- package/src/components/editor/side-bar/ProjectOverview.tsx +14 -3
- package/src/components/editor/side-bar/WorkflowManager.tsx +10 -0
- package/src/stores/editor/ExplorerTreeState.ts +6 -9
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +45 -51
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +88 -212
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.ts +102 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +2 -2
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -1
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +59 -2
- package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +13 -533
- package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +47 -0
- package/src/stores/editor/utils/TestableUtils.ts +2 -2
- package/tsconfig.json +3 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +0 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +0 -133
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +0 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +0 -397
@@ -42,7 +42,7 @@ import {
|
|
42
42
|
LockIcon,
|
43
43
|
FireIcon,
|
44
44
|
StickArrowCircleRightIcon,
|
45
|
-
|
45
|
+
PanelEntryDragHandle,
|
46
46
|
DragPreviewLayer,
|
47
47
|
useDragPreviewLayer,
|
48
48
|
PanelDropZone,
|
@@ -165,9 +165,9 @@ const EnumBasicEditor = observer(
|
|
165
165
|
placeholder={<div className="dnd__placeholder--light"></div>}
|
166
166
|
className="enum-basic-editor__container"
|
167
167
|
>
|
168
|
-
<
|
169
|
-
|
170
|
-
|
168
|
+
<PanelEntryDragHandle
|
169
|
+
dragSourceConnector={handleRef}
|
170
|
+
isDragging={isBeingDragged}
|
171
171
|
/>
|
172
172
|
|
173
173
|
<div className="enum-basic-editor">
|
@@ -26,7 +26,7 @@ import {
|
|
26
26
|
PlusIcon,
|
27
27
|
TimesIcon,
|
28
28
|
LockIcon,
|
29
|
-
|
29
|
+
PanelEntryDragHandle,
|
30
30
|
DragPreviewLayer,
|
31
31
|
useDragPreviewLayer,
|
32
32
|
Panel,
|
@@ -126,9 +126,9 @@ const TagBasicEditor = observer(
|
|
126
126
|
placeholder={<div className="dnd__placeholder--light"></div>}
|
127
127
|
showPlaceholder={isBeingDragged}
|
128
128
|
>
|
129
|
-
<
|
130
|
-
|
131
|
-
|
129
|
+
<PanelEntryDragHandle
|
130
|
+
dragSourceConnector={handleRef}
|
131
|
+
isDragging={isBeingDragged}
|
132
132
|
/>
|
133
133
|
<div className="tag-basic-editor">
|
134
134
|
<InputWithInlineValidation
|
@@ -229,9 +229,9 @@ const StereotypeBasicEditor = observer(
|
|
229
229
|
className="stereotype-basic-editor__container"
|
230
230
|
showPlaceholder={isBeingDragged}
|
231
231
|
>
|
232
|
-
<
|
233
|
-
|
234
|
-
|
232
|
+
<PanelEntryDragHandle
|
233
|
+
dragSourceConnector={handleRef}
|
234
|
+
isDragging={isBeingDragged}
|
235
235
|
/>
|
236
236
|
<div className="stereotype-basic-editor">
|
237
237
|
<InputWithInlineValidation
|
@@ -21,7 +21,7 @@ import {
|
|
21
21
|
createFilter,
|
22
22
|
TimesIcon,
|
23
23
|
ArrowCircleRightIcon,
|
24
|
-
|
24
|
+
PanelEntryDragHandle,
|
25
25
|
PanelDnDEntry,
|
26
26
|
DragPreviewLayer,
|
27
27
|
useDragPreviewLayer,
|
@@ -179,9 +179,9 @@ export const StereotypeSelector = observer(
|
|
179
179
|
placeholder={<div className="dnd__placeholder--light"></div>}
|
180
180
|
showPlaceholder={isBeingDragged}
|
181
181
|
>
|
182
|
-
<
|
183
|
-
|
184
|
-
|
182
|
+
<PanelEntryDragHandle
|
183
|
+
dragSourceConnector={handleRef}
|
184
|
+
isDragging={isBeingDragged}
|
185
185
|
/>
|
186
186
|
<div
|
187
187
|
className={clsx('stereotype-selector', {
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
TimesIcon,
|
25
25
|
ArrowCircleRightIcon,
|
26
26
|
LongArrowAltUpIcon,
|
27
|
-
|
27
|
+
PanelEntryDragHandle,
|
28
28
|
PanelDnDEntry,
|
29
29
|
DragPreviewLayer,
|
30
30
|
useDragPreviewLayer,
|
@@ -189,9 +189,9 @@ export const TaggedValueEditor = observer(
|
|
189
189
|
showPlaceholder={isBeingDragged}
|
190
190
|
placeholder={<div className="dnd__placeholder--light"></div>}
|
191
191
|
>
|
192
|
-
<
|
193
|
-
|
194
|
-
|
192
|
+
<PanelEntryDragHandle
|
193
|
+
dragSourceConnector={handleRef}
|
194
|
+
isDragging={isBeingDragged}
|
195
195
|
/>
|
196
196
|
<div
|
197
197
|
className={clsx('tagged-value-editor', {
|
@@ -16,16 +16,9 @@
|
|
16
16
|
|
17
17
|
import { observer } from 'mobx-react-lite';
|
18
18
|
import {
|
19
|
-
type TreeNodeContainerProps,
|
20
19
|
ResizablePanelGroup,
|
21
20
|
ResizablePanel,
|
22
21
|
ResizablePanelSplitter,
|
23
|
-
TreeView,
|
24
|
-
PURE_DatabaseSchemaIcon,
|
25
|
-
PURE_DatabaseTableIcon,
|
26
|
-
ChevronDownIcon,
|
27
|
-
ChevronRightIcon,
|
28
|
-
KeyIcon,
|
29
22
|
CustomSelectorInput,
|
30
23
|
type SelectComponent,
|
31
24
|
createFilter,
|
@@ -37,9 +30,6 @@ import {
|
|
37
30
|
PanelLoadingIndicator,
|
38
31
|
BlankPanelContent,
|
39
32
|
TrashIcon,
|
40
|
-
CircleIcon,
|
41
|
-
CheckCircleIcon,
|
42
|
-
EmptyCircleIcon,
|
43
33
|
PURE_DatabaseIcon,
|
44
34
|
SyncIcon,
|
45
35
|
} from '@finos/legend-art';
|
@@ -65,18 +55,9 @@ import {
|
|
65
55
|
PackageableConnection,
|
66
56
|
RelationalDatabaseConnection,
|
67
57
|
guaranteeRelationalDatabaseConnection,
|
68
|
-
stringifyDataType,
|
69
58
|
} from '@finos/legend-graph';
|
70
59
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
71
|
-
import {
|
72
|
-
DatabaseSchemaExplorerTreeColumnNodeData,
|
73
|
-
DatabaseSchemaExplorerTreeSchemaNodeData,
|
74
|
-
DatabaseSchemaExplorerTreeTableNodeData,
|
75
|
-
type DatabaseSchemaExplorerTreeData,
|
76
|
-
type DatabaseSchemaExplorerTreeNodeData,
|
77
|
-
type SQLPlaygroundPanelState,
|
78
|
-
} from '../../../stores/editor/panel-group/SQLPlaygroundPanelState.js';
|
79
|
-
import { renderColumnTypeIcon } from '../editor-group/connection-editor/DatabaseEditorHelper.js';
|
60
|
+
import { type SQLPlaygroundPanelState } from '../../../stores/editor/panel-group/SQLPlaygroundPanelState.js';
|
80
61
|
import { useEditorStore } from '../EditorStoreProvider.js';
|
81
62
|
import { PANEL_MODE } from '../../../stores/editor/EditorConfig.js';
|
82
63
|
import { useDrag, useDrop } from 'react-dnd';
|
@@ -94,191 +75,35 @@ import {
|
|
94
75
|
parseCSVString,
|
95
76
|
uniqBy,
|
96
77
|
} from '@finos/legend-shared';
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
<div className="sql-playground__database-schema-explorer-tree__icon--schema">
|
104
|
-
<PURE_DatabaseSchemaIcon />
|
105
|
-
</div>
|
106
|
-
);
|
107
|
-
} else if (node instanceof DatabaseSchemaExplorerTreeTableNodeData) {
|
108
|
-
return (
|
109
|
-
<div className="sql-playground__database-schema-explorer-tree__icon--table">
|
110
|
-
<PURE_DatabaseTableIcon />
|
111
|
-
</div>
|
112
|
-
);
|
113
|
-
} else if (node instanceof DatabaseSchemaExplorerTreeColumnNodeData) {
|
114
|
-
return renderColumnTypeIcon(node.column.type);
|
115
|
-
}
|
116
|
-
return null;
|
117
|
-
};
|
78
|
+
import {
|
79
|
+
DatabaseSchemaExplorer,
|
80
|
+
DatabaseSchemaExplorerTreeNodeContainer,
|
81
|
+
type DatabaseSchemaExplorerTreeNodeContainerProps,
|
82
|
+
} from '../editor-group/connection-editor/DatabaseSchemaExplorer.js';
|
83
|
+
import { DatabaseSchemaExplorerTreeTableNodeData } from '../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js';
|
118
84
|
|
119
85
|
const DATABASE_NODE_DND_TYPE = 'DATABASE_NODE_DND_TYPE';
|
120
86
|
type DatabaseNodeDragType = { text: string };
|
121
87
|
|
122
|
-
const
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
const nodeExpandIcon = isExpandable ? (
|
139
|
-
node.isOpen ? (
|
140
|
-
<ChevronDownIcon />
|
141
|
-
) : (
|
142
|
-
<ChevronRightIcon />
|
143
|
-
)
|
144
|
-
) : (
|
145
|
-
<div />
|
146
|
-
);
|
147
|
-
const [, nodeDragRef] = useDrag<DatabaseNodeDragType>(
|
148
|
-
() => ({
|
149
|
-
type: DATABASE_NODE_DND_TYPE,
|
150
|
-
item: {
|
151
|
-
text:
|
152
|
-
node instanceof DatabaseSchemaExplorerTreeTableNodeData
|
153
|
-
? `${node.owner.name}.${node.label}`
|
154
|
-
: node.label,
|
155
|
-
},
|
156
|
-
}),
|
157
|
-
[node],
|
158
|
-
);
|
159
|
-
const nodeTypeIcon = getDatabaseSchemaNodeIcon(node);
|
160
|
-
const toggleExpandNode = (): void => onNodeSelect?.(node);
|
161
|
-
const isPrimaryKeyColumn =
|
162
|
-
node instanceof DatabaseSchemaExplorerTreeColumnNodeData &&
|
163
|
-
node.owner.primaryKey.includes(node.column);
|
164
|
-
|
165
|
-
const renderCheckedIcon = (
|
166
|
-
_node: DatabaseSchemaExplorerTreeNodeData,
|
167
|
-
): React.ReactNode => {
|
168
|
-
if (_node instanceof DatabaseSchemaExplorerTreeColumnNodeData) {
|
169
|
-
return null;
|
170
|
-
} else if (isPartiallySelected(_node)) {
|
171
|
-
return <CircleIcon />;
|
172
|
-
} else if (_node.isChecked) {
|
173
|
-
return <CheckCircleIcon />;
|
174
|
-
}
|
175
|
-
return <EmptyCircleIcon />;
|
176
|
-
};
|
177
|
-
|
178
|
-
return (
|
179
|
-
<div
|
180
|
-
className="tree-view__node__container"
|
181
|
-
style={{
|
182
|
-
paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
|
183
|
-
display: 'flex',
|
184
|
-
}}
|
185
|
-
ref={nodeDragRef}
|
186
|
-
onClick={toggleExpandNode}
|
187
|
-
>
|
188
|
-
<div className="tree-view__node__icon sql-playground__database-schema-explorer-tree__node__icon__group">
|
189
|
-
<div className="sql-playground__database-schema-explorer-tree__expand-icon">
|
190
|
-
{nodeExpandIcon}
|
191
|
-
</div>
|
192
|
-
<div
|
193
|
-
className="sql-playground__database-schema-explorer-tree__toggle-icon"
|
194
|
-
onClick={(event) => {
|
195
|
-
event.stopPropagation();
|
196
|
-
toggleCheckedNode(node);
|
197
|
-
}}
|
198
|
-
>
|
199
|
-
{renderCheckedIcon(node)}
|
200
|
-
</div>
|
201
|
-
<div className="sql-playground__database-schema-explorer-tree__type-icon">
|
202
|
-
{nodeTypeIcon}
|
203
|
-
</div>
|
204
|
-
</div>
|
205
|
-
<div className="tree-view__node__label sql-playground__database-schema-explorer-tree__node__label">
|
206
|
-
{node.label}
|
207
|
-
{node instanceof DatabaseSchemaExplorerTreeColumnNodeData && (
|
208
|
-
<div className="sql-playground__database-schema-explorer-tree__node__type">
|
209
|
-
<div className="sql-playground__database-schema-explorer-tree__node__type__label">
|
210
|
-
{stringifyDataType(node.column.type)}
|
211
|
-
</div>
|
212
|
-
</div>
|
213
|
-
)}
|
214
|
-
{isPrimaryKeyColumn && (
|
215
|
-
<div
|
216
|
-
className="sql-playground__database-schema-explorer-tree__node__pk"
|
217
|
-
title="Primary Key"
|
218
|
-
>
|
219
|
-
<KeyIcon />
|
220
|
-
</div>
|
221
|
-
)}
|
222
|
-
</div>
|
223
|
-
</div>
|
224
|
-
);
|
225
|
-
};
|
226
|
-
|
227
|
-
export const DatabaseSchemaExplorer = observer(
|
228
|
-
(props: {
|
229
|
-
treeData: DatabaseSchemaExplorerTreeData;
|
230
|
-
playgroundState: SQLPlaygroundPanelState;
|
231
|
-
}) => {
|
232
|
-
const { treeData, playgroundState } = props;
|
233
|
-
const applicationStore = useApplicationStore();
|
234
|
-
|
235
|
-
const onNodeSelect = (node: DatabaseSchemaExplorerTreeNodeData): void => {
|
236
|
-
flowResult(playgroundState.onNodeSelect(node, treeData)).catch(
|
237
|
-
applicationStore.alertUnhandledError,
|
238
|
-
);
|
239
|
-
};
|
240
|
-
|
241
|
-
const getChildNodes = (
|
242
|
-
node: DatabaseSchemaExplorerTreeNodeData,
|
243
|
-
): DatabaseSchemaExplorerTreeNodeData[] =>
|
244
|
-
playgroundState
|
245
|
-
.getChildNodes(node, treeData)
|
246
|
-
?.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
|
247
|
-
|
248
|
-
const isPartiallySelected = (
|
249
|
-
node: DatabaseSchemaExplorerTreeNodeData,
|
250
|
-
): boolean => {
|
251
|
-
if (
|
252
|
-
node instanceof DatabaseSchemaExplorerTreeSchemaNodeData &&
|
253
|
-
!node.isChecked
|
254
|
-
) {
|
255
|
-
return Boolean(
|
256
|
-
playgroundState
|
257
|
-
.getChildNodes(node, treeData)
|
258
|
-
?.find((childNode) => childNode.isChecked === true),
|
259
|
-
);
|
260
|
-
}
|
261
|
-
return false;
|
262
|
-
};
|
263
|
-
|
264
|
-
const toggleCheckedNode = (
|
265
|
-
node: DatabaseSchemaExplorerTreeNodeData,
|
266
|
-
): void => playgroundState.toggleCheckedNode(node, treeData);
|
88
|
+
const SQLPlaygroundDatabaseSchemaExplorerTreeNodeContainer = observer(
|
89
|
+
(props: DatabaseSchemaExplorerTreeNodeContainerProps) => {
|
90
|
+
const { node } = props;
|
91
|
+
|
92
|
+
const [, nodeDragRef] = useDrag<DatabaseNodeDragType>(
|
93
|
+
() => ({
|
94
|
+
type: DATABASE_NODE_DND_TYPE,
|
95
|
+
item: {
|
96
|
+
text:
|
97
|
+
node instanceof DatabaseSchemaExplorerTreeTableNodeData
|
98
|
+
? `${node.owner.name}.${node.label}`
|
99
|
+
: node.label,
|
100
|
+
},
|
101
|
+
}),
|
102
|
+
[node],
|
103
|
+
);
|
267
104
|
|
268
105
|
return (
|
269
|
-
<
|
270
|
-
className="sql-playground__database-schema-explorer-tree"
|
271
|
-
components={{
|
272
|
-
TreeNodeContainer: DatabaseSchemaExplorerTreeNodeContainer,
|
273
|
-
}}
|
274
|
-
innerProps={{
|
275
|
-
toggleCheckedNode,
|
276
|
-
isPartiallySelected,
|
277
|
-
}}
|
278
|
-
treeData={treeData}
|
279
|
-
onNodeSelect={onNodeSelect}
|
280
|
-
getChildNodes={getChildNodes}
|
281
|
-
/>
|
106
|
+
<DatabaseSchemaExplorerTreeNodeContainer {...props} ref={nodeDragRef} />
|
282
107
|
);
|
283
108
|
},
|
284
109
|
);
|
@@ -369,9 +194,11 @@ const getDatabaseSchemaEntities = async (
|
|
369
194
|
model: monacoEditorAPI.ITextModel,
|
370
195
|
playgroundState: SQLPlaygroundPanelState,
|
371
196
|
): Promise<monacoLanguagesAPI.CompletionItem[]> => {
|
372
|
-
if (playgroundState.treeData) {
|
197
|
+
if (playgroundState.schemaExplorerState?.treeData) {
|
373
198
|
return uniqBy(
|
374
|
-
Array.from(
|
199
|
+
Array.from(
|
200
|
+
playgroundState.schemaExplorerState.treeData.nodes.values(),
|
201
|
+
).map(
|
375
202
|
(value) =>
|
376
203
|
({
|
377
204
|
label: value.label,
|
@@ -700,15 +527,21 @@ export const SQLPlaygroundPanel = observer(() => {
|
|
700
527
|
[handleConnectionDrop],
|
701
528
|
);
|
702
529
|
|
703
|
-
const updateDatabase =
|
704
|
-
|
705
|
-
|
530
|
+
const updateDatabase = (): void => {
|
531
|
+
if (playgroundState.schemaExplorerState) {
|
532
|
+
flowResult(playgroundState.schemaExplorerState.updateDatabase()).catch(
|
533
|
+
applicationStore.alertUnhandledError,
|
534
|
+
);
|
535
|
+
}
|
536
|
+
};
|
706
537
|
|
707
538
|
useEffect(() => {
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
539
|
+
if (playgroundState.schemaExplorerState) {
|
540
|
+
flowResult(
|
541
|
+
playgroundState.schemaExplorerState.fetchDatabaseMetadata(),
|
542
|
+
).catch(applicationStore.alertUnhandledError);
|
543
|
+
}
|
544
|
+
}, [playgroundState, applicationStore, playgroundState.schemaExplorerState]);
|
712
545
|
|
713
546
|
useConditionedApplicationNavigationContext(
|
714
547
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SQL_PLAYGROUND,
|
@@ -770,10 +603,13 @@ export const SQLPlaygroundPanel = observer(() => {
|
|
770
603
|
</div>
|
771
604
|
</div>
|
772
605
|
<div className="sql-playground__config__schema-explorer">
|
773
|
-
{playgroundState.treeData && (
|
606
|
+
{playgroundState.schemaExplorerState?.treeData && (
|
774
607
|
<DatabaseSchemaExplorer
|
775
|
-
treeData={playgroundState.treeData}
|
776
|
-
|
608
|
+
treeData={playgroundState.schemaExplorerState.treeData}
|
609
|
+
schemaExplorerState={playgroundState.schemaExplorerState}
|
610
|
+
treeNodeContainerComponent={
|
611
|
+
SQLPlaygroundDatabaseSchemaExplorerTreeNodeContainer
|
612
|
+
}
|
777
613
|
/>
|
778
614
|
)}
|
779
615
|
</div>
|
@@ -133,7 +133,7 @@ import {
|
|
133
133
|
CODE_EDITOR_LANGUAGE,
|
134
134
|
CodeEditor,
|
135
135
|
} from '@finos/legend-lego/code-editor';
|
136
|
-
import {
|
136
|
+
import { DatabaseBuilderWizard } from '../editor-group/connection-editor/DatabaseBuilderWizard.js';
|
137
137
|
import { FunctionEditorState } from '../../../stores/editor/editor-state/element-editor-state/FunctionEditorState.js';
|
138
138
|
|
139
139
|
const ElementRenamer = observer(() => {
|
@@ -516,7 +516,7 @@ const ExplorerContextMenu = observer(
|
|
516
516
|
const buildDatabase = editorStore.applicationStore.guardUnhandledError(
|
517
517
|
async () => {
|
518
518
|
if (isRelationalDatabaseConnection(node?.packageableElement)) {
|
519
|
-
editorStore.explorerTreeState.
|
519
|
+
editorStore.explorerTreeState.buildDatabase(
|
520
520
|
guaranteeRelationalDatabaseConnection(node?.packageableElement),
|
521
521
|
editorStore.isInViewerMode,
|
522
522
|
);
|
@@ -1128,7 +1128,7 @@ const ExplorerTrees = observer(() => {
|
|
1128
1128
|
<ElementRenamer />
|
1129
1129
|
<SampleDataGenerator />
|
1130
1130
|
{editorStore.explorerTreeState.databaseBuilderState && (
|
1131
|
-
<
|
1131
|
+
<DatabaseBuilderWizard
|
1132
1132
|
databaseBuilderState={
|
1133
1133
|
editorStore.explorerTreeState.databaseBuilderState
|
1134
1134
|
}
|
@@ -801,6 +801,8 @@ interface ProjectOverviewActivityDisplay {
|
|
801
801
|
export const ProjectOverviewActivityBar = observer(() => {
|
802
802
|
const editorStore = useEditorStore();
|
803
803
|
const projectOverviewState = editorStore.projectOverviewState;
|
804
|
+
const isInEmbeddedMode =
|
805
|
+
editorStore.projectConfigurationEditorState.isInEmbeddedMode;
|
804
806
|
const changeActivity =
|
805
807
|
(activity: PROJECT_OVERVIEW_ACTIVITY_MODE): (() => void) =>
|
806
808
|
(): void =>
|
@@ -813,9 +815,18 @@ export const ProjectOverviewActivityBar = observer(() => {
|
|
813
815
|
},
|
814
816
|
{ mode: PROJECT_OVERVIEW_ACTIVITY_MODE.VERSIONS, title: 'Versions' },
|
815
817
|
{ mode: PROJECT_OVERVIEW_ACTIVITY_MODE.WORKSPACES, title: 'Workspaces' },
|
816
|
-
]
|
817
|
-
|
818
|
-
|
818
|
+
]
|
819
|
+
.filter((activity): activity is ProjectOverviewActivityDisplay =>
|
820
|
+
Boolean(activity),
|
821
|
+
)
|
822
|
+
.filter(
|
823
|
+
(act) =>
|
824
|
+
// releasing not supported in embedded mode
|
825
|
+
!(
|
826
|
+
act.mode === PROJECT_OVERVIEW_ACTIVITY_MODE.RELEASE &&
|
827
|
+
isInEmbeddedMode
|
828
|
+
),
|
829
|
+
);
|
819
830
|
|
820
831
|
return (
|
821
832
|
<div
|
@@ -275,6 +275,11 @@ const WorkflowExplorerContextMenu = observer(
|
|
275
275
|
workflowState.cancelJob(node.workflowJob, treeData);
|
276
276
|
}
|
277
277
|
};
|
278
|
+
const runManualJob = (): void => {
|
279
|
+
if (node instanceof WorkflowJobTreeNodeData) {
|
280
|
+
workflowState.runManualJob(node.workflowJob, treeData);
|
281
|
+
}
|
282
|
+
};
|
278
283
|
const viewLogs = (): void => {
|
279
284
|
if (node instanceof WorkflowJobTreeNodeData) {
|
280
285
|
workflowManagerState.logState.viewJobLogs(node.workflowJob);
|
@@ -304,6 +309,11 @@ const WorkflowExplorerContextMenu = observer(
|
|
304
309
|
{node.workflowJob.status === WorkflowJobStatus.IN_PROGRESS && (
|
305
310
|
<MenuContentItem onClick={cancelJob}>Cancel Job</MenuContentItem>
|
306
311
|
)}
|
312
|
+
{node.workflowJob.status === WorkflowJobStatus.WAITING_MANUAL && (
|
313
|
+
<MenuContentItem onClick={runManualJob}>
|
314
|
+
Run Manual Job
|
315
|
+
</MenuContentItem>
|
316
|
+
)}
|
307
317
|
</>
|
308
318
|
)}
|
309
319
|
{node instanceof WorkflowTreeNodeData && (
|
@@ -51,7 +51,7 @@ import {
|
|
51
51
|
type RelationalDatabaseConnection,
|
52
52
|
} from '@finos/legend-graph';
|
53
53
|
import { APPLICATION_EVENT } from '@finos/legend-application';
|
54
|
-
import {
|
54
|
+
import { DatabaseBuilderWizardState } from './editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js';
|
55
55
|
|
56
56
|
export enum ExplorerTreeRootPackageLabel {
|
57
57
|
FILE_GENERATION = 'generated-files',
|
@@ -75,7 +75,7 @@ export class ExplorerTreeState {
|
|
75
75
|
|
76
76
|
elementToRename?: PackageableElement | undefined;
|
77
77
|
classToGenerateSampleData?: Class | undefined;
|
78
|
-
databaseBuilderState:
|
78
|
+
databaseBuilderState: DatabaseBuilderWizardState | undefined;
|
79
79
|
|
80
80
|
constructor(editorStore: EditorStore) {
|
81
81
|
makeObservable(this, {
|
@@ -103,7 +103,7 @@ export class ExplorerTreeState {
|
|
103
103
|
buildTreeInTextMode: action,
|
104
104
|
openExplorerTreeNodes: action,
|
105
105
|
reprocess: action,
|
106
|
-
|
106
|
+
buildDatabase: action,
|
107
107
|
setDatabaseBuilderState: action,
|
108
108
|
onTreeNodeSelect: action,
|
109
109
|
openNode: action,
|
@@ -176,14 +176,11 @@ export class ExplorerTreeState {
|
|
176
176
|
this.classToGenerateSampleData = val;
|
177
177
|
}
|
178
178
|
|
179
|
-
setDatabaseBuilderState(val:
|
179
|
+
setDatabaseBuilderState(val: DatabaseBuilderWizardState | undefined): void {
|
180
180
|
this.databaseBuilderState = val;
|
181
181
|
}
|
182
|
-
|
183
|
-
|
184
|
-
isReadOnly: boolean,
|
185
|
-
): void {
|
186
|
-
const dbBuilderState = new DatabaseBuilderState(
|
182
|
+
buildDatabase(val: RelationalDatabaseConnection, isReadOnly: boolean): void {
|
183
|
+
const dbBuilderState = new DatabaseBuilderWizardState(
|
187
184
|
this.editorStore,
|
188
185
|
val,
|
189
186
|
isReadOnly,
|