@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.
Files changed (145) hide show
  1. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +1 -1
  2. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -1
  4. package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
  5. package/lib/__lib__/LegendStudioDocumentation.d.ts +3 -1
  6. package/lib/__lib__/LegendStudioDocumentation.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioDocumentation.js +3 -0
  8. package/lib/__lib__/LegendStudioDocumentation.js.map +1 -1
  9. package/lib/__lib__/LegendStudioTesting.d.ts +1 -0
  10. package/lib/__lib__/LegendStudioTesting.d.ts.map +1 -1
  11. package/lib/__lib__/LegendStudioTesting.js +1 -0
  12. package/lib/__lib__/LegendStudioTesting.js.map +1 -1
  13. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  14. package/lib/application/LegendStudioApplicationConfig.js +1 -1
  15. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  16. package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/FunctionEditor.js +29 -25
  18. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/connection-editor/{DatabaseBuilder.d.ts → DatabaseBuilderWizard.d.ts} +4 -11
  20. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -0
  21. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +48 -0
  22. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -0
  23. package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts +32 -0
  24. package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.d.ts.map +1 -0
  25. package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js +99 -0
  26. package/lib/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.js.map +1 -0
  27. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +1 -1
  28. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  29. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
  30. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +2 -2
  31. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  32. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  33. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +47 -12
  34. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  35. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  36. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +61 -11
  37. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  38. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
  39. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js +1 -1
  40. package/lib/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
  41. package/lib/components/editor/editor-group/uml-editor/ClassEditor.d.ts.map +1 -1
  42. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +24 -25
  43. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  44. package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js +2 -2
  45. package/lib/components/editor/editor-group/uml-editor/EnumerationEditor.js.map +1 -1
  46. package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js +3 -3
  47. package/lib/components/editor/editor-group/uml-editor/ProfileEditor.js.map +1 -1
  48. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +2 -2
  49. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
  50. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +2 -2
  51. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
  52. package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +0 -7
  53. package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -1
  54. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +20 -77
  55. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -1
  56. package/lib/components/editor/side-bar/Explorer.js +3 -3
  57. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  58. package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
  59. package/lib/components/editor/side-bar/ProjectOverview.js +7 -1
  60. package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
  61. package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
  62. package/lib/components/editor/side-bar/WorkflowManager.js +6 -1
  63. package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
  64. package/lib/index.css +2 -2
  65. package/lib/index.css.map +1 -1
  66. package/lib/package.json +3 -3
  67. package/lib/stores/editor/ExplorerTreeState.d.ts +4 -4
  68. package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
  69. package/lib/stores/editor/ExplorerTreeState.js +4 -4
  70. package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
  71. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +12 -12
  72. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  73. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +46 -47
  74. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  75. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +20 -29
  76. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
  77. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +60 -141
  78. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
  79. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts +33 -0
  80. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts.map +1 -0
  81. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js +71 -0
  82. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js.map +1 -0
  83. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js +1 -1
  84. package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -1
  85. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +1 -1
  86. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  87. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +2 -2
  88. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  89. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js +1 -1
  90. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.js.map +1 -1
  91. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
  92. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  93. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +6 -2
  94. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  95. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +39 -3
  96. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
  97. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +3 -48
  98. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -1
  99. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +12 -350
  100. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -1
  101. package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +5 -0
  102. package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
  103. package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +26 -0
  104. package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
  105. package/lib/stores/editor/utils/TestableUtils.js +2 -2
  106. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  107. package/package.json +10 -10
  108. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -1
  109. package/src/__lib__/LegendStudioDocumentation.ts +4 -0
  110. package/src/__lib__/LegendStudioTesting.ts +1 -0
  111. package/src/application/LegendStudioApplicationConfig.ts +1 -1
  112. package/src/components/editor/editor-group/FunctionEditor.tsx +137 -122
  113. package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +191 -0
  114. package/src/components/editor/editor-group/connection-editor/DatabaseSchemaExplorer.tsx +227 -0
  115. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +1 -1
  116. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +5 -2
  117. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +68 -17
  118. package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +137 -12
  119. package/src/components/editor/editor-group/project-configuration-editor/ProjectDependencyEditor.tsx +0 -1
  120. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +354 -362
  121. package/src/components/editor/editor-group/uml-editor/EnumerationEditor.tsx +4 -4
  122. package/src/components/editor/editor-group/uml-editor/ProfileEditor.tsx +7 -7
  123. package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +4 -4
  124. package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +4 -4
  125. package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +47 -211
  126. package/src/components/editor/side-bar/Explorer.tsx +3 -3
  127. package/src/components/editor/side-bar/ProjectOverview.tsx +14 -3
  128. package/src/components/editor/side-bar/WorkflowManager.tsx +10 -0
  129. package/src/stores/editor/ExplorerTreeState.ts +6 -9
  130. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +45 -51
  131. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +88 -212
  132. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.ts +102 -0
  133. package/src/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.ts +1 -1
  134. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +2 -2
  135. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingExecutionState.ts +1 -1
  136. package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -1
  137. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +59 -2
  138. package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +13 -533
  139. package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +47 -0
  140. package/src/stores/editor/utils/TestableUtils.ts +2 -2
  141. package/tsconfig.json +3 -1
  142. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +0 -1
  143. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +0 -133
  144. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +0 -1
  145. 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
- PanelDnDEntryDragHandle,
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
- <PanelDnDEntryDragHandle
169
- dropTargetConnector={handleRef}
170
- isBeingDragged={isBeingDragged}
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
- PanelDnDEntryDragHandle,
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
- <PanelDnDEntryDragHandle
130
- dropTargetConnector={handleRef}
131
- isBeingDragged={isBeingDragged}
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
- <PanelDnDEntryDragHandle
233
- dropTargetConnector={handleRef}
234
- isBeingDragged={isBeingDragged}
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
- PanelDnDEntryDragHandle,
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
- <PanelDnDEntryDragHandle
183
- dropTargetConnector={handleRef}
184
- isBeingDragged={isBeingDragged}
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
- PanelDnDEntryDragHandle,
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
- <PanelDnDEntryDragHandle
193
- dropTargetConnector={handleRef}
194
- isBeingDragged={isBeingDragged}
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
- const getDatabaseSchemaNodeIcon = (
99
- node: DatabaseSchemaExplorerTreeNodeData,
100
- ): React.ReactNode => {
101
- if (node instanceof DatabaseSchemaExplorerTreeSchemaNodeData) {
102
- return (
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 DatabaseSchemaExplorerTreeNodeContainer: React.FC<
123
- TreeNodeContainerProps<
124
- DatabaseSchemaExplorerTreeNodeData,
125
- {
126
- toggleCheckedNode: (node: DatabaseSchemaExplorerTreeNodeData) => void;
127
- isPartiallySelected: (
128
- node: DatabaseSchemaExplorerTreeNodeData,
129
- ) => boolean;
130
- }
131
- >
132
- > = (props) => {
133
- const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
134
- const { toggleCheckedNode, isPartiallySelected } = innerProps;
135
- const isExpandable =
136
- Boolean(!node.childrenIds || node.childrenIds.length) &&
137
- !(node instanceof DatabaseSchemaExplorerTreeColumnNodeData);
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
- <TreeView
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(playgroundState.treeData.nodes.values()).map(
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 = applicationStore.guardUnhandledError(() =>
704
- flowResult(playgroundState.updateDatabase()),
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
- flowResult(playgroundState.fetchDatabaseMetadata()).catch(
709
- applicationStore.alertUnhandledError,
710
- );
711
- }, [playgroundState, applicationStore, playgroundState.connection]);
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
- playgroundState={playgroundState}
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 { DatabaseBuilder } from '../editor-group/connection-editor/DatabaseBuilder.js';
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.buildDbBuilderState(
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
- <DatabaseBuilder
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
- ].filter((activity): activity is ProjectOverviewActivityDisplay =>
817
- Boolean(activity),
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 { DatabaseBuilderState } from './editor-state/element-editor-state/connection/DatabaseBuilderState.js';
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: DatabaseBuilderState | undefined;
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
- buildDbBuilderState: action,
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: DatabaseBuilderState | undefined): void {
179
+ setDatabaseBuilderState(val: DatabaseBuilderWizardState | undefined): void {
180
180
  this.databaseBuilderState = val;
181
181
  }
182
- buildDbBuilderState(
183
- val: RelationalDatabaseConnection,
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,