@finos/legend-application-studio 26.1.1 → 26.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 (188) hide show
  1. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +2 -1
  2. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
  4. package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
  5. package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts +21 -0
  6. package/lib/__lib__/STO_Relational_LegendStudioCommand.d.ts.map +1 -0
  7. package/lib/__lib__/STO_Relational_LegendStudioCommand.js +28 -0
  8. package/lib/__lib__/STO_Relational_LegendStudioCommand.js.map +1 -0
  9. package/lib/application/LegendStudioApplicationConfig.d.ts +5 -0
  10. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  11. package/lib/application/LegendStudioApplicationConfig.js +6 -0
  12. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  13. package/lib/components/ElementIconUtils.d.ts +13 -2
  14. package/lib/components/ElementIconUtils.d.ts.map +1 -1
  15. package/lib/components/ElementIconUtils.js +15 -6
  16. package/lib/components/ElementIconUtils.js.map +1 -1
  17. package/lib/components/editor/Editor.d.ts.map +1 -1
  18. package/lib/components/editor/Editor.js +2 -1
  19. package/lib/components/editor/Editor.js.map +1 -1
  20. package/lib/components/editor/QuickInput.d.ts +19 -0
  21. package/lib/components/editor/QuickInput.d.ts.map +1 -0
  22. package/lib/components/editor/QuickInput.js +51 -0
  23. package/lib/components/editor/QuickInput.js.map +1 -0
  24. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.d.ts.map +1 -1
  25. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js +5 -1
  26. package/lib/components/editor/__test-utils__/EditorComponentTestUtils.js.map +1 -1
  27. package/lib/components/editor/command-center/ProjectSearchCommand.js +3 -3
  28. package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
  29. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  30. package/lib/components/editor/editor-group/EditorGroup.js +11 -4
  31. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  32. package/lib/components/editor/editor-group/FunctionEditor.d.ts.map +1 -1
  33. package/lib/components/editor/editor-group/FunctionEditor.js +30 -8
  34. package/lib/components/editor/editor-group/FunctionEditor.js.map +1 -1
  35. package/lib/components/editor/editor-group/GenerationSpecificationEditor.js +1 -1
  36. package/lib/components/editor/editor-group/GenerationSpecificationEditor.js.map +1 -1
  37. package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
  38. package/lib/components/editor/editor-group/GrammarTextEditor.js +99 -100
  39. package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
  40. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.d.ts.map +1 -1
  41. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js +5 -5
  42. package/lib/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.js.map +1 -1
  43. package/lib/components/editor/editor-group/RuntimeEditor.js +1 -1
  44. package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
  45. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +1 -1
  46. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +27 -19
  47. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
  48. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
  49. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
  50. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js +5 -5
  51. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js.map +1 -1
  52. package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +2 -2
  53. package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
  54. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +1 -1
  55. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
  56. package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js +1 -1
  57. package/lib/components/editor/editor-group/mapping-editor/ClassMappingEditor.js.map +1 -1
  58. package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js +2 -2
  59. package/lib/components/editor/editor-group/mapping-editor/MappingExplorer.js.map +1 -1
  60. package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js +1 -1
  61. package/lib/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.js.map +1 -1
  62. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.d.ts.map +1 -1
  63. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js +4 -6
  64. package/lib/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.js.map +1 -1
  65. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +2 -2
  66. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  67. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
  68. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +2 -2
  69. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  70. package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js +2 -2
  71. package/lib/components/editor/editor-group/uml-editor/AssociationEditor.js.map +1 -1
  72. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js +4 -4
  73. package/lib/components/editor/editor-group/uml-editor/ClassEditor.js.map +1 -1
  74. package/lib/components/editor/panel-group/PanelGroup.d.ts +2 -0
  75. package/lib/components/editor/panel-group/PanelGroup.d.ts.map +1 -1
  76. package/lib/components/editor/panel-group/PanelGroup.js +18 -3
  77. package/lib/components/editor/panel-group/PanelGroup.js.map +1 -1
  78. package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts +26 -0
  79. package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -0
  80. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +339 -0
  81. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -0
  82. package/lib/components/editor/side-bar/Explorer.js +5 -6
  83. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  84. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +1 -1
  85. package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
  86. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
  87. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +5 -1
  88. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
  89. package/lib/index.css +2 -2
  90. package/lib/index.css.map +1 -1
  91. package/lib/package.json +2 -2
  92. package/lib/stores/editor/EditorConfig.d.ts +2 -1
  93. package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
  94. package/lib/stores/editor/EditorConfig.js +1 -0
  95. package/lib/stores/editor/EditorConfig.js.map +1 -1
  96. package/lib/stores/editor/EditorStore.d.ts +8 -2
  97. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  98. package/lib/stores/editor/EditorStore.js +19 -4
  99. package/lib/stores/editor/EditorStore.js.map +1 -1
  100. package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
  101. package/lib/stores/editor/GraphEditFormModeState.js +1 -0
  102. package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
  103. package/lib/stores/editor/QuickInputState.d.ts +28 -0
  104. package/lib/stores/editor/QuickInputState.d.ts.map +1 -0
  105. package/lib/stores/editor/QuickInputState.js +17 -0
  106. package/lib/stores/editor/QuickInputState.js.map +1 -0
  107. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts +22 -2
  108. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.d.ts.map +1 -1
  109. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js +181 -4
  110. package/lib/stores/editor/editor-state/element-editor-state/FunctionEditorState.js.map +1 -1
  111. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.d.ts.map +1 -1
  112. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js +6 -2
  113. package/lib/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js.map +1 -1
  114. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +19 -18
  115. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
  116. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +167 -157
  117. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
  118. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts +3 -3
  119. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.d.ts.map +1 -1
  120. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js +2 -2
  121. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.js.map +1 -1
  122. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts +8 -9
  123. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.d.ts.map +1 -1
  124. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js +9 -14
  125. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
  126. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +4 -4
  127. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  128. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +7 -8
  129. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  130. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +1 -1
  131. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  132. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +3 -1
  133. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  134. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +82 -0
  135. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -0
  136. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +328 -0
  137. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -0
  138. package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts +1 -1
  139. package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.d.ts.map +1 -1
  140. package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js +8 -2
  141. package/lib/stores/graph-modifier/DSL_Service_GraphModifierHelper.js.map +1 -1
  142. package/package.json +12 -12
  143. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +2 -0
  144. package/src/__lib__/STO_Relational_LegendStudioCommand.ts +30 -0
  145. package/src/application/LegendStudioApplicationConfig.ts +7 -0
  146. package/src/components/ElementIconUtils.tsx +23 -8
  147. package/src/components/editor/Editor.tsx +2 -0
  148. package/src/components/editor/QuickInput.tsx +91 -0
  149. package/src/components/editor/__test-utils__/EditorComponentTestUtils.tsx +5 -1
  150. package/src/components/editor/command-center/ProjectSearchCommand.tsx +4 -4
  151. package/src/components/editor/editor-group/EditorGroup.tsx +41 -1
  152. package/src/components/editor/editor-group/FunctionEditor.tsx +145 -5
  153. package/src/components/editor/editor-group/GenerationSpecificationEditor.tsx +1 -1
  154. package/src/components/editor/editor-group/GrammarTextEditor.tsx +134 -131
  155. package/src/components/editor/editor-group/INTERNAL__UnknownFunctionActivatorEdtior.tsx +26 -13
  156. package/src/components/editor/editor-group/RuntimeEditor.tsx +1 -1
  157. package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +193 -150
  158. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +2 -2
  159. package/src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx +6 -5
  160. package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +1 -1
  161. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +1 -1
  162. package/src/components/editor/editor-group/mapping-editor/ClassMappingEditor.tsx +1 -1
  163. package/src/components/editor/editor-group/mapping-editor/MappingExplorer.tsx +2 -2
  164. package/src/components/editor/editor-group/mapping-editor/PropertyMappingsEditor.tsx +1 -1
  165. package/src/components/editor/editor-group/service-editor/ServiceExecutionQueryEditor.tsx +8 -10
  166. package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +2 -2
  167. package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +9 -3
  168. package/src/components/editor/editor-group/uml-editor/AssociationEditor.tsx +2 -2
  169. package/src/components/editor/editor-group/uml-editor/ClassEditor.tsx +4 -4
  170. package/src/components/editor/panel-group/PanelGroup.tsx +35 -3
  171. package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +730 -0
  172. package/src/components/editor/side-bar/Explorer.tsx +5 -5
  173. package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +1 -1
  174. package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +9 -3
  175. package/src/stores/editor/EditorConfig.ts +1 -0
  176. package/src/stores/editor/EditorStore.ts +23 -4
  177. package/src/stores/editor/GraphEditFormModeState.ts +1 -0
  178. package/src/stores/editor/QuickInputState.ts +24 -0
  179. package/src/stores/editor/editor-state/element-editor-state/FunctionEditorState.ts +317 -3
  180. package/src/stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.ts +11 -2
  181. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +262 -249
  182. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +5 -5
  183. package/src/stores/editor/editor-state/element-editor-state/service/ServiceExecutionState.ts +19 -23
  184. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +9 -9
  185. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +4 -2
  186. package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +485 -0
  187. package/src/stores/graph-modifier/DSL_Service_GraphModifierHelper.ts +13 -1
  188. package/tsconfig.json +5 -0
@@ -45,10 +45,19 @@ import {
45
45
  } from '@finos/legend-art';
46
46
  import { PACKAGEABLE_ELEMENT_TYPE } from '../stores/editor/utils/ModelClassifierUtils.js';
47
47
 
48
+ /**
49
+ * NOTE: eventually we would like to remove this function and just a generic mechanism to
50
+ * get element icon given the metamodel, we can also simplify the plugins a lot.
51
+ * Technically, the only time we need to check icon for a type classifier is when we create
52
+ * a new element
53
+ */
48
54
  export const getElementTypeIcon = (
49
- editorStore: EditorStore,
50
55
  type: string | undefined,
51
- element?: PackageableElement | undefined,
56
+ editorStore: EditorStore,
57
+ options?: {
58
+ element?: PackageableElement | undefined;
59
+ returnEmptyForUnknown?: boolean | undefined;
60
+ },
52
61
  ): React.ReactNode => {
53
62
  switch (type) {
54
63
  case PACKAGEABLE_ELEMENT_TYPE.PRIMITIVE:
@@ -98,7 +107,7 @@ export const getElementTypeIcon = (
98
107
  ).getExtraElementIconGetters?.() ?? [],
99
108
  );
100
109
  for (const iconGetter of extraElementIconGetters) {
101
- const elementIcon = iconGetter(type, element);
110
+ const elementIcon = iconGetter(type, options?.element);
102
111
  if (elementIcon) {
103
112
  return elementIcon;
104
113
  }
@@ -107,24 +116,30 @@ export const getElementTypeIcon = (
107
116
  // NOTE: this is temporary until we properly refactor this function to check element instead of
108
117
  // the type classifier value, but to be fair, this is not a bad way to do it since this acts
109
118
  // as a catch all block, we can check for `abstract` element here
110
- if (element instanceof FunctionActivator) {
119
+ if (options?.element instanceof FunctionActivator) {
111
120
  return <LaunchIcon />;
112
121
  }
113
- return <PURE_UnknownElementTypeIcon />;
122
+ return options?.returnEmptyForUnknown ? null : (
123
+ <PURE_UnknownElementTypeIcon />
124
+ );
114
125
  }
115
126
  }
116
127
  };
117
128
 
118
129
  export const getElementIcon = (
119
- editorStore: EditorStore,
120
130
  element: PackageableElement | undefined,
131
+ editorStore: EditorStore,
132
+ options?: { returnEmptyForUnknown?: boolean | undefined },
121
133
  ): React.ReactNode =>
122
134
  getElementTypeIcon(
123
- editorStore,
124
135
  element
125
136
  ? returnUndefOnError(() =>
126
137
  editorStore.graphState.getPackageableElementType(element),
127
138
  )
128
139
  : undefined,
129
- element,
140
+ editorStore,
141
+ {
142
+ element,
143
+ returnEmptyForUnknown: options?.returnEmptyForUnknown,
144
+ },
130
145
  );
@@ -52,6 +52,7 @@ import { WorkspaceSyncConflictResolver } from './side-bar/WorkspaceSyncConflictR
52
52
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../__lib__/LegendStudioApplicationNavigationContext.js';
53
53
  import { EmbeddedQueryBuilder } from '../EmbeddedQueryBuilder.js';
54
54
  import { GRAPH_EDITOR_MODE } from '../../stores/editor/EditorConfig.js';
55
+ import { QuickInput } from './QuickInput.js';
55
56
 
56
57
  export const Editor = withEditorStore(
57
58
  observer(() => {
@@ -240,6 +241,7 @@ export const Editor = withEditorStore(
240
241
  </div>
241
242
  </div>
242
243
  </div>
244
+ <QuickInput />
243
245
  <StatusBar actionsDisabled={!editable} />
244
246
  {editable && <ProjectSearchCommand />}
245
247
  {editorStore.localChangesState.workspaceSyncState
@@ -0,0 +1,91 @@
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 React, { useRef } from 'react';
18
+ import { observer } from 'mobx-react-lite';
19
+ import {
20
+ type SelectComponent,
21
+ NonBlockingDialog,
22
+ createFilter,
23
+ CustomSelectorInput,
24
+ Modal,
25
+ } from '@finos/legend-art';
26
+ import type {
27
+ QuickInputOption,
28
+ QuickInputState,
29
+ } from '../../stores/editor/QuickInputState.js';
30
+ import { useEditorStore } from './EditorStoreProvider.js';
31
+
32
+ function QuickInputDialog<T>(props: {
33
+ quickInputState: QuickInputState<T>;
34
+ }): React.ReactElement {
35
+ const { quickInputState } = props;
36
+ const editorStore = useEditorStore();
37
+ const { placeholder, options, getSearchValue, onSelect } = quickInputState;
38
+ const inputRef = useRef<SelectComponent>(null);
39
+ const close = (): void => editorStore.setQuickInputState(undefined);
40
+
41
+ const filterOption = createFilter({
42
+ ignoreCase: true,
43
+ ignoreAccents: false,
44
+ stringify: (option) => getSearchValue(option),
45
+ });
46
+ const onChange = (value: QuickInputOption<T>): void => {
47
+ onSelect(value);
48
+ close();
49
+ };
50
+ const handleEnter = (): void => {
51
+ inputRef.current?.focus();
52
+ };
53
+
54
+ // TODO: include title and properly style it like vscode quick input
55
+ return (
56
+ <NonBlockingDialog
57
+ open={true}
58
+ onClose={close}
59
+ TransitionProps={{
60
+ onEnter: handleEnter,
61
+ }}
62
+ onClickAway={close}
63
+ classes={{ container: 'search-modal__container' }}
64
+ PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
65
+ >
66
+ <Modal darkMode={true} className="search-modal">
67
+ <div className="quick-input">
68
+ <CustomSelectorInput
69
+ ref={inputRef}
70
+ className="quick-input__input"
71
+ options={options}
72
+ onChange={onChange}
73
+ filterOption={filterOption}
74
+ placeholder={placeholder}
75
+ escapeClearsValue={true}
76
+ darkMode={true}
77
+ menuIsOpen={true}
78
+ />
79
+ </div>
80
+ </Modal>
81
+ </NonBlockingDialog>
82
+ );
83
+ }
84
+
85
+ export const QuickInput = observer(() => {
86
+ const editorStore = useEditorStore();
87
+ if (!editorStore.quickInputState) {
88
+ return null;
89
+ }
90
+ return <QuickInputDialog quickInputState={editorStore.quickInputState} />;
91
+ });
@@ -312,7 +312,11 @@ export const TEST__setUpEditor = async (
312
312
  // we don't need to but we probably should mock the call to get other configurations,
313
313
  // e.g. external format, function activator, etc.
314
314
  const graphManagerState = MOCK__editorStore.graphManagerState;
315
- graphManagerState.graphManager.initialize = createMock();
315
+ await graphManagerState.graphManager.initialize({
316
+ env: 'test',
317
+ tabSize: 2,
318
+ clientConfig: {},
319
+ });
316
320
  createSpy(
317
321
  graphManagerState.graphManager,
318
322
  'getAvailableGenerationConfigurationDescriptions',
@@ -41,7 +41,7 @@ import {
41
41
  export const ProjectSearchCommand = observer(() => {
42
42
  const editorStore = useEditorStore();
43
43
  const selectorRef = useRef<SelectComponent>(null);
44
- const closeModal = (): void => editorStore.searchElementCommandState.close();
44
+ const closeModal = (): void => editorStore.setShowSearchElementCommand(false);
45
45
  const types = editorStore.getSupportedElementTypes();
46
46
  const [elementType, setElementType] = useState<string | undefined>();
47
47
  const changeType =
@@ -89,7 +89,7 @@ export const ProjectSearchCommand = observer(() => {
89
89
 
90
90
  return (
91
91
  <NonBlockingDialog
92
- nonModalDialogState={editorStore.searchElementCommandState}
92
+ open={editorStore.showSearchElementCommand}
93
93
  onClose={closeModal}
94
94
  TransitionProps={{
95
95
  onEnter: handleEnter,
@@ -117,7 +117,7 @@ export const ProjectSearchCommand = observer(() => {
117
117
  className="project-search-command__option"
118
118
  onClick={changeType(type)}
119
119
  >
120
- {getElementTypeIcon(editorStore, type)}
120
+ {getElementTypeIcon(type, editorStore)}
121
121
  </MenuContentItem>
122
122
  ))}
123
123
  </MenuContent>
@@ -125,7 +125,7 @@ export const ProjectSearchCommand = observer(() => {
125
125
  >
126
126
  <div className="project-search-command__type__label">
127
127
  {elementType ? (
128
- getElementTypeIcon(editorStore, elementType)
128
+ getElementTypeIcon(elementType, editorStore)
129
129
  ) : (
130
130
  <MoreHorizontalIcon />
131
131
  )}
@@ -24,6 +24,7 @@ import {
24
24
  PlusIcon,
25
25
  ArrowsAltHIcon,
26
26
  useResizeDetector,
27
+ GenericTextFileIcon,
27
28
  } from '@finos/legend-art';
28
29
  import { MappingEditor } from './mapping-editor/MappingEditor.js';
29
30
  import { UMLEditor } from './uml-editor/UMLEditor.js';
@@ -75,6 +76,7 @@ import { ElementXTGenerationEditor } from './element-generation-editor/ElementXT
75
76
  import { TabManager, type TabState } from '@finos/legend-lego/application';
76
77
  import { INTERNAL__UnknownFunctionActivatorEdtiorState } from '../../../stores/editor/editor-state/element-editor-state/INTERNAL__UnknownFunctionActivatorEditorState.js';
77
78
  import { INTERNAL__UnknownFunctionActivatorEdtior } from './INTERNAL__UnknownFunctionActivatorEdtior.js';
79
+ import { getElementIcon } from '../../ElementIconUtils.js';
78
80
 
79
81
  export const ViewerEditorGroupSplashScreen: React.FC = () => {
80
82
  const commandListWidth = 300;
@@ -322,6 +324,15 @@ export const EditorGroup = observer(() => {
322
324
  if (editorState instanceof EntityDiffViewState) {
323
325
  return (
324
326
  <div className="diff-tab">
327
+ <div className="diff-tab__element-icon">
328
+ {editorState.element ? (
329
+ getElementIcon(editorState.element, editorStore, {
330
+ returnEmptyForUnknown: true,
331
+ }) ?? <GenericTextFileIcon />
332
+ ) : (
333
+ <GenericTextFileIcon />
334
+ )}
335
+ </div>
325
336
  <div className="diff-tab__element-name">{editorState.label}</div>
326
337
  <div className="diff-tab__text">
327
338
  ({getPrettyLabelForRevision(editorState.fromRevision)}
@@ -337,6 +348,9 @@ export const EditorGroup = observer(() => {
337
348
  } else if (editorState instanceof EntityChangeConflictEditorState) {
338
349
  return (
339
350
  <div className="diff-tab">
351
+ <div className="diff-tab__element-icon">
352
+ <GenericTextFileIcon />
353
+ </div>
340
354
  <div className="diff-tab__element-name">{editorState.label}</div>
341
355
  <div className="diff-tab__text">
342
356
  {editorState.isReadOnly ? '(Merge Preview)' : '(Merged)'}
@@ -344,7 +358,33 @@ export const EditorGroup = observer(() => {
344
358
  </div>
345
359
  );
346
360
  }
347
- return editorState.label;
361
+
362
+ return (
363
+ <div className="editor-group__header__tab">
364
+ <div className="editor-group__header__tab__icon">
365
+ {editorState instanceof ElementEditorState ? (
366
+ getElementIcon(editorState.element, editorStore, {
367
+ returnEmptyForUnknown: true,
368
+ }) ?? <GenericTextFileIcon />
369
+ ) : (
370
+ <GenericTextFileIcon />
371
+ )}
372
+ </div>
373
+ <div className="editor-group__header__tab__label">
374
+ {editorState.label}
375
+ </div>
376
+ {editorState instanceof ElementEditorState &&
377
+ editorStore.tabManagerState.tabs.filter(
378
+ (tab) =>
379
+ tab instanceof ElementEditorState &&
380
+ tab.label === editorState.label,
381
+ ).length > 1 && (
382
+ <div className="editor-group__header__tab__path">
383
+ {editorState.element.path}
384
+ </div>
385
+ )}
386
+ </div>
387
+ );
348
388
  };
349
389
 
350
390
  if (!currentTabState) {
@@ -58,6 +58,8 @@ import {
58
58
  MenuContent,
59
59
  MenuContentItem,
60
60
  Modal,
61
+ PauseCircleIcon,
62
+ PlayIcon,
61
63
  } from '@finos/legend-art';
62
64
  import { LEGEND_STUDIO_TEST_ID } from '../../../__lib__/LegendStudioTesting.js';
63
65
  import {
@@ -124,11 +126,19 @@ import {
124
126
  rawVariableExpression_setType,
125
127
  } from '../../../stores/graph-modifier/RawValueSpecificationGraphModifierHelper.js';
126
128
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../__lib__/LegendStudioApplicationNavigationContext.js';
127
- import { LambdaEditor } from '@finos/legend-query-builder';
129
+ import {
130
+ ExecutionPlanViewer,
131
+ LambdaEditor,
132
+ LambdaParameterValuesEditor,
133
+ } from '@finos/legend-query-builder';
128
134
  import type { EditorStore } from '../../../stores/editor/EditorStore.js';
129
135
  import { graph_renameElement } from '../../../stores/graph-modifier/GraphModifierHelper.js';
130
136
  import { ProtocolValueBuilder } from './ProtocolValueBuilder.js';
131
137
  import type { ProtocolValueBuilderState } from '../../../stores/editor/editor-state/element-editor-state/ProtocolValueBuilderState.js';
138
+ import {
139
+ CODE_EDITOR_LANGUAGE,
140
+ CodeEditor,
141
+ } from '@finos/legend-lego/code-editor';
132
142
 
133
143
  enum FUNCTION_PARAMETER_TYPE {
134
144
  CLASS = 'CLASS',
@@ -360,7 +370,7 @@ const ParameterBasicEditor = observer(
360
370
  >
361
371
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
362
372
  <div className="property-basic-editor__type__abbr">
363
- {getElementIcon(editorStore, paramType)}
373
+ {getElementIcon(paramType, editorStore)}
364
374
  </div>
365
375
  )}
366
376
  <div className="property-basic-editor__type__label">
@@ -398,7 +408,7 @@ const ParameterBasicEditor = observer(
398
408
  >
399
409
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
400
410
  <div className="property-basic-editor__type__abbr">
401
- {getElementIcon(editorStore, paramType)}
411
+ {getElementIcon(paramType, editorStore)}
402
412
  </div>
403
413
  )}
404
414
  <div className="property-basic-editor__type__label">
@@ -555,7 +565,7 @@ const ReturnTypeEditor = observer(
555
565
  >
556
566
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
557
567
  <div className="property-basic-editor__type__abbr">
558
- {getElementIcon(editorStore, returnType.value)}
568
+ {getElementIcon(returnType.value, editorStore)}
559
569
  </div>
560
570
  )}
561
571
  <div className="property-basic-editor__type__label">
@@ -593,7 +603,7 @@ const ReturnTypeEditor = observer(
593
603
  >
594
604
  {typeName !== FUNCTION_PARAMETER_TYPE.PRIMITIVE && (
595
605
  <div className="property-basic-editor__type__abbr">
596
- {getElementIcon(editorStore, returnType.value)}
606
+ {getElementIcon(returnType.value, editorStore)}
597
607
  </div>
598
608
  )}
599
609
  <div className="property-basic-editor__type__label">
@@ -862,6 +872,47 @@ const FunctionActivatorContentBuilder = observer(
862
872
  },
863
873
  );
864
874
 
875
+ const ExecutionResultViewer = observer(
876
+ (props: { functionEditorState: FunctionEditorState }) => {
877
+ const { functionEditorState } = props;
878
+ // execution
879
+ const executionResultText = functionEditorState.executionResultText;
880
+ const closeExecutionResultViewer = (): void =>
881
+ functionEditorState.setExecutionResultText(undefined);
882
+
883
+ return (
884
+ <Dialog
885
+ open={Boolean(executionResultText)}
886
+ onClose={closeExecutionResultViewer}
887
+ classes={{
888
+ root: 'editor-modal__root-container',
889
+ container: 'editor-modal__container',
890
+ paper: 'editor-modal__content',
891
+ }}
892
+ >
893
+ <Modal darkMode={true} className="editor-modal">
894
+ <ModalHeader title="Execution Result" />
895
+ <ModalBody>
896
+ <CodeEditor
897
+ inputValue={executionResultText ?? ''}
898
+ isReadOnly={true}
899
+ language={CODE_EDITOR_LANGUAGE.JSON}
900
+ />
901
+ </ModalBody>
902
+ <ModalFooter>
903
+ <button
904
+ className="btn modal__footer__close-btn btn--dark"
905
+ onClick={closeExecutionResultViewer}
906
+ >
907
+ Close
908
+ </button>
909
+ </ModalFooter>
910
+ </Modal>
911
+ </Dialog>
912
+ );
913
+ },
914
+ );
915
+
865
916
  export const FunctionEditor = observer(() => {
866
917
  const editorStore = useEditorStore();
867
918
  const applicationStore = useApplicationStore();
@@ -968,6 +1019,25 @@ export const FunctionEditor = observer(() => {
968
1019
  );
969
1020
  };
970
1021
 
1022
+ const runQuery = applicationStore.guardUnhandledError(() =>
1023
+ flowResult(functionEditorState.handleRunQuery()),
1024
+ );
1025
+
1026
+ const executionIsRunning =
1027
+ functionEditorState.isRunningQuery || functionEditorState.isGeneratingPlan;
1028
+
1029
+ const cancelQuery = applicationStore.guardUnhandledError(() =>
1030
+ flowResult(functionEditorState.cancelQuery()),
1031
+ );
1032
+
1033
+ const generatePlan = applicationStore.guardUnhandledError(() =>
1034
+ flowResult(functionEditorState.generatePlan(false)),
1035
+ );
1036
+
1037
+ const debugPlanGeneration = applicationStore.guardUnhandledError(() =>
1038
+ flowResult(functionEditorState.generatePlan(true)),
1039
+ );
1040
+
971
1041
  useEffect(() => {
972
1042
  flowResult(
973
1043
  functionEditorState.functionDefinitionEditorState.convertLambdaObjectToGrammarString(
@@ -1012,6 +1082,61 @@ export const FunctionEditor = observer(() => {
1012
1082
  ))}
1013
1083
  </div>
1014
1084
  <div className="panel__header__actions">
1085
+ {functionEditorState.isRunningQuery ? (
1086
+ <button
1087
+ className="function-editor__execution__stop-btn"
1088
+ onClick={cancelQuery}
1089
+ tabIndex={-1}
1090
+ >
1091
+ <div className="btn--dark btn--caution function-editor__execution__stop-btn__label">
1092
+ <PauseCircleIcon className="function-editor__execution__stop-btn__label__icon" />
1093
+ <div className="function-editor__execution__stop-btn__label__title">
1094
+ Stop
1095
+ </div>
1096
+ </div>
1097
+ </button>
1098
+ ) : (
1099
+ <div className="function-editor__execution__action-btn">
1100
+ <button
1101
+ className="function-editor__execution__action-btn__label"
1102
+ onClick={runQuery}
1103
+ title="Run Query"
1104
+ disabled={executionIsRunning}
1105
+ tabIndex={-1}
1106
+ >
1107
+ <PlayIcon className="function-editor__execution__action-btn__label__icon" />
1108
+ <div className="function-editor__execution__action-btn__label__title">
1109
+ Run Query
1110
+ </div>
1111
+ </button>
1112
+ <DropdownMenu
1113
+ className="function-editor__execution__action-btn__dropdown-btn"
1114
+ disabled={executionIsRunning}
1115
+ content={
1116
+ <MenuContent>
1117
+ <MenuContentItem
1118
+ className="function-editor__execution__action-btn__option"
1119
+ onClick={generatePlan}
1120
+ >
1121
+ Generate Plan
1122
+ </MenuContentItem>
1123
+ <MenuContentItem
1124
+ className="function-editor__execution__action-btn__option"
1125
+ onClick={debugPlanGeneration}
1126
+ >
1127
+ Debug
1128
+ </MenuContentItem>
1129
+ </MenuContent>
1130
+ }
1131
+ menuProps={{
1132
+ anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
1133
+ transformOrigin: { vertical: 'top', horizontal: 'right' },
1134
+ }}
1135
+ >
1136
+ <CaretDownIcon />
1137
+ </DropdownMenu>
1138
+ </div>
1139
+ )}
1015
1140
  {editorStore.applicationStore.config.options
1016
1141
  .TEMPORARY__enableFunctionActivatorSupport && (
1017
1142
  <>
@@ -1203,6 +1328,21 @@ export const FunctionEditor = observer(() => {
1203
1328
  ))}
1204
1329
  </div>
1205
1330
  )}
1331
+ <ExecutionPlanViewer
1332
+ executionPlanState={functionEditorState.executionPlanState}
1333
+ />
1334
+ <ExecutionResultViewer functionEditorState={functionEditorState} />
1335
+ {functionEditorState.parametersState.parameterValuesEditorState
1336
+ .showModal && (
1337
+ <LambdaParameterValuesEditor
1338
+ graph={functionEditorState.editorStore.graphManagerState.graph}
1339
+ observerContext={
1340
+ functionEditorState.editorStore.changeDetectionState
1341
+ .observerContext
1342
+ }
1343
+ lambdaParametersState={functionEditorState.parametersState}
1344
+ />
1345
+ )}
1206
1346
  </PanelContent>
1207
1347
  </Panel>
1208
1348
  </div>
@@ -187,7 +187,7 @@ const ModelGenerationItem = observer(
187
187
  showPlaceholder={isBeingDragged}
188
188
  >
189
189
  <div className="btn--sm generation-spec-model-generation-editor__item__label">
190
- {getElementIcon(editorStore, modelGeneration)}
190
+ {getElementIcon(modelGeneration, editorStore)}
191
191
  </div>
192
192
  <input
193
193
  className={clsx('generation-spec-model-generation-editor__item__id', {