@finos/legend-application-studio 26.0.2 → 26.0.4

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 (182) hide show
  1. package/lib/application/LegendStudioApplicationConfig.d.ts +10 -13
  2. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  3. package/lib/application/LegendStudioApplicationConfig.js +11 -10
  4. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  5. package/lib/components/ElementIconUtils.d.ts +1 -1
  6. package/lib/components/ElementIconUtils.d.ts.map +1 -1
  7. package/lib/components/ElementIconUtils.js +11 -5
  8. package/lib/components/ElementIconUtils.js.map +1 -1
  9. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
  10. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +2 -0
  11. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
  12. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  13. package/lib/components/editor/editor-group/EditorGroup.js +7 -1
  14. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  15. package/lib/components/editor/editor-group/FunctionEditor.d.ts +0 -16
  16. package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/FunctionEditor.js +79 -26
  18. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/{service-editor/TEMPORARY__SnowflakeServiceDeployer.d.ts → INTERNAL__UnknownFunctionActivatorEdtior.d.ts} +2 -2
  20. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -0
  21. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js +49 -0
  22. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -0
  23. package/lib/components/editor/editor-group/ModelImporter.js +1 -1
  24. package/lib/components/editor/editor-group/ModelImporter.js.map +1 -1
  25. package/lib/components/editor/editor-group/ProtocolValueBuilder.d.ts +22 -0
  26. package/lib/components/editor/editor-group/ProtocolValueBuilder.d.ts.map +1 -0
  27. package/lib/components/editor/editor-group/ProtocolValueBuilder.js +88 -0
  28. package/lib/components/editor/editor-group/ProtocolValueBuilder.js.map +1 -0
  29. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  30. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +5 -1
  31. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  32. package/lib/components/editor/editor-group/connection-editor/post-processor-editor/MapperPostProcessorEditor.js +1 -1
  33. package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.d.ts +1 -1
  34. package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.d.ts.map +1 -1
  35. package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
  36. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js +1 -1
  37. package/lib/components/editor/editor-group/mapping-editor/FlatDataPropertyMappingEditor.js +3 -3
  38. package/lib/components/editor/editor-group/mapping-editor/FlatDataPropertyMappingEditor.js.map +1 -1
  39. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.d.ts.map +1 -1
  40. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.js +3 -3
  41. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.js.map +1 -1
  42. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +1 -1
  43. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
  44. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +1 -1
  45. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  46. package/lib/components/editor/{edit-panel/mapping-editor/testable → editor-group/mapping-editor}/MappingTestableEditor.d.ts +1 -1
  47. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -0
  48. package/lib/components/editor/{edit-panel/mapping-editor/testable → editor-group/mapping-editor}/MappingTestableEditor.js +11 -11
  49. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -0
  50. package/lib/components/editor/editor-group/mapping-editor/PurePropertyMappingEditor.js +4 -4
  51. package/lib/components/editor/editor-group/mapping-editor/PurePropertyMappingEditor.js.map +1 -1
  52. package/lib/components/editor/editor-group/mapping-editor/relational/RelationalPropertyMappingEditor.js +4 -4
  53. package/lib/components/editor/editor-group/mapping-editor/relational/RelationalPropertyMappingEditor.js.map +1 -1
  54. package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
  55. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +0 -7
  56. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
  57. package/lib/components/editor/editor-group/service-editor/ServicePostValidationEditor.js +3 -3
  58. package/lib/components/editor/editor-group/service-editor/ServicePostValidationEditor.js.map +1 -1
  59. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +3 -3
  60. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  61. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.d.ts.map +1 -1
  62. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +6 -2
  63. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
  64. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.d.ts.map +1 -1
  65. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +10 -2
  66. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
  67. package/lib/components/workspace-setup/WorkspaceSetup.js +1 -1
  68. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  69. package/lib/index.css +2 -2
  70. package/lib/index.css.map +1 -1
  71. package/lib/package.json +2 -2
  72. package/lib/stores/LegendStudioApplicationPlugin.d.ts +1 -1
  73. package/lib/stores/LegendStudioApplicationPlugin.d.ts.map +1 -1
  74. package/lib/stores/editor/EditorGraphState.d.ts +3 -1
  75. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  76. package/lib/stores/editor/EditorGraphState.js +14 -0
  77. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  78. package/lib/stores/editor/EditorStore.d.ts +5 -5
  79. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  80. package/lib/stores/editor/EditorStore.js +12 -7
  81. package/lib/stores/editor/EditorStore.js.map +1 -1
  82. package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
  83. package/lib/stores/editor/EditorTabManagerState.js +5 -1
  84. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  85. package/lib/stores/editor/editor-state/ExternalFormatState.d.ts +3 -3
  86. package/lib/stores/editor/editor-state/ExternalFormatState.d.ts.map +1 -1
  87. package/lib/stores/editor/editor-state/ExternalFormatState.js +14 -14
  88. package/lib/stores/editor/editor-state/ExternalFormatState.js.map +1 -1
  89. package/lib/stores/editor/editor-state/GraphGenerationState.d.ts +2 -2
  90. package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
  91. package/lib/stores/editor/editor-state/GraphGenerationState.js +1 -1
  92. package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
  93. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.d.ts +34 -0
  94. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.d.ts.map +1 -0
  95. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.js +118 -0
  96. package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.js.map +1 -0
  97. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +10 -8
  98. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  99. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +16 -13
  100. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  101. package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.d.ts +31 -0
  102. package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.d.ts.map +1 -0
  103. package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js +91 -0
  104. package/lib/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js.map +1 -0
  105. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts +69 -0
  106. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts.map +1 -0
  107. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js +243 -0
  108. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js.map +1 -0
  109. package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts +2 -0
  110. package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.d.ts.map +1 -1
  111. package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js +8 -1
  112. package/lib/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js.map +1 -1
  113. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts +2 -13
  114. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  115. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +1 -39
  116. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  117. package/lib/stores/editor/utils/MockDataUtils.d.ts +0 -1
  118. package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
  119. package/lib/stores/editor/utils/MockDataUtils.js +7 -20
  120. package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
  121. package/lib/stores/editor/utils/PackageTreeUtils.js +1 -1
  122. package/lib/stores/editor/utils/PackageTreeUtils.js.map +1 -1
  123. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts +3 -1
  124. package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts.map +1 -1
  125. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js +4 -1
  126. package/lib/stores/graph-modifier/DomainGraphModifierHelper.js.map +1 -1
  127. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts +1 -0
  128. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts.map +1 -1
  129. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js +3 -0
  130. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js.map +1 -1
  131. package/lib/stores/project-view/ProjectViewerStore.js +7 -3
  132. package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
  133. package/package.json +12 -12
  134. package/src/application/LegendStudioApplicationConfig.ts +14 -20
  135. package/src/components/ElementIconUtils.tsx +14 -2
  136. package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +2 -0
  137. package/src/components/editor/editor-group/EditorGroup.tsx +12 -1
  138. package/src/components/editor/editor-group/FunctionEditor.tsx +331 -85
  139. package/src/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.tsx +129 -0
  140. package/src/components/editor/editor-group/ModelImporter.tsx +1 -1
  141. package/src/components/editor/editor-group/ProtocolValueBuilder.tsx +225 -0
  142. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +26 -1
  143. package/src/components/editor/editor-group/connection-editor/post-processor-editor/MapperPostProcessorEditor.tsx +1 -1
  144. package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +7 -28
  145. package/src/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.tsx +1 -1
  146. package/src/components/editor/editor-group/mapping-editor/FlatDataPropertyMappingEditor.tsx +4 -4
  147. package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationEditor.tsx +2 -3
  148. package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +1 -1
  149. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +1 -1
  150. package/src/components/editor/{edit-panel/mapping-editor/testable → editor-group/mapping-editor}/MappingTestableEditor.tsx +13 -13
  151. package/src/components/editor/editor-group/mapping-editor/PurePropertyMappingEditor.tsx +5 -5
  152. package/src/components/editor/editor-group/mapping-editor/relational/RelationalPropertyMappingEditor.tsx +5 -5
  153. package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +0 -10
  154. package/src/components/editor/editor-group/service-editor/ServicePostValidationEditor.tsx +3 -3
  155. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +3 -3
  156. package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +12 -11
  157. package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +18 -20
  158. package/src/components/workspace-setup/WorkspaceSetup.tsx +1 -1
  159. package/src/stores/LegendStudioApplicationPlugin.ts +14 -5
  160. package/src/stores/editor/EditorGraphState.ts +24 -0
  161. package/src/stores/editor/EditorStore.ts +16 -7
  162. package/src/stores/editor/EditorTabManagerState.ts +7 -0
  163. package/src/stores/editor/editor-state/ExternalFormatState.ts +14 -16
  164. package/src/stores/editor/editor-state/GraphGenerationState.ts +3 -2
  165. package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorBuilderState.ts +178 -0
  166. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +21 -13
  167. package/src/stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.ts +136 -0
  168. package/src/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.ts +364 -0
  169. package/src/stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.ts +12 -0
  170. package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +0 -53
  171. package/src/stores/editor/utils/MockDataUtils.ts +7 -28
  172. package/src/stores/editor/utils/PackageTreeUtils.ts +1 -1
  173. package/src/stores/graph-modifier/DomainGraphModifierHelper.ts +9 -1
  174. package/src/stores/graph-modifier/STO_Relational_GraphModifierHelper.ts +6 -0
  175. package/src/stores/project-view/ProjectViewerStore.ts +6 -6
  176. package/tsconfig.json +6 -2
  177. package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.d.ts.map +0 -1
  178. package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.js.map +0 -1
  179. package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.d.ts.map +0 -1
  180. package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.js +0 -39
  181. package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.js.map +0 -1
  182. package/src/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.tsx +0 -79
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { observer } from 'mobx-react-lite';
18
+ import { useEditorStore } from '../EditorStoreProvider.js';
19
+ import { INTERNAL__UnknownFunctionActivatorEdtiorState } from '../../../stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js';
20
+ import { BlankPanelContent, Panel } from '@finos/legend-art';
21
+ import { useApplicationStore } from '@finos/legend-application';
22
+ import { flowResult } from 'mobx';
23
+ import { ProtocolValueBuilder } from './ProtocolValueBuilder.js';
24
+ import {
25
+ extractAnnotatedElementDocumentation,
26
+ generateFunctionPrettyName,
27
+ getClassProperty,
28
+ } from '@finos/legend-graph';
29
+ import { returnUndefOnError } from '@finos/legend-shared';
30
+
31
+ export const INTERNAL__UnknownFunctionActivatorEdtior = observer(() => {
32
+ const editorStore = useEditorStore();
33
+ const applicationStore = useApplicationStore();
34
+ const editorState = editorStore.tabManagerState.getCurrentEditorState(
35
+ INTERNAL__UnknownFunctionActivatorEdtiorState,
36
+ );
37
+ const validate = (): void => {
38
+ flowResult(editorState.validate()).catch(
39
+ applicationStore.alertUnhandledError,
40
+ );
41
+ };
42
+ const publishToSandbox = (): void => {
43
+ flowResult(editorState.publishToSandbox()).catch(
44
+ applicationStore.alertUnhandledError,
45
+ );
46
+ };
47
+
48
+ // function
49
+ const valueBuilderState = editorState.protocolValueBuilderState;
50
+ const functionFieldProperty = valueBuilderState
51
+ ? returnUndefOnError(() =>
52
+ getClassProperty(valueBuilderState.type, 'function'),
53
+ )
54
+ : undefined;
55
+ const functionFieldDocumentation = functionFieldProperty
56
+ ? extractAnnotatedElementDocumentation(functionFieldProperty)
57
+ : undefined;
58
+
59
+ return (
60
+ <div className="function-activator-editor">
61
+ <Panel>
62
+ <div className="panel__header">
63
+ <div className="panel__header__title">
64
+ <div className="panel__header__title__label">
65
+ function activator
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <div className="panel__content">
70
+ <div className="function-activator-editor__content">
71
+ {valueBuilderState && (
72
+ <>
73
+ <div className="panel__content__form">
74
+ <div className="panel__content__form__section">
75
+ <div className="panel__content__form__section__header__label">
76
+ Function
77
+ </div>
78
+ {functionFieldDocumentation && (
79
+ <div className="panel__content__form__section__header__prompt">
80
+ {functionFieldDocumentation}
81
+ </div>
82
+ )}
83
+ <input
84
+ className="panel__content__form__section__input"
85
+ spellCheck={false}
86
+ disabled={true}
87
+ value={generateFunctionPrettyName(
88
+ editorState.activator.function.value,
89
+ {
90
+ fullPath: true,
91
+ spacing: false,
92
+ },
93
+ )}
94
+ />
95
+ </div>
96
+ <div className="panel__content__form__section">
97
+ <div className="panel__content__form__section__divider"></div>
98
+ </div>
99
+ </div>
100
+ <ProtocolValueBuilder builderState={valueBuilderState} />
101
+ </>
102
+ )}
103
+ {!valueBuilderState && (
104
+ <BlankPanelContent>{`Can't display function activator in form mode`}</BlankPanelContent>
105
+ )}
106
+ </div>
107
+ <div className="function-activator-editor__footer">
108
+ <button
109
+ className="function-activator-editor__footer__action btn--dark"
110
+ onClick={validate}
111
+ disabled={editorState.validateState.isInProgress}
112
+ tabIndex={-1}
113
+ >
114
+ Validate
115
+ </button>
116
+ <button
117
+ className="function-activator-editor__footer__action btn--dark"
118
+ onClick={publishToSandbox}
119
+ disabled={editorState.publishToSandboxState.isInProgress}
120
+ tabIndex={-1}
121
+ >
122
+ Publish to Sandbox
123
+ </button>
124
+ </div>
125
+ </div>
126
+ </Panel>
127
+ </div>
128
+ );
129
+ });
@@ -177,7 +177,7 @@ export const ModelImporter = observer(() => {
177
177
  <TruckLoadingIcon />
178
178
  </div>
179
179
  <div className="model-loader__header__configs__edit-mode__label">
180
- current entities
180
+ Load from Graph
181
181
  </div>
182
182
  </div>
183
183
  );
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { observer } from 'mobx-react-lite';
18
+ import { extractAnnotatedElementDocumentation } from '@finos/legend-graph';
19
+ import {
20
+ BlankPanelContent,
21
+ TreeView,
22
+ type TreeNodeContainerProps,
23
+ type TreeNodeViewProps,
24
+ clsx,
25
+ TimesIcon,
26
+ } from '@finos/legend-art';
27
+ import { isNonNullable, noop, prettyCONSTName } from '@finos/legend-shared';
28
+ import {
29
+ UnsupportedFieldNode,
30
+ type ProtocolValueBuilderState,
31
+ type ProtocolValueFieldNode,
32
+ StringFieldNode,
33
+ OptionalStringFieldNode,
34
+ } from '../../../stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js';
35
+
36
+ const UnsupportedFieldEditor = observer(
37
+ (
38
+ props: TreeNodeContainerProps<
39
+ UnsupportedFieldNode,
40
+ { builderState: ProtocolValueBuilderState }
41
+ >,
42
+ ) => {
43
+ const { node } = props;
44
+ const property = node.property;
45
+ const documentation = extractAnnotatedElementDocumentation(property);
46
+
47
+ return (
48
+ <div className="panel__content__form__section">
49
+ <div className="panel__content__form__section__header__label">
50
+ {prettyCONSTName(property.name)}
51
+ </div>
52
+ {documentation && (
53
+ <div className="panel__content__form__section__header__prompt">
54
+ {documentation}
55
+ </div>
56
+ )}
57
+ <div>unsupported</div>
58
+ </div>
59
+ );
60
+ },
61
+ );
62
+
63
+ const StringFieldEditor = observer(
64
+ (
65
+ props: TreeNodeContainerProps<
66
+ StringFieldNode,
67
+ { builderState: ProtocolValueBuilderState }
68
+ >,
69
+ ) => {
70
+ const { node } = props;
71
+ const property = node.property;
72
+ const documentation = extractAnnotatedElementDocumentation(property);
73
+
74
+ return (
75
+ <div className="panel__content__form__section">
76
+ <div className="panel__content__form__section__header__label">
77
+ {prettyCONSTName(property.name)}
78
+ </div>
79
+ {documentation && (
80
+ <div className="panel__content__form__section__header__prompt">
81
+ {documentation}
82
+ </div>
83
+ )}
84
+ <input
85
+ className="panel__content__form__section__input"
86
+ spellCheck={false}
87
+ value={node.value}
88
+ onChange={(event) => node.setValue(event.target.value)}
89
+ />
90
+ </div>
91
+ );
92
+ },
93
+ );
94
+
95
+ const OptionalStringFieldEditor = observer(
96
+ (
97
+ props: TreeNodeContainerProps<
98
+ OptionalStringFieldNode,
99
+ { builderState: ProtocolValueBuilderState }
100
+ >,
101
+ ) => {
102
+ const { node } = props;
103
+ const property = node.property;
104
+ const documentation = extractAnnotatedElementDocumentation(property);
105
+
106
+ return (
107
+ <div className="panel__content__form__section">
108
+ <div className="panel__content__form__section__header__label">
109
+ {prettyCONSTName(property.name)}
110
+ </div>
111
+ {documentation && (
112
+ <div className="panel__content__form__section__header__prompt">
113
+ {documentation}
114
+ </div>
115
+ )}
116
+ <div className="panel__content__form__section__input__container">
117
+ <input
118
+ className="panel__content__form__section__input"
119
+ spellCheck={false}
120
+ value={node.value ?? ''}
121
+ placeholder={node.value === undefined ? '(empty)' : undefined}
122
+ onChange={(event) => node.setValue(event.target.value)}
123
+ />
124
+ <button
125
+ className="panel__content__form__section__input__reset-btn"
126
+ tabIndex={-1}
127
+ onClick={() => node.setValue(undefined)}
128
+ title="Reset"
129
+ >
130
+ <TimesIcon />
131
+ </button>
132
+ </div>
133
+ </div>
134
+ );
135
+ },
136
+ );
137
+
138
+ const ProtocolValueFieldEditor = observer(
139
+ (
140
+ props: TreeNodeContainerProps<
141
+ ProtocolValueFieldNode,
142
+ { builderState: ProtocolValueBuilderState }
143
+ >,
144
+ ) => {
145
+ const { node } = props;
146
+
147
+ if (node instanceof UnsupportedFieldNode) {
148
+ return <UnsupportedFieldEditor {...props} node={node} />;
149
+ } else if (node instanceof StringFieldNode) {
150
+ return <StringFieldEditor {...props} node={node} />;
151
+ } else if (node instanceof OptionalStringFieldNode) {
152
+ return <OptionalStringFieldEditor {...props} node={node} />;
153
+ }
154
+ return null;
155
+ },
156
+ );
157
+
158
+ const ProtocolValueNodeView = observer(
159
+ (
160
+ props: TreeNodeViewProps<
161
+ ProtocolValueFieldNode,
162
+ {
163
+ builderState: ProtocolValueBuilderState;
164
+ }
165
+ >,
166
+ ) => {
167
+ const { node, level, getChildNodes, classPrefix } = props;
168
+ const childNodes = getChildNodes(node);
169
+ if (!childNodes.length) {
170
+ return <ProtocolValueFieldEditor {...props} />;
171
+ }
172
+ return (
173
+ <div
174
+ className={clsx('tree-view__node__block panel__content__form', {
175
+ [`${classPrefix}__tree-view__node__block`]: classPrefix,
176
+ })}
177
+ >
178
+ <ProtocolValueFieldEditor {...props} level={level + 1} />
179
+ {node.isOpen &&
180
+ childNodes.map((childNode) => (
181
+ <ProtocolValueNodeView {...props} key={childNode.id} />
182
+ ))}
183
+ </div>
184
+ );
185
+ },
186
+ );
187
+
188
+ export const ProtocolValueBuilder = observer(
189
+ (props: { builderState: ProtocolValueBuilderState }) => {
190
+ const { builderState } = props;
191
+ const treeData = builderState.treeData;
192
+ const getChildNodes = (
193
+ node: ProtocolValueFieldNode,
194
+ ): ProtocolValueFieldNode[] => {
195
+ if (!node.childrenIds.length || !treeData) {
196
+ return [];
197
+ }
198
+ return node.childrenIds
199
+ .map((childId) => treeData.nodes.get(childId))
200
+ .filter(isNonNullable);
201
+ };
202
+
203
+ if (!treeData) {
204
+ return (
205
+ // TODO: show a JSON editor
206
+ <BlankPanelContent>{`Can't display form editor`}</BlankPanelContent>
207
+ );
208
+ }
209
+ return (
210
+ <TreeView
211
+ className="protocol-value-builder panel__content__form"
212
+ components={{
213
+ TreeNodeContainer: ProtocolValueFieldEditor,
214
+ TreeNodeView: ProtocolValueNodeView,
215
+ }}
216
+ treeData={treeData}
217
+ onNodeSelect={noop()}
218
+ getChildNodes={getChildNodes}
219
+ innerProps={{
220
+ builderState,
221
+ }}
222
+ />
223
+ );
224
+ },
225
+ );
@@ -1369,7 +1369,7 @@ const PostProcessorRelationalConnectionEditor = observer(
1369
1369
  <BlankPanelContent>
1370
1370
  {!postProcessors.length
1371
1371
  ? 'Add a post-processor'
1372
- : 'Select a post-processor to view'}
1372
+ : 'Choose a post-processor to view'}
1373
1373
  </BlankPanelContent>
1374
1374
  )}
1375
1375
  </ResizablePanel>
@@ -1552,6 +1552,7 @@ const renderAuthenticationStrategyEditor = (
1552
1552
  return null;
1553
1553
  }
1554
1554
  };
1555
+
1555
1556
  const RelationalConnectionGeneralEditor = observer(
1556
1557
  (props: {
1557
1558
  connectionValueState: RelationalDatabaseConnectionValueState;
@@ -1635,6 +1636,30 @@ const RelationalConnectionGeneralEditor = observer(
1635
1636
  }
1636
1637
  };
1637
1638
 
1639
+ // HACKY:
1640
+ if (connection.localMode) {
1641
+ return (
1642
+ <div className="relational-connection-editor">
1643
+ <Panel>
1644
+ <PanelHeader title="general"></PanelHeader>
1645
+ <PanelContent className="relational-connection-editor__general">
1646
+ <PanelFormSection>
1647
+ <div className="panel__content__form__section__header__label">
1648
+ Database type
1649
+ </div>
1650
+ <CustomSelectorInput
1651
+ options={typeOptions}
1652
+ onChange={onTypeChange}
1653
+ value={selectedType}
1654
+ darkMode={true}
1655
+ />
1656
+ </PanelFormSection>
1657
+ </PanelContent>
1658
+ </Panel>
1659
+ </div>
1660
+ );
1661
+ }
1662
+
1638
1663
  return (
1639
1664
  <div className="relational-connection-editor">
1640
1665
  <ResizablePanelGroup orientation="horizontal">
@@ -226,7 +226,7 @@ export const MapperPostProcessorEditor = observer(
226
226
  <BlankPanelContent>
227
227
  {!mappers.length
228
228
  ? 'Add a mapper'
229
- : 'Select a mapper to view'}
229
+ : 'Choose a mapper to view'}
230
230
  </BlankPanelContent>
231
231
  )}
232
232
  {selectedMapper && (
@@ -318,10 +318,7 @@ const GenerationStringPropertyEditor = observer(
318
318
  (props: {
319
319
  property: GenerationProperty;
320
320
  isReadOnly: boolean;
321
- update: (
322
- AbstractGenerationProperty: GenerationProperty,
323
- newValue: PlainObject,
324
- ) => void;
321
+ update: (property: GenerationProperty, newValue: PlainObject) => void;
325
322
  getConfigValue: (name: string) => unknown | undefined;
326
323
  }) => {
327
324
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -356,10 +353,7 @@ const GenerationIntegerPropertyEditor = observer(
356
353
  (props: {
357
354
  property: GenerationProperty;
358
355
  isReadOnly: boolean;
359
- update: (
360
- AbstractGenerationProperty: GenerationProperty,
361
- newValue: PlainObject,
362
- ) => void;
356
+ update: (property: GenerationProperty, newValue: PlainObject) => void;
363
357
  getConfigValue: (name: string) => unknown | undefined;
364
358
  }) => {
365
359
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -395,10 +389,7 @@ const GenerationBooleanPropertyEditor = observer(
395
389
  (props: {
396
390
  property: GenerationProperty;
397
391
  isReadOnly: boolean;
398
- update: (
399
- AbstractGenerationProperty: GenerationProperty,
400
- newValue: PlainObject,
401
- ) => void;
392
+ update: (property: GenerationProperty, newValue: PlainObject) => void;
402
393
  getConfigValue: (name: string) => unknown | undefined;
403
394
  }) => {
404
395
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -425,10 +416,7 @@ const GenerationEnumPropertyEditor = observer(
425
416
  (props: {
426
417
  property: GenerationProperty;
427
418
  isReadOnly: boolean;
428
- update: (
429
- AbstractGenerationProperty: GenerationProperty,
430
- newValue: PlainObject,
431
- ) => void;
419
+ update: (property: GenerationProperty, newValue: PlainObject) => void;
432
420
  getConfigValue: (name: string) => unknown | undefined;
433
421
  }) => {
434
422
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -475,10 +463,7 @@ const GenerationArrayPropertyEditor = observer(
475
463
  (props: {
476
464
  property: GenerationProperty;
477
465
  isReadOnly: boolean;
478
- update: (
479
- AbstractGenerationProperty: GenerationProperty,
480
- newValue: object,
481
- ) => void;
466
+ update: (property: GenerationProperty, newValue: object) => void;
482
467
  getConfigValue: (name: string) => unknown | undefined;
483
468
  }) => {
484
469
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -668,10 +653,7 @@ const GenerationMapPropertyEditor = observer(
668
653
  (props: {
669
654
  property: GenerationProperty;
670
655
  isReadOnly: boolean;
671
- update: (
672
- AbstractGenerationProperty: GenerationProperty,
673
- newValue: object,
674
- ) => void;
656
+ update: (property: GenerationProperty, newValue: object) => void;
675
657
  getConfigValue: (name: string) => unknown | undefined;
676
658
  }) => {
677
659
  const { property, getConfigValue, isReadOnly, update } = props;
@@ -904,10 +886,7 @@ export const GenerationPropertyEditor = observer(
904
886
  property: GenerationProperty;
905
887
  getConfigValue: (name: string) => unknown | undefined;
906
888
  isReadOnly: boolean;
907
- update: (
908
- AbstractGenerationProperty: GenerationProperty,
909
- newValue: object,
910
- ) => void;
889
+ update: (property: GenerationProperty, newValue: object) => void;
911
890
  }) => {
912
891
  const { property, getConfigValue, isReadOnly, update } = props;
913
892
  switch (property.type) {
@@ -510,7 +510,7 @@ export const EnumerationMappingEditor = observer(
510
510
  onClick={showSourceSelectorModal}
511
511
  disabled={isReadOnly}
512
512
  tabIndex={-1}
513
- title="Select a source..."
513
+ title="Choose a source..."
514
514
  >
515
515
  <PencilIcon />
516
516
  </button>
@@ -50,7 +50,7 @@ import {
50
50
  CLASS_PROPERTY_TYPE,
51
51
  getClassPropertyType,
52
52
  } from '../../../../stores/editor/utils/ModelClassifierUtils.js';
53
- import { LambdaEditor } from '@finos/legend-query-builder';
53
+ import { InlineLambdaEditor } from '@finos/legend-query-builder';
54
54
 
55
55
  const SimplePropertyMappingEditor = observer(
56
56
  (props: {
@@ -83,7 +83,7 @@ const SimplePropertyMappingEditor = observer(
83
83
  return (
84
84
  <div className="property-mapping-editor__entry__container">
85
85
  <div ref={drop} className="property-mapping-editor__entry">
86
- <LambdaEditor
86
+ <InlineLambdaEditor
87
87
  className={clsx({ 'lambda-editor--dnd-match': canDrop })}
88
88
  disabled={transformProps.disableTransform}
89
89
  lambdaEditorState={propertyMappingState}
@@ -194,7 +194,7 @@ const EnumerationPropertyMappingEditor = observer(
194
194
  options={options}
195
195
  onChange={handleSelectionChange}
196
196
  value={{ value: transformerLabel, label: transformerLabel }}
197
- placeholder="Select an existing enumeration mapping"
197
+ placeholder="Choose an existing enumeration mapping"
198
198
  />
199
199
  <button
200
200
  className="property-mapping-editor__entry__visit-btn"
@@ -205,7 +205,7 @@ const EnumerationPropertyMappingEditor = observer(
205
205
  <ArrowCircleRightIcon />
206
206
  </button>
207
207
  </div>
208
- <LambdaEditor
208
+ <InlineLambdaEditor
209
209
  className={clsx(
210
210
  'property-mapping-editor__entry__enumeration__transform',
211
211
  { 'lambda-editor--dnd-match': canDrop },
@@ -88,7 +88,7 @@ import {
88
88
  } from '@finos/legend-graph';
89
89
  import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
90
90
  import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../../../stores/extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
91
- import { LambdaEditor } from '@finos/legend-query-builder';
91
+ import { InlineLambdaEditor } from '@finos/legend-query-builder';
92
92
 
93
93
  export const InstanceSetImplementationSourceExplorer = observer(
94
94
  (props: {
@@ -412,14 +412,13 @@ const MappingFilterEditor = observer(
412
412
  })}
413
413
  >
414
414
  <div className="class-mapping-filter-editor__content">
415
- <LambdaEditor
415
+ <InlineLambdaEditor
416
416
  className="class-mapping-filter-editor__element__lambda-editor"
417
417
  disabled={
418
418
  isReadOnly ||
419
419
  instanceSetImplementationState.isConvertingTransformLambdaObjects
420
420
  }
421
421
  forceBackdrop={!!filterState.parserError}
422
- forceExpansion={false}
423
422
  lambdaEditorState={filterState}
424
423
  expectedType={PrimitiveType.BOOLEAN}
425
424
  />
@@ -219,7 +219,7 @@ export const InstanceSetImplementationSourceSelectorModal = observer(
219
219
  options={options}
220
220
  onChange={changeSourceType}
221
221
  value={selectedSourceType}
222
- placeholder={`Select a source...`}
222
+ placeholder="Choose a source..."
223
223
  darkMode={isDarkMode}
224
224
  isClearable={true}
225
225
  filterOption={sourceFilterOption}
@@ -73,7 +73,7 @@ import {
73
73
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
74
74
  import type { MappingEditorTabState } from '../../../../stores/editor/editor-state/element-editor-state/mapping/MappingTabManagerState.js';
75
75
  import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../../../__lib__/LegendStudioDocumentation.js';
76
- import { MappingTestableEditor } from '../../edit-panel/mapping-editor/testable/MappingTestableEditor.js';
76
+ import { MappingTestableEditor } from './MappingTestableEditor.js';
77
77
 
78
78
  export const MappingEditorSplashScreen: React.FC = () => {
79
79
  const logoWidth = 280;
@@ -85,39 +85,39 @@ import {
85
85
  MappingDataTestState,
86
86
  MappingDataTestSuiteState,
87
87
  MappingQueryTestState,
88
- } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js';
88
+ } from '../../../../stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js';
89
89
  import { useApplicationStore } from '@finos/legend-application';
90
90
  import { flowResult } from 'mobx';
91
91
  import {
92
92
  QueryBuilderTextEditorMode,
93
93
  type QueryBuilderState,
94
94
  } from '@finos/legend-query-builder';
95
- import { MappingExecutionQueryBuilderState } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
95
+ import { MappingExecutionQueryBuilderState } from '../../../../stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
96
96
  import {
97
97
  CODE_EDITOR_LANGUAGE,
98
98
  CodeEditor,
99
99
  } from '@finos/legend-lego/code-editor';
100
- import { TESTABLE_TEST_TAB } from '../../../../../stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js';
100
+ import { TESTABLE_TEST_TAB } from '../../../../stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js';
101
101
  import {
102
102
  atomicTest_setDoc,
103
103
  testAssertion_setId,
104
- } from '../../../../../stores/graph-modifier/Testable_GraphModifierHelper.js';
104
+ } from '../../../../stores/graph-modifier/Testable_GraphModifierHelper.js';
105
105
  import {
106
106
  RenameModal,
107
107
  TestAssertionEditor,
108
108
  TestAssertionItem,
109
- } from '../../../editor-group/testable/TestableSharedComponents.js';
110
- import { EmbeddedDataEditor } from '../../../editor-group/data-editor/EmbeddedDataEditor.js';
109
+ } from '../testable/TestableSharedComponents.js';
110
+ import { EmbeddedDataEditor } from '../data-editor/EmbeddedDataEditor.js';
111
111
  import {
112
112
  TESTABLE_RESULT,
113
113
  getTestableResultFromTestResult,
114
- } from '../../../../../stores/editor/sidebar-state/testable/GlobalTestRunnerState.js';
115
- import { getTestableResultIcon } from '../../../side-bar/testable/GlobalTestRunner.js';
116
- import { validateTestableId } from '../../../../../stores/editor/utils/TestableUtils.js';
117
- import { getMappingStores } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js';
118
- import type { DSL_Data_LegendStudioApplicationPlugin_Extension } from '../../../../../stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
119
- import { EmbeddedDataType } from '../../../../../stores/editor/editor-state/ExternalFormatState.js';
120
- import type { EmbeddedDataTypeOption } from '../../../../../stores/editor/editor-state/element-editor-state/data/DataEditorState.js';
114
+ } from '../../../../stores/editor/sidebar-state/testable/GlobalTestRunnerState.js';
115
+ import { getTestableResultIcon } from '../../side-bar/testable/GlobalTestRunner.js';
116
+ import { validateTestableId } from '../../../../stores/editor/utils/TestableUtils.js';
117
+ import { getMappingStores } from '../../../../stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js';
118
+ import type { DSL_Data_LegendStudioApplicationPlugin_Extension } from '../../../../stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
119
+ import { EmbeddedDataType } from '../../../../stores/editor/editor-state/ExternalFormatState.js';
120
+ import type { EmbeddedDataTypeOption } from '../../../../stores/editor/editor-state/element-editor-state/data/DataEditorState.js';
121
121
  import {
122
122
  buildElementOption,
123
123
  type PackageableElementOption,