@finos/legend-application-studio 26.1.1 → 26.1.2
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 +2 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts +21 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts.map +1 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js +28 -0
- package/lib/__lib__/STO_Relational_LegendStudioCommand.js.map +1 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts +5 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +6 -0
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/ElementIconUtils.d.ts +13 -2
- package/lib/components/ElementIconUtils.d.ts.map +1 -1
- package/lib/components/ElementIconUtils.js +15 -6
- package/lib/components/ElementIconUtils.js.map +1 -1
- package/lib/components/editor/Editor.d.ts.map +1 -1
- package/lib/components/editor/Editor.js +2 -1
- package/lib/components/editor/Editor.js.map +1 -1
- package/lib/components/editor/QuickInput.d.ts +19 -0
- package/lib/components/editor/QuickInput.d.ts.map +1 -0
- package/lib/components/editor/QuickInput.js +51 -0
- package/lib/components/editor/QuickInput.js.map +1 -0
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +5 -1
- package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js +3 -3
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
- package/lib/components/editor/editor-group/EditorGroup.js +11 -4
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/FunctionEditor.js +30 -8
- package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js +1 -1
- package/lib/components/editor/editor-group/GenerationSpecificationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +99 -100
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -1
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js +5 -5
- package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +27 -19
- package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js +5 -5
- package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +2 -2
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js +2 -2
- package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +4 -6
- package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +2 -2
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js +2 -2
- package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +4 -4
- package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.d.ts +2 -0
- package/lib/components/editor/panel-group/PanelGroup.d.ts.map +1 -1
- package/lib/components/editor/panel-group/PanelGroup.js +18 -3
- package/lib/components/editor/panel-group/PanelGroup.js.map +1 -1
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +26 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +339 -0
- package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -0
- package/lib/components/editor/side-bar/Explorer.js +5 -6
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +5 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +2 -2
- package/lib/stores/editor/EditorConfig.d.ts +2 -1
- package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
- package/lib/stores/editor/EditorConfig.js +1 -0
- package/lib/stores/editor/EditorConfig.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +8 -2
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +19 -4
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js +1 -0
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/QuickInputState.d.ts +28 -0
- package/lib/stores/editor/QuickInputState.d.ts.map +1 -0
- package/lib/stores/editor/QuickInputState.js +17 -0
- package/lib/stores/editor/QuickInputState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +22 -2
- 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 +181 -4
- package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js +6 -2
- package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +19 -18
- 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 +167 -157
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +8 -9
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +9 -14
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +4 -4
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +7 -8
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +3 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +82 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +328 -0
- package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -0
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +8 -2
- package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
- package/package.json +12 -12
- package/src/__lib__/LegendStudioApplicationNavigationContext.ts +2 -0
- package/src/__lib__/STO_Relational_LegendStudioCommand.ts +30 -0
- package/src/application/LegendStudioApplicationConfig.ts +7 -0
- package/src/components/ElementIconUtils.tsx +23 -8
- package/src/components/editor/Editor.tsx +2 -0
- package/src/components/editor/QuickInput.tsx +91 -0
- package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +5 -1
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +4 -4
- package/src/components/editor/editor-group/EditorGroup.tsx +41 -1
- package/src/components/editor/editor-group/FunctionEditor.tsx +145 -5
- package/src/components/editor/editor-group/GenerationSpecificationEditor.tsx +1 -1
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +134 -131
- package/src/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.tsx +26 -13
- package/src/components/editor/editor-group/RuntimeEditor.tsx +1 -1
- package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +193 -150
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +2 -2
- package/src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx +6 -5
- package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +1 -1
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/MappingExplorer.tsx +2 -2
- package/src/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.tsx +1 -1
- package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +8 -10
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +2 -2
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +9 -3
- package/src/components/editor/editor-group/uml-editor/AssociationEditor.tsx +2 -2
- package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +4 -4
- package/src/components/editor/panel-group/PanelGroup.tsx +35 -3
- package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +730 -0
- package/src/components/editor/side-bar/Explorer.tsx +5 -5
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +1 -1
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +9 -3
- package/src/stores/editor/EditorConfig.ts +1 -0
- package/src/stores/editor/EditorStore.ts +23 -4
- package/src/stores/editor/GraphEditFormModeState.ts +1 -0
- package/src/stores/editor/QuickInputState.ts +24 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +317 -3
- package/src/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.ts +11 -2
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +262 -249
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +5 -5
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +19 -23
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +9 -9
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +4 -2
- package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +485 -0
- package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +13 -1
- package/tsconfig.json +5 -0
@@ -33,6 +33,15 @@ import {
|
|
33
33
|
EmptyCircleIcon,
|
34
34
|
PanelContent,
|
35
35
|
Modal,
|
36
|
+
ModalHeader,
|
37
|
+
ModalBody,
|
38
|
+
ModalFooter,
|
39
|
+
ModalTitle,
|
40
|
+
ModalHeaderActions,
|
41
|
+
TimesIcon,
|
42
|
+
ModalFooterButton,
|
43
|
+
BlankPanelContent,
|
44
|
+
KeyIcon,
|
36
45
|
} from '@finos/legend-art';
|
37
46
|
import { useEffect } from 'react';
|
38
47
|
import {
|
@@ -43,7 +52,7 @@ import {
|
|
43
52
|
SchemaDatabaseBuilderTreeNodeData,
|
44
53
|
TableDatabaseBuilderTreeNodeData,
|
45
54
|
} from '../../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js';
|
46
|
-
import {
|
55
|
+
import { noop } from '@finos/legend-shared';
|
47
56
|
import {
|
48
57
|
useApplicationStore,
|
49
58
|
useConditionedApplicationNavigationContext,
|
@@ -57,106 +66,121 @@ import {
|
|
57
66
|
} from '@finos/legend-lego/code-editor';
|
58
67
|
import { stringifyDataType } from '@finos/legend-graph';
|
59
68
|
|
60
|
-
const
|
69
|
+
const getDatabaseSchemaNodeIcon = (
|
70
|
+
node: DatabaseBuilderTreeNodeData,
|
71
|
+
): React.ReactNode => {
|
61
72
|
if (node instanceof SchemaDatabaseBuilderTreeNodeData) {
|
62
|
-
return
|
73
|
+
return (
|
74
|
+
<div className="database-builder-tree__icon--schema">
|
75
|
+
<PURE_DatabaseSchemaIcon />
|
76
|
+
</div>
|
77
|
+
);
|
63
78
|
} else if (node instanceof TableDatabaseBuilderTreeNodeData) {
|
64
|
-
return
|
79
|
+
return (
|
80
|
+
<div className="database-builder-tree__icon--table">
|
81
|
+
<PURE_DatabaseTableIcon />
|
82
|
+
</div>
|
83
|
+
);
|
65
84
|
} else if (node instanceof ColumnDatabaseBuilderTreeNodeData) {
|
66
85
|
return renderColumnTypeIcon(node.column.type);
|
67
86
|
}
|
68
87
|
return null;
|
69
88
|
};
|
70
89
|
|
71
|
-
const DatabaseBuilderTreeNodeContainer
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
90
|
+
const DatabaseBuilderTreeNodeContainer = observer(
|
91
|
+
(
|
92
|
+
props: TreeNodeContainerProps<
|
93
|
+
DatabaseBuilderTreeNodeData,
|
94
|
+
{
|
95
|
+
toggleCheckedNode: (node: DatabaseBuilderTreeNodeData) => void;
|
96
|
+
isPartiallySelected: (node: DatabaseBuilderTreeNodeData) => boolean;
|
97
|
+
}
|
98
|
+
>,
|
99
|
+
) => {
|
100
|
+
const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
|
101
|
+
const { toggleCheckedNode, isPartiallySelected } = innerProps;
|
102
|
+
const isExpandable =
|
103
|
+
Boolean(!node.childrenIds || node.childrenIds.length) &&
|
104
|
+
!(node instanceof ColumnDatabaseBuilderTreeNodeData);
|
105
|
+
const nodeExpandIcon = isExpandable ? (
|
106
|
+
node.isOpen ? (
|
107
|
+
<ChevronDownIcon />
|
108
|
+
) : (
|
109
|
+
<ChevronRightIcon />
|
110
|
+
)
|
88
111
|
) : (
|
89
|
-
<
|
90
|
-
)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
};
|
112
|
+
<div />
|
113
|
+
);
|
114
|
+
const nodeTypeIcon = getDatabaseSchemaNodeIcon(node);
|
115
|
+
const toggleExpandNode = (): void => {
|
116
|
+
onNodeSelect?.(node);
|
117
|
+
if (!isExpandable) {
|
118
|
+
toggleCheckedNode(node);
|
119
|
+
}
|
120
|
+
};
|
121
|
+
const isPrimaryKeyColumn =
|
122
|
+
node instanceof ColumnDatabaseBuilderTreeNodeData &&
|
123
|
+
node.owner.primaryKey.includes(node.column);
|
102
124
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
125
|
+
const renderCheckedIcon = (
|
126
|
+
_node: DatabaseBuilderTreeNodeData,
|
127
|
+
): React.ReactNode => {
|
128
|
+
if (_node instanceof ColumnDatabaseBuilderTreeNodeData) {
|
129
|
+
return null;
|
130
|
+
} else if (isPartiallySelected(_node)) {
|
131
|
+
return <CircleIcon />;
|
132
|
+
} else if (_node.isChecked) {
|
133
|
+
return <CheckCircleIcon />;
|
134
|
+
}
|
135
|
+
return <EmptyCircleIcon />;
|
136
|
+
};
|
115
137
|
|
116
|
-
|
117
|
-
<div
|
118
|
-
className={clsx('tree-view__node__container')}
|
119
|
-
style={{
|
120
|
-
paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
|
121
|
-
display: 'flex',
|
122
|
-
}}
|
123
|
-
>
|
124
|
-
<div className="tree-view__node__icon database-builder-tree__node__icon">
|
125
|
-
<div
|
126
|
-
className="database-builder-tree__expand-icon"
|
127
|
-
onClick={toggleExpandNode}
|
128
|
-
>
|
129
|
-
{nodeExpandIcon}
|
130
|
-
</div>
|
131
|
-
<div
|
132
|
-
className={clsx('database-builder-tree__checker-icon')}
|
133
|
-
onClick={toggleCheck}
|
134
|
-
>
|
135
|
-
{renderCheckedIcon(node)}
|
136
|
-
</div>
|
137
|
-
<div
|
138
|
-
className="database-builder-tree__type-icon"
|
139
|
-
onClick={toggleExpandNode}
|
140
|
-
>
|
141
|
-
{nodeTypeIcon}
|
142
|
-
</div>
|
143
|
-
</div>
|
138
|
+
return (
|
144
139
|
<div
|
145
|
-
className=
|
140
|
+
className={clsx('tree-view__node__container')}
|
141
|
+
style={{
|
142
|
+
paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
|
143
|
+
display: 'flex',
|
144
|
+
}}
|
146
145
|
onClick={toggleExpandNode}
|
147
146
|
>
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
<div className="database-builder-tree__node__type__label">
|
152
|
-
{stringifyDataType(node.column.type)}
|
153
|
-
</div>
|
147
|
+
<div className="tree-view__node__icon database-builder-tree__node__icon__group">
|
148
|
+
<div className="database-builder-tree__expand-icon">
|
149
|
+
{nodeExpandIcon}
|
154
150
|
</div>
|
155
|
-
|
151
|
+
<div
|
152
|
+
className={clsx('database-builder-tree__checker-icon')}
|
153
|
+
onClick={(event) => {
|
154
|
+
event.stopPropagation();
|
155
|
+
toggleCheckedNode(node);
|
156
|
+
}}
|
157
|
+
>
|
158
|
+
{renderCheckedIcon(node)}
|
159
|
+
</div>
|
160
|
+
<div className="database-builder-tree__type-icon">{nodeTypeIcon}</div>
|
161
|
+
</div>
|
162
|
+
<div className="tree-view__node__label database-builder-tree__node__label">
|
163
|
+
{node.label}
|
164
|
+
{node instanceof ColumnDatabaseBuilderTreeNodeData && (
|
165
|
+
<div className="database-builder-tree__node__type">
|
166
|
+
<div className="database-builder-tree__node__type__label">
|
167
|
+
{stringifyDataType(node.column.type)}
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
)}
|
171
|
+
{isPrimaryKeyColumn && (
|
172
|
+
<div
|
173
|
+
className="database-builder-tree__node__pk"
|
174
|
+
title="Primary Key"
|
175
|
+
>
|
176
|
+
<KeyIcon />
|
177
|
+
</div>
|
178
|
+
)}
|
179
|
+
</div>
|
156
180
|
</div>
|
157
|
-
|
158
|
-
|
159
|
-
|
181
|
+
);
|
182
|
+
},
|
183
|
+
);
|
160
184
|
|
161
185
|
export const DatabaseBuilderExplorer = observer(
|
162
186
|
(props: {
|
@@ -200,6 +224,7 @@ export const DatabaseBuilderExplorer = observer(
|
|
200
224
|
};
|
201
225
|
return (
|
202
226
|
<TreeView
|
227
|
+
className="database-builder-tree"
|
203
228
|
components={{
|
204
229
|
TreeNodeContainer: DatabaseBuilderTreeNodeContainer,
|
205
230
|
}}
|
@@ -222,8 +247,8 @@ export const DatabaseBuilder = observer(
|
|
222
247
|
}) => {
|
223
248
|
const { databaseBuilderState, isReadOnly } = props;
|
224
249
|
const applicationStore = useApplicationStore();
|
225
|
-
const
|
226
|
-
flowResult(databaseBuilderState.
|
250
|
+
const preview = applicationStore.guardUnhandledError(() =>
|
251
|
+
flowResult(databaseBuilderState.previewDatabaseModel()),
|
227
252
|
);
|
228
253
|
const saveOrUpdateDatabase = applicationStore.guardUnhandledError(() =>
|
229
254
|
flowResult(databaseBuilderState.createOrUpdateDatabase()),
|
@@ -247,7 +272,7 @@ export const DatabaseBuilder = observer(
|
|
247
272
|
};
|
248
273
|
|
249
274
|
useEffect(() => {
|
250
|
-
flowResult(databaseBuilderState.
|
275
|
+
flowResult(databaseBuilderState.fetchDatabaseMetadata()).catch(
|
251
276
|
applicationStore.alertUnhandledError,
|
252
277
|
);
|
253
278
|
}, [databaseBuilderState, applicationStore]);
|
@@ -260,17 +285,28 @@ export const DatabaseBuilder = observer(
|
|
260
285
|
return (
|
261
286
|
<Dialog
|
262
287
|
open={databaseBuilderState.showModal}
|
263
|
-
onClose={
|
288
|
+
onClose={noop} // disallow closing dialog by using Esc key or clicking on the backdrop
|
264
289
|
classes={{ container: 'search-modal__container' }}
|
265
|
-
PaperProps={{
|
290
|
+
PaperProps={{
|
291
|
+
classes: {
|
292
|
+
root: 'search-modal__inner-container database-builder__container',
|
293
|
+
},
|
294
|
+
}}
|
266
295
|
>
|
267
296
|
<Modal darkMode={true} className="database-builder">
|
268
|
-
<
|
269
|
-
<
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
297
|
+
<ModalHeader>
|
298
|
+
<ModalTitle title="Database Builder" />
|
299
|
+
<ModalHeaderActions>
|
300
|
+
<button
|
301
|
+
className="modal__header__action"
|
302
|
+
tabIndex={-1}
|
303
|
+
onClick={closeModal}
|
304
|
+
>
|
305
|
+
<TimesIcon />
|
306
|
+
</button>
|
307
|
+
</ModalHeaderActions>
|
308
|
+
</ModalHeader>
|
309
|
+
<ModalBody className="database-builder__content">
|
274
310
|
<PanelLoadingIndicator isLoading={isExecutingAction} />
|
275
311
|
<ResizablePanelGroup orientation="vertical">
|
276
312
|
<ResizablePanel size={450}>
|
@@ -278,32 +314,11 @@ export const DatabaseBuilder = observer(
|
|
278
314
|
<div className="panel__header">
|
279
315
|
<div className="panel__header__title">
|
280
316
|
<div className="panel__header__title__label">
|
281
|
-
|
317
|
+
schema explorer
|
282
318
|
</div>
|
283
319
|
</div>
|
284
320
|
</div>
|
285
321
|
<div className="panel__content database-builder__config__content">
|
286
|
-
<div className="panel__content__form__section">
|
287
|
-
<div className="panel__content__form__section__header__label">
|
288
|
-
{capitalize('target database path')}
|
289
|
-
</div>
|
290
|
-
<div className="panel__content__form__section__header__prompt">
|
291
|
-
{'path of target database'}
|
292
|
-
</div>
|
293
|
-
<input
|
294
|
-
className="panel__content__form__section__input"
|
295
|
-
spellCheck={false}
|
296
|
-
disabled={
|
297
|
-
isReadOnly ||
|
298
|
-
Boolean(databaseBuilderState.currentDatabase)
|
299
|
-
}
|
300
|
-
value={
|
301
|
-
databaseBuilderState.currentDatabase?.path ??
|
302
|
-
databaseBuilderState.targetDatabasePath
|
303
|
-
}
|
304
|
-
onChange={changeValue}
|
305
|
-
/>
|
306
|
-
</div>
|
307
322
|
{databaseBuilderState.treeData && (
|
308
323
|
<DatabaseBuilderExplorer
|
309
324
|
treeData={databaseBuilderState.treeData}
|
@@ -316,47 +331,75 @@ export const DatabaseBuilder = observer(
|
|
316
331
|
</ResizablePanel>
|
317
332
|
<ResizablePanelSplitter />
|
318
333
|
<ResizablePanel>
|
319
|
-
<div className="panel database-
|
334
|
+
<div className="panel database-builder__model">
|
320
335
|
<div className="panel__header">
|
321
336
|
<div className="panel__header__title">
|
322
|
-
<div className="panel__header__title__label">
|
323
|
-
|
324
|
-
|
325
|
-
<button
|
326
|
-
className="database-builder__action--btn database-builder__generate--btn"
|
327
|
-
disabled={isReadOnly || isExecutingAction}
|
328
|
-
tabIndex={-1}
|
329
|
-
onClick={buildDb}
|
330
|
-
title="Build database..."
|
331
|
-
>
|
332
|
-
Generate
|
333
|
-
</button>
|
334
|
-
<button
|
335
|
-
className="database-builder__action--btn"
|
336
|
-
disabled={isReadOnly || isExecutingAction}
|
337
|
-
tabIndex={-1}
|
338
|
-
onClick={saveOrUpdateDatabase}
|
339
|
-
title={
|
340
|
-
databaseBuilderState.currentDatabase
|
341
|
-
? 'Update database...'
|
342
|
-
: 'Import database...'
|
343
|
-
}
|
344
|
-
>
|
345
|
-
Save
|
346
|
-
</button>
|
337
|
+
<div className="panel__header__title__label">
|
338
|
+
database model
|
339
|
+
</div>
|
347
340
|
</div>
|
348
341
|
</div>
|
349
342
|
<PanelContent>
|
350
|
-
<
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
343
|
+
<div className="database-builder__modeller">
|
344
|
+
<div className="panel__content__form__section database-builder__modeller__path">
|
345
|
+
<div className="panel__content__form__section__header__label">
|
346
|
+
Target Database Path
|
347
|
+
</div>
|
348
|
+
<input
|
349
|
+
className="panel__content__form__section__input"
|
350
|
+
spellCheck={false}
|
351
|
+
disabled={
|
352
|
+
isReadOnly ||
|
353
|
+
Boolean(databaseBuilderState.currentDatabase)
|
354
|
+
}
|
355
|
+
value={
|
356
|
+
databaseBuilderState.currentDatabase?.path ??
|
357
|
+
databaseBuilderState.targetDatabasePath
|
358
|
+
}
|
359
|
+
onChange={changeValue}
|
360
|
+
/>
|
361
|
+
</div>
|
362
|
+
<div className="database-builder__modeller__preview">
|
363
|
+
{databaseBuilderState.databaseGrammarCode && (
|
364
|
+
<CodeEditor
|
365
|
+
language={CODE_EDITOR_LANGUAGE.PURE}
|
366
|
+
inputValue={
|
367
|
+
databaseBuilderState.databaseGrammarCode
|
368
|
+
}
|
369
|
+
isReadOnly={true}
|
370
|
+
/>
|
371
|
+
)}
|
372
|
+
{!databaseBuilderState.databaseGrammarCode && (
|
373
|
+
<BlankPanelContent>
|
374
|
+
No database preview
|
375
|
+
</BlankPanelContent>
|
376
|
+
)}
|
377
|
+
</div>
|
378
|
+
</div>
|
355
379
|
</PanelContent>
|
356
380
|
</div>
|
357
381
|
</ResizablePanel>
|
358
382
|
</ResizablePanelGroup>
|
359
|
-
</
|
383
|
+
</ModalBody>
|
384
|
+
<ModalFooter>
|
385
|
+
<ModalFooterButton
|
386
|
+
className="database-builder__action--btn"
|
387
|
+
disabled={isReadOnly || isExecutingAction}
|
388
|
+
onClick={preview}
|
389
|
+
title="Preview database model..."
|
390
|
+
>
|
391
|
+
Preview
|
392
|
+
</ModalFooterButton>
|
393
|
+
<ModalFooterButton
|
394
|
+
className="database-builder__action--btn"
|
395
|
+
disabled={isReadOnly || isExecutingAction}
|
396
|
+
onClick={saveOrUpdateDatabase}
|
397
|
+
>
|
398
|
+
{databaseBuilderState.currentDatabase
|
399
|
+
? 'Update Database'
|
400
|
+
: 'Build Database'}
|
401
|
+
</ModalFooterButton>
|
402
|
+
</ModalFooter>
|
360
403
|
</Modal>
|
361
404
|
</Dialog>
|
362
405
|
);
|
package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx
CHANGED
@@ -1645,7 +1645,7 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1645
1645
|
<PanelContent className="relational-connection-editor__general">
|
1646
1646
|
<PanelFormSection>
|
1647
1647
|
<div className="panel__content__form__section__header__label">
|
1648
|
-
Database
|
1648
|
+
Database Type
|
1649
1649
|
</div>
|
1650
1650
|
<CustomSelectorInput
|
1651
1651
|
options={typeOptions}
|
@@ -1669,7 +1669,7 @@ const RelationalConnectionGeneralEditor = observer(
|
|
1669
1669
|
<PanelContent className="relational-connection-editor__general">
|
1670
1670
|
<PanelFormSection>
|
1671
1671
|
<div className="panel__content__form__section__header__label">
|
1672
|
-
Database
|
1672
|
+
Database Type
|
1673
1673
|
</div>
|
1674
1674
|
<CustomSelectorInput
|
1675
1675
|
options={typeOptions}
|
@@ -571,12 +571,13 @@ const MergeConflictEditor = observer(
|
|
571
571
|
() => (): void => {
|
572
572
|
if (editor) {
|
573
573
|
disposeCodeEditor(editor);
|
574
|
+
|
575
|
+
onDidChangeModelContentEventDisposer.current?.dispose();
|
576
|
+
onDidChangeCursorPositionEventDisposer.current?.dispose();
|
577
|
+
onDidBlurEditorTextEventDisposer.current?.dispose();
|
578
|
+
onDidFocusEditorTextEventDisposer.current?.dispose();
|
579
|
+
mergeConflictResolutionCodeLensDisposer.current?.dispose();
|
574
580
|
}
|
575
|
-
onDidChangeModelContentEventDisposer.current?.dispose();
|
576
|
-
onDidChangeCursorPositionEventDisposer.current?.dispose();
|
577
|
-
onDidBlurEditorTextEventDisposer.current?.dispose();
|
578
|
-
onDidFocusEditorTextEventDisposer.current?.dispose();
|
579
|
-
mergeConflictResolutionCodeLensDisposer.current?.dispose();
|
580
581
|
},
|
581
582
|
[editor],
|
582
583
|
);
|
package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx
CHANGED
@@ -227,10 +227,10 @@ const FileGenerationScopeEditor = observer(
|
|
227
227
|
{
|
228
228
|
<div className="file-generation-editor__configuration__content__scope__icon">
|
229
229
|
{getElementIcon(
|
230
|
-
editorStore,
|
231
230
|
value instanceof PackageableElementReference
|
232
231
|
? value.value
|
233
232
|
: undefined,
|
233
|
+
editorStore,
|
234
234
|
)}
|
235
235
|
</div>
|
236
236
|
}
|
@@ -79,7 +79,7 @@ const ModelUnitPackagableElementEntryEditor = observer(
|
|
79
79
|
<div className="panel__content__form__section__list__item__value model-unit-entry-editor__element">
|
80
80
|
{
|
81
81
|
<div className="model-unit-entry-editor__element__icon">
|
82
|
-
{getElementIcon(
|
82
|
+
{getElementIcon(elementRef.value, editorStore)}
|
83
83
|
</div>
|
84
84
|
}
|
85
85
|
<div className="model-unit-entry-editor__element__path">
|
@@ -209,7 +209,7 @@ export const ClassMappingEditor = observer(
|
|
209
209
|
{sourceName && (
|
210
210
|
<div className="mapping-element-editor__metadata__sub-chunk mapping-element-editor__metadata__source">
|
211
211
|
<div className="mapping-element-editor__metadata__source__type icon">
|
212
|
-
{getElementTypeIcon(
|
212
|
+
{getElementTypeIcon(sourceType, editorStore)}
|
213
213
|
</div>
|
214
214
|
<div className="mapping-element-editor__metadata__source__label">
|
215
215
|
{sourceName}
|
@@ -276,7 +276,7 @@ export const MappingElementExplorer = observer(
|
|
276
276
|
}'`}
|
277
277
|
>
|
278
278
|
<div className="mapping-explorer__item__label__icon">
|
279
|
-
{getElementIcon(
|
279
|
+
{getElementIcon(mappingElementTarget, editorStore)}
|
280
280
|
</div>
|
281
281
|
<div className="mapping-explorer__item__label__text">
|
282
282
|
{getMappingElementLabel(mappingElement, editorStore).value}
|
@@ -384,7 +384,7 @@ const MappingElementTreeNodeContainer = observer(
|
|
384
384
|
{nodeExpandIcon}
|
385
385
|
</div>
|
386
386
|
<div className="mapping-explorer__item__label__icon">
|
387
|
-
{getElementIcon(
|
387
|
+
{getElementIcon(mappingElementTarget, editorStore)}
|
388
388
|
</div>
|
389
389
|
<div className="mapping-explorer__item__label__text">
|
390
390
|
{getMappingElementLabel(mappingElement, editorStore).value}
|
@@ -398,7 +398,7 @@ export const PropertyMappingEditor = observer(
|
|
398
398
|
>
|
399
399
|
{propertyBasicType !== CLASS_PROPERTY_TYPE.PRIMITIVE && (
|
400
400
|
<div className="property-mapping-editor__type__abbr">
|
401
|
-
{getElementIcon(
|
401
|
+
{getElementIcon(propertyRawType, editorStore)}
|
402
402
|
</div>
|
403
403
|
)}
|
404
404
|
<div className="property-mapping-editor__type__label">
|
@@ -88,7 +88,7 @@ const ServiceExecutionResultViewer = observer(
|
|
88
88
|
</ModalBody>
|
89
89
|
<ModalFooter>
|
90
90
|
<button
|
91
|
-
className="btn modal__footer__close-btn"
|
91
|
+
className="btn modal__footer__close-btn btn--dark"
|
92
92
|
onClick={closeExecutionResultViewer}
|
93
93
|
>
|
94
94
|
Close
|
@@ -211,9 +211,7 @@ export const ServiceExecutionQueryEditor = observer(
|
|
211
211
|
);
|
212
212
|
|
213
213
|
const executionIsRunning =
|
214
|
-
executionState.isRunningQuery ||
|
215
|
-
executionState.isGeneratingPlan ||
|
216
|
-
executionState.isGeneratingPlan;
|
214
|
+
executionState.isRunningQuery || executionState.isGeneratingPlan;
|
217
215
|
|
218
216
|
const cancelQuery = applicationStore.guardUnhandledError(() =>
|
219
217
|
flowResult(executionState.cancelQuery()),
|
@@ -456,24 +454,24 @@ export const ServiceExecutionQueryEditor = observer(
|
|
456
454
|
language={CODE_EDITOR_LANGUAGE.PURE}
|
457
455
|
/>
|
458
456
|
</div>
|
459
|
-
<ExecutionPlanViewer
|
460
|
-
executionPlanState={executionState.executionPlanState}
|
461
|
-
/>
|
462
|
-
<ServiceExecutionResultViewer executionState={executionState} />
|
463
457
|
{queryState.queryLoaderState.isQueryLoaderDialogOpen && (
|
464
458
|
<QueryLoaderDialog
|
465
459
|
queryLoaderState={queryState.queryLoaderState}
|
466
460
|
title="import query"
|
467
461
|
/>
|
468
462
|
)}
|
469
|
-
|
463
|
+
<ExecutionPlanViewer
|
464
|
+
executionPlanState={executionState.executionPlanState}
|
465
|
+
/>
|
466
|
+
<ServiceExecutionResultViewer executionState={executionState} />
|
467
|
+
{executionState.parametersState.parameterValuesEditorState
|
470
468
|
.showModal && (
|
471
469
|
<LambdaParameterValuesEditor
|
472
470
|
graph={executionState.editorStore.graphManagerState.graph}
|
473
471
|
observerContext={
|
474
472
|
executionState.editorStore.changeDetectionState.observerContext
|
475
473
|
}
|
476
|
-
lambdaParametersState={executionState.
|
474
|
+
lambdaParametersState={executionState.parametersState}
|
477
475
|
/>
|
478
476
|
)}
|
479
477
|
</div>
|
package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx
CHANGED
@@ -165,7 +165,7 @@ export const ConnectionTestDataEditor = observer(
|
|
165
165
|
isReadOnly={isReadOnly}
|
166
166
|
embeddedDataEditorState={connectionTestDataState.embeddedEditorState}
|
167
167
|
/>
|
168
|
-
{connectionTestDataState.
|
168
|
+
{connectionTestDataState.parametersState.parameterValuesEditorState
|
169
169
|
.showModal && (
|
170
170
|
<LambdaParameterValuesEditor
|
171
171
|
graph={connectionTestDataState.editorStore.graphManagerState.graph}
|
@@ -173,7 +173,7 @@ export const ConnectionTestDataEditor = observer(
|
|
173
173
|
connectionTestDataState.editorStore.changeDetectionState
|
174
174
|
.observerContext
|
175
175
|
}
|
176
|
-
lambdaParametersState={connectionTestDataState.
|
176
|
+
lambdaParametersState={connectionTestDataState.parametersState}
|
177
177
|
/>
|
178
178
|
)}
|
179
179
|
</div>
|
package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx
CHANGED
@@ -25,6 +25,7 @@ import {
|
|
25
25
|
BlankPanelPlaceholder,
|
26
26
|
MenuContent,
|
27
27
|
MenuContentItem,
|
28
|
+
BlankPanelContent,
|
28
29
|
} from '@finos/legend-art';
|
29
30
|
import { observer } from 'mobx-react-lite';
|
30
31
|
import type { ServiceTestSuite } from '@finos/legend-graph';
|
@@ -48,9 +49,14 @@ export const ServiceTestSuiteEditor = observer(
|
|
48
49
|
<div className="service-test-suite-editor">
|
49
50
|
<ResizablePanelGroup orientation="horizontal">
|
50
51
|
<ResizablePanel size={300} minSize={28}>
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
{serviceTestSuiteState.testDataState && (
|
53
|
+
<ServiceTestDataEditor
|
54
|
+
testDataState={serviceTestSuiteState.testDataState}
|
55
|
+
/>
|
56
|
+
)}
|
57
|
+
{!serviceTestSuiteState.testDataState && (
|
58
|
+
<BlankPanelContent>No test data specified</BlankPanelContent>
|
59
|
+
)}
|
54
60
|
</ResizablePanel>
|
55
61
|
<ResizablePanelSplitter>
|
56
62
|
<ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
|
@@ -263,7 +263,7 @@ const AssociationPropertyBasicEditor = observer(
|
|
263
263
|
>
|
264
264
|
{propertyTypeName !== CLASS_PROPERTY_TYPE.PRIMITIVE && (
|
265
265
|
<div className="property-basic-editor__type__abbr">
|
266
|
-
{getElementIcon(
|
266
|
+
{getElementIcon(propertyType, editorStore)}
|
267
267
|
</div>
|
268
268
|
)}
|
269
269
|
<div className="property-basic-editor__type__label">
|
@@ -314,7 +314,7 @@ const AssociationPropertyBasicEditor = observer(
|
|
314
314
|
>
|
315
315
|
{propertyTypeName !== CLASS_PROPERTY_TYPE.PRIMITIVE && (
|
316
316
|
<div className="property-basic-editor__type__abbr">
|
317
|
-
{getElementIcon(
|
317
|
+
{getElementIcon(propertyType, editorStore)}
|
318
318
|
</div>
|
319
319
|
)}
|
320
320
|
<div className="property-basic-editor__type__label">
|