@finos/legend-application-studio 27.0.0 → 27.1.1

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 (176) hide show
  1. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts +9 -1
  2. package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioApplicationNavigationContext.js +11 -1
  4. package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
  5. package/lib/__lib__/LegendStudioEvent.d.ts +1 -0
  6. package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioEvent.js +1 -0
  8. package/lib/__lib__/LegendStudioEvent.js.map +1 -1
  9. package/lib/application/LegendStudioApplicationConfig.d.ts +6 -0
  10. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  11. package/lib/application/LegendStudioApplicationConfig.js +7 -0
  12. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  13. package/lib/components/ElementIconUtils.d.ts.map +1 -1
  14. package/lib/components/ElementIconUtils.js +3 -1
  15. package/lib/components/ElementIconUtils.js.map +1 -1
  16. package/lib/components/editor/editor-group/ModelImporter.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/ModelImporter.js +1 -0
  18. package/lib/components/editor/editor-group/ModelImporter.js.map +1 -1
  19. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.d.ts.map +1 -1
  20. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js +8 -10
  21. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilder.js.map +1 -1
  22. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
  23. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js +10 -4
  24. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js.map +1 -1
  25. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
  26. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +65 -12
  27. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
  28. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.d.ts.map +1 -1
  29. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js +3 -0
  30. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.js.map +1 -1
  31. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.d.ts.map +1 -1
  32. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +3 -0
  33. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
  34. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.d.ts.map +1 -1
  35. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js +3 -0
  36. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.js.map +1 -1
  37. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts +1 -1
  38. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  39. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +101 -137
  40. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  41. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js +1 -2
  42. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js.map +1 -1
  43. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  44. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +9 -4
  45. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  46. package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts +11 -0
  47. package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts.map +1 -1
  48. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +27 -2
  49. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
  50. package/lib/components/editor/panel-group/SQLPlaygroundPanel.d.ts.map +1 -1
  51. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js +38 -6
  52. package/lib/components/editor/panel-group/SQLPlaygroundPanel.js.map +1 -1
  53. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts +3 -0
  54. package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
  55. package/lib/components/editor/side-bar/CreateNewElementModal.js +43 -1
  56. package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
  57. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
  58. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +10 -0
  59. package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
  60. package/lib/index.css +2 -2
  61. package/lib/index.css.map +1 -1
  62. package/lib/package.json +1 -1
  63. package/lib/stores/editor/EditorGraphState.js +1 -1
  64. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  65. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  66. package/lib/stores/editor/EditorStore.js +10 -2
  67. package/lib/stores/editor/EditorStore.js.map +1 -1
  68. package/lib/stores/editor/NewElementState.d.ts +0 -1
  69. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  70. package/lib/stores/editor/NewElementState.js +43 -10
  71. package/lib/stores/editor/NewElementState.js.map +1 -1
  72. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +0 -1
  73. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
  74. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +26 -30
  75. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
  76. package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.d.ts +2 -2
  77. package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.d.ts.map +1 -1
  78. package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.js +2 -2
  79. package/lib/stores/editor/editor-state/element-editor-state/data/DataEditorState.js.map +1 -1
  80. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts +14 -19
  81. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts.map +1 -1
  82. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js +30 -65
  83. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js.map +1 -1
  84. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +4 -1
  85. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
  86. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +5 -1
  87. package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
  88. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +56 -78
  89. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  90. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +285 -384
  91. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  92. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts +23 -0
  93. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -0
  94. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +129 -0
  95. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -0
  96. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  97. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +2 -2
  98. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  99. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +1 -0
  100. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  101. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +12 -2
  102. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  103. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  104. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +15 -8
  105. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  106. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts +7 -4
  107. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts.map +1 -1
  108. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js +53 -10
  109. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js.map +1 -1
  110. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +2 -1
  111. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  112. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +20 -16
  113. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  114. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts +9 -0
  115. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.d.ts.map +1 -1
  116. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js +149 -3
  117. package/lib/stores/editor/panel-group/SQLPlaygroundPanelState.js.map +1 -1
  118. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts +1 -1
  119. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
  120. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js +3 -0
  121. package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
  122. package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
  123. package/lib/stores/editor/utils/MockDataUtils.js +3 -0
  124. package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
  125. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +2 -5
  126. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
  127. package/lib/stores/editor/utils/ModelClassifierUtils.js +2 -6
  128. package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
  129. package/lib/stores/editor/utils/TestableUtils.d.ts +11 -1
  130. package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
  131. package/lib/stores/editor/utils/TestableUtils.js +50 -1
  132. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  133. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.d.ts +5 -4
  134. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.d.ts.map +1 -1
  135. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js +4 -1
  136. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
  137. package/package.json +6 -6
  138. package/src/__lib__/LegendStudioApplicationNavigationContext.ts +12 -1
  139. package/src/__lib__/LegendStudioEvent.ts +1 -1
  140. package/src/application/LegendStudioApplicationConfig.ts +8 -0
  141. package/src/components/ElementIconUtils.tsx +3 -0
  142. package/src/components/editor/editor-group/ModelImporter.tsx +4 -0
  143. package/src/components/editor/editor-group/connection-editor/DatabaseBuilder.tsx +12 -13
  144. package/src/components/editor/editor-group/data-editor/EmbeddedDataEditor.tsx +45 -38
  145. package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +140 -31
  146. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx +7 -0
  147. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +6 -0
  148. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx +6 -0
  149. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +296 -414
  150. package/src/components/editor/editor-group/mapping-editor/NewMappingElementModal.tsx +1 -1
  151. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +12 -7
  152. package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +88 -3
  153. package/src/components/editor/panel-group/SQLPlaygroundPanel.tsx +104 -18
  154. package/src/components/editor/side-bar/CreateNewElementModal.tsx +111 -1
  155. package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +10 -0
  156. package/src/stores/editor/EditorGraphState.ts +1 -1
  157. package/src/stores/editor/EditorStore.ts +29 -17
  158. package/src/stores/editor/NewElementState.ts +109 -21
  159. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +33 -40
  160. package/src/stores/editor/editor-state/element-editor-state/data/DataEditorState.ts +7 -1
  161. package/src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts +48 -77
  162. package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +5 -1
  163. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +407 -617
  164. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +243 -0
  165. package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +6 -2
  166. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +18 -1
  167. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +20 -12
  168. package/src/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.ts +76 -18
  169. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +29 -24
  170. package/src/stores/editor/panel-group/SQLPlaygroundPanelState.ts +224 -1
  171. package/src/stores/editor/sidebar-state/testable/GlobalTestRunnerState.ts +4 -1
  172. package/src/stores/editor/utils/MockDataUtils.ts +2 -0
  173. package/src/stores/editor/utils/ModelClassifierUtils.ts +2 -6
  174. package/src/stores/editor/utils/TestableUtils.ts +73 -0
  175. package/src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts +15 -12
  176. package/tsconfig.json +1 -0
@@ -31,6 +31,7 @@ import {
31
31
  createEnumerationMapping,
32
32
  getAllMappingElements,
33
33
  MappingEditorState,
34
+ BASIC_SET_IMPLEMENTATION_TYPE,
34
35
  } from '../../../../stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js';
35
36
  import {
36
37
  guaranteeNonNullable,
@@ -45,7 +46,6 @@ import {
45
46
  Association,
46
47
  PrimitiveType,
47
48
  } from '@finos/legend-graph';
48
- import { BASIC_SET_IMPLEMENTATION_TYPE } from '../../../../stores/editor/utils/ModelClassifierUtils.js';
49
49
  import {
50
50
  buildElementOption,
51
51
  getPackageableElementOptionFormatter,
@@ -158,6 +158,14 @@ export const ExternalFormatParameterEditorModal = observer(
158
158
  updateParamValue,
159
159
  bindingParamPair,
160
160
  } = props;
161
+ const paramValue =
162
+ paramState.varExpression.genericType?.value.rawType === PrimitiveType.BYTE
163
+ ? atob(
164
+ (paramState.valueSpec as PrimitiveInstanceValue)
165
+ .values[0] as string,
166
+ )
167
+ : ((paramState.valueSpec as PrimitiveInstanceValue)
168
+ .values[0] as string);
161
169
  return (
162
170
  <Dialog
163
171
  open={true}
@@ -177,10 +185,7 @@ export const ExternalFormatParameterEditorModal = observer(
177
185
  <div className="service-test-editor__setup__parameter__code-editor__container__content">
178
186
  <CodeEditor
179
187
  key={paramState.uuid}
180
- inputValue={
181
- (paramState.valueSpec as PrimitiveInstanceValue)
182
- .values[0] as string
183
- }
188
+ inputValue={paramValue}
184
189
  updateInput={updateParamValue}
185
190
  isReadOnly={isReadOnly}
186
191
  language={
@@ -225,14 +230,14 @@ const ServiceTestParameterEditor = observer(
225
230
  const type = bindingParamPair
226
231
  ? bindingParamPair.binding.contentType
227
232
  : paramState.varExpression.genericType?.value.rawType.name ?? 'unknown';
228
- const paramValue = (
233
+ const paramValue =
229
234
  paramState.varExpression.genericType?.value.rawType === PrimitiveType.BYTE
230
235
  ? atob(
231
236
  (paramState.valueSpec as PrimitiveInstanceValue)
232
237
  .values[0] as string,
233
238
  )
234
- : (paramState.valueSpec as PrimitiveInstanceValue).values[0]
235
- ) as string;
239
+ : ((paramState.valueSpec as PrimitiveInstanceValue)
240
+ .values[0] as string);
236
241
 
237
242
  const openInPopUp = (): void => setShowPopUp(!showPopUp);
238
243
  const closePopUp = (): void => setShowPopUp(false);
@@ -18,6 +18,7 @@ import {
18
18
  clsx,
19
19
  CompareIcon,
20
20
  ContextMenu,
21
+ CustomSelectorInput,
21
22
  Dialog,
22
23
  MenuContent,
23
24
  MenuContentItem,
@@ -34,7 +35,7 @@ import {
34
35
  RefreshIcon,
35
36
  WrenchIcon,
36
37
  } from '@finos/legend-art';
37
- import { TestError } from '@finos/legend-graph';
38
+ import { type DataElement, TestError } from '@finos/legend-graph';
38
39
  import {
39
40
  prettyCONSTName,
40
41
  tryToFormatLosslessJSONString,
@@ -61,6 +62,86 @@ import {
61
62
  import { forwardRef, useState } from 'react';
62
63
  import type { TestableTestEditorState } from '../../../../stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js';
63
64
  import { getTestableResultIcon } from '../../side-bar/testable/GlobalTestRunner.js';
65
+ import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
66
+ import {
67
+ buildElementOption,
68
+ getPackageableElementOptionFormatter,
69
+ } from '@finos/legend-lego/graph-editor';
70
+
71
+ export const SharedDataElementModal = observer(
72
+ (props: {
73
+ filterBy?: (val: DataElement) => boolean;
74
+ handler: (val: DataElement) => void;
75
+ editorStore: EditorStore;
76
+ isReadOnly: boolean;
77
+ close: () => void;
78
+ }) => {
79
+ const { filterBy, isReadOnly, close, editorStore, handler } = props;
80
+ const dataElements =
81
+ editorStore.graphManagerState.graph.dataElements.filter((e) =>
82
+ filterBy ? filterBy(e) : true,
83
+ );
84
+ const [dataElement, setDataElement] = useState(dataElements[0]);
85
+ const dataElementOptions =
86
+ editorStore.graphManagerState.usableDataElements.map(buildElementOption);
87
+ const selectedDataElement = dataElement
88
+ ? buildElementOption(dataElement)
89
+ : null;
90
+ const onDataElementChange = (val: {
91
+ label: string;
92
+ value?: DataElement;
93
+ }): void => {
94
+ if (val.value !== selectedDataElement?.value && val.value) {
95
+ setDataElement(val.value);
96
+ }
97
+ };
98
+ const change = (): void => {
99
+ if (dataElement) {
100
+ handler(dataElement);
101
+ }
102
+ close();
103
+ };
104
+ return (
105
+ <Dialog
106
+ open={true}
107
+ onClose={close}
108
+ classes={{ container: 'search-modal__container' }}
109
+ PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
110
+ >
111
+ <Modal darkMode={true} className="service-test-data-modal">
112
+ <ModalBody>
113
+ <div className="panel__content__form__section">
114
+ <div className="panel__content__form__section__header__label">
115
+ Data Element
116
+ </div>
117
+ <div className="explorer__new-element-modal__driver">
118
+ <CustomSelectorInput
119
+ className="panel__content__form__section__dropdown data-element-reference-editor__value__dropdown"
120
+ disabled={false}
121
+ options={dataElementOptions}
122
+ onChange={onDataElementChange}
123
+ formatOptionLabel={getPackageableElementOptionFormatter({})}
124
+ value={selectedDataElement}
125
+ darkMode={true}
126
+ />
127
+ </div>
128
+ </div>
129
+ </ModalBody>
130
+ <ModalFooter>
131
+ <ModalFooterButton
132
+ className="database-builder__action--btn"
133
+ disabled={isReadOnly}
134
+ onClick={change}
135
+ title="Change to use Data Element"
136
+ >
137
+ Change
138
+ </ModalFooterButton>
139
+ </ModalFooter>
140
+ </Modal>
141
+ </Dialog>
142
+ );
143
+ },
144
+ );
64
145
 
65
146
  export const RenameModal = observer(
66
147
  (props: {
@@ -438,6 +519,10 @@ export const TestAssertionEditor = observer(
438
519
  const { testAssertionState } = props;
439
520
  const selectedTab = testAssertionState.selectedTab;
440
521
  const isReadOnly = testAssertionState.testState.isReadOnly;
522
+ const isDisabled =
523
+ isReadOnly ||
524
+ !testAssertionState.assertionState.supportsGeneratingAssertion ||
525
+ testAssertionState.generatingExpectedAction.isInProgress;
441
526
  const changeTab = (val: TEST_ASSERTION_TAB): void =>
442
527
  testAssertionState.setSelectedTab(val);
443
528
  const renderContent = (state: TestAssertionState): React.ReactNode => {
@@ -484,7 +569,7 @@ export const TestAssertionEditor = observer(
484
569
  className="panel__header__action service-execution-editor__test-data__generate-btn"
485
570
  onClick={generate}
486
571
  title="Generate expected result if possible"
487
- disabled={isReadOnly}
572
+ disabled={isDisabled}
488
573
  tabIndex={-1}
489
574
  >
490
575
  <div className="service-execution-editor__test-data__generate-btn__label">
@@ -497,7 +582,7 @@ export const TestAssertionEditor = observer(
497
582
  </div>
498
583
  </div>
499
584
  <div className="testable-test-assertion-editor__content">
500
- {selectedTab === TEST_ASSERTION_TAB.SETUP && (
585
+ {selectedTab === TEST_ASSERTION_TAB.EXPECTED && (
501
586
  <div className="testable-test-assertion-editor__setup">
502
587
  {renderContent(testAssertionState.assertionState)}
503
588
  </div>
@@ -20,7 +20,6 @@ import {
20
20
  ResizablePanelGroup,
21
21
  ResizablePanel,
22
22
  ResizablePanelSplitter,
23
- clsx,
24
23
  TreeView,
25
24
  PURE_DatabaseSchemaIcon,
26
25
  PURE_DatabaseTableIcon,
@@ -38,6 +37,11 @@ import {
38
37
  PanelLoadingIndicator,
39
38
  BlankPanelContent,
40
39
  TrashIcon,
40
+ CircleIcon,
41
+ CheckCircleIcon,
42
+ EmptyCircleIcon,
43
+ PURE_DatabaseIcon,
44
+ SyncIcon,
41
45
  } from '@finos/legend-art';
42
46
  import React, { useCallback, useEffect, useRef, useState } from 'react';
43
47
  import {
@@ -119,11 +123,15 @@ const DatabaseSchemaExplorerTreeNodeContainer: React.FC<
119
123
  TreeNodeContainerProps<
120
124
  DatabaseSchemaExplorerTreeNodeData,
121
125
  {
122
- // empty
126
+ toggleCheckedNode: (node: DatabaseSchemaExplorerTreeNodeData) => void;
127
+ isPartiallySelected: (
128
+ node: DatabaseSchemaExplorerTreeNodeData,
129
+ ) => boolean;
123
130
  }
124
131
  >
125
132
  > = (props) => {
126
- const { node, level, stepPaddingInRem, onNodeSelect } = props;
133
+ const { node, level, stepPaddingInRem, onNodeSelect, innerProps } = props;
134
+ const { toggleCheckedNode, isPartiallySelected } = innerProps;
127
135
  const isExpandable =
128
136
  Boolean(!node.childrenIds || node.childrenIds.length) &&
129
137
  !(node instanceof DatabaseSchemaExplorerTreeColumnNodeData);
@@ -154,9 +162,22 @@ const DatabaseSchemaExplorerTreeNodeContainer: React.FC<
154
162
  node instanceof DatabaseSchemaExplorerTreeColumnNodeData &&
155
163
  node.owner.primaryKey.includes(node.column);
156
164
 
165
+ const renderCheckedIcon = (
166
+ _node: DatabaseSchemaExplorerTreeNodeData,
167
+ ): React.ReactNode => {
168
+ if (_node instanceof DatabaseSchemaExplorerTreeColumnNodeData) {
169
+ return null;
170
+ } else if (isPartiallySelected(_node)) {
171
+ return <CircleIcon />;
172
+ } else if (_node.isChecked) {
173
+ return <CheckCircleIcon />;
174
+ }
175
+ return <EmptyCircleIcon />;
176
+ };
177
+
157
178
  return (
158
179
  <div
159
- className={clsx('tree-view__node__container')}
180
+ className="tree-view__node__container"
160
181
  style={{
161
182
  paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
162
183
  display: 'flex',
@@ -168,6 +189,15 @@ const DatabaseSchemaExplorerTreeNodeContainer: React.FC<
168
189
  <div className="sql-playground__database-schema-explorer-tree__expand-icon">
169
190
  {nodeExpandIcon}
170
191
  </div>
192
+ <div
193
+ className="sql-playground__database-schema-explorer-tree__toggle-icon"
194
+ onClick={(event) => {
195
+ event.stopPropagation();
196
+ toggleCheckedNode(node);
197
+ }}
198
+ >
199
+ {renderCheckedIcon(node)}
200
+ </div>
171
201
  <div className="sql-playground__database-schema-explorer-tree__type-icon">
172
202
  {nodeTypeIcon}
173
203
  </div>
@@ -215,13 +245,36 @@ export const DatabaseSchemaExplorer = observer(
215
245
  .getChildNodes(node, treeData)
216
246
  ?.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
217
247
 
248
+ const isPartiallySelected = (
249
+ node: DatabaseSchemaExplorerTreeNodeData,
250
+ ): boolean => {
251
+ if (
252
+ node instanceof DatabaseSchemaExplorerTreeSchemaNodeData &&
253
+ !node.isChecked
254
+ ) {
255
+ return Boolean(
256
+ playgroundState
257
+ .getChildNodes(node, treeData)
258
+ ?.find((childNode) => childNode.isChecked === true),
259
+ );
260
+ }
261
+ return false;
262
+ };
263
+
264
+ const toggleCheckedNode = (
265
+ node: DatabaseSchemaExplorerTreeNodeData,
266
+ ): void => playgroundState.toggleCheckedNode(node, treeData);
267
+
218
268
  return (
219
269
  <TreeView
220
270
  className="sql-playground__database-schema-explorer-tree"
221
271
  components={{
222
272
  TreeNodeContainer: DatabaseSchemaExplorerTreeNodeContainer,
223
273
  }}
224
- innerProps={{}}
274
+ innerProps={{
275
+ toggleCheckedNode,
276
+ isPartiallySelected,
277
+ }}
225
278
  treeData={treeData}
226
279
  onNodeSelect={onNodeSelect}
227
280
  getChildNodes={getChildNodes}
@@ -647,6 +700,10 @@ export const SQLPlaygroundPanel = observer(() => {
647
700
  [handleConnectionDrop],
648
701
  );
649
702
 
703
+ const updateDatabase = applicationStore.guardUnhandledError(() =>
704
+ flowResult(playgroundState.updateDatabase()),
705
+ );
706
+
650
707
  useEffect(() => {
651
708
  flowResult(playgroundState.fetchDatabaseMetadata()).catch(
652
709
  applicationStore.alertUnhandledError,
@@ -668,20 +725,49 @@ export const SQLPlaygroundPanel = observer(() => {
668
725
  <ResizablePanelGroup orientation="vertical">
669
726
  <ResizablePanel size={300}>
670
727
  <div className="sql-playground__config">
671
- <div className="sql-playground__config__connection-selector">
672
- <div className="sql-playground__config__connection-selector__icon">
673
- <PURE_ConnectionIcon />
728
+ <div className="sql-playground__config__setup">
729
+ <div className="sql-playground__config__connection-selector">
730
+ <div className="sql-playground__config__connection-selector__icon">
731
+ <PURE_ConnectionIcon />
732
+ </div>
733
+ <CustomSelectorInput
734
+ ref={connectionSelectorRef}
735
+ className="sql-playground__config__connection-selector__input"
736
+ options={connectionOptions}
737
+ onChange={changeConnection}
738
+ value={selectedConnectionOption}
739
+ darkMode={true}
740
+ placeholder="Choose a connection..."
741
+ filterOption={connectionFilterOption}
742
+ />
743
+ </div>
744
+ <div className="sql-playground__config__database-selector">
745
+ <div className="sql-playground__config__database-selector__icon">
746
+ <PURE_DatabaseIcon />
747
+ </div>
748
+ <CustomSelectorInput
749
+ ref={connectionSelectorRef}
750
+ className="sql-playground__config__database-selector__input"
751
+ options={connectionOptions}
752
+ onChange={changeConnection}
753
+ value={selectedConnectionOption}
754
+ darkMode={true}
755
+ placeholder="Choose a connection..."
756
+ filterOption={connectionFilterOption}
757
+ />
758
+ <button
759
+ className="sql-playground__config__database-selector__update-btn btn--sm btn--dark"
760
+ disabled={
761
+ !playgroundState.database ||
762
+ playgroundState.isBuildingDatabase ||
763
+ playgroundState.isUpdatingDatabase
764
+ }
765
+ onClick={updateDatabase}
766
+ title="Update database"
767
+ >
768
+ <SyncIcon />
769
+ </button>
674
770
  </div>
675
- <CustomSelectorInput
676
- ref={connectionSelectorRef}
677
- className="sql-playground__config__connection-selector__input"
678
- options={connectionOptions}
679
- onChange={changeConnection}
680
- value={selectedConnectionOption}
681
- darkMode={true}
682
- placeholder="Choose a connection..."
683
- filterOption={connectionFilterOption}
684
- />
685
771
  </div>
686
772
  <div className="sql-playground__config__schema-explorer">
687
773
  {playgroundState.treeData && (
@@ -81,6 +81,8 @@ export const getElementTypeLabel = (
81
81
  return 'generation specification';
82
82
  case PACKAGEABLE_ELEMENT_TYPE.DATA:
83
83
  return 'data';
84
+ case PACKAGEABLE_ELEMENT_TYPE.TEMPORARY__LOCAL_CONNECTION:
85
+ return 'local connection';
84
86
  default: {
85
87
  if (type) {
86
88
  const extraElementTypeLabelGetters = editorStore.pluginManager
@@ -436,7 +438,115 @@ const renderNewElementDriver = (
436
438
  }
437
439
  };
438
440
 
439
- // TODO: investigate the potential approach of VSCode to have inline input in the tree to create element quickly
441
+ export const CreateNewLocalConnectionModal = observer(() => {
442
+ const editorStore = useEditorStore();
443
+ const applicationStore = useApplicationStore();
444
+ const newElementState = editorStore.newElementState;
445
+ const selectedPackage = newElementState.selectedPackage;
446
+ // Name
447
+ const name = newElementState.name;
448
+ const handleNameChange: React.ChangeEventHandler<HTMLInputElement> = (
449
+ event,
450
+ ) => newElementState.setName(event.target.value);
451
+ const elementNameInputRef = useRef<HTMLInputElement>(null);
452
+ // Type
453
+ const typeOptions = ([PACKAGEABLE_ELEMENT_TYPE.PACKAGE] as string[])
454
+ .concat(editorStore.getSupportedElementTypes())
455
+ .filter(
456
+ // NOTE: we can only create package in root
457
+ (type) =>
458
+ selectedPackage !== editorStore.graphManagerState.graph.root ||
459
+ type === PACKAGEABLE_ELEMENT_TYPE.PACKAGE,
460
+ )
461
+ .map(buildElementTypeOption);
462
+
463
+ const selectedTypeOption = buildElementTypeOption(newElementState.type);
464
+ const handleTypeChange = (val: ElementTypeSelectOption): void =>
465
+ newElementState.setElementType(val.value);
466
+ // Submit button
467
+ const closeModal = (): void => newElementState.closeModal();
468
+ const [packagePath, elementName] = resolvePackageAndElementName(
469
+ selectedPackage,
470
+ selectedPackage === editorStore.graphManagerState.graph.root,
471
+ name,
472
+ );
473
+ const resolvedPackage =
474
+ editorStore.graphManagerState.graph.getNullablePackage(packagePath);
475
+ const needsToOverride = Boolean(
476
+ resolvedPackage?.children.find((child) => child.name === elementName),
477
+ );
478
+ const isDisabled = !name || needsToOverride || !newElementState.isValid;
479
+ const save = applicationStore.guardUnhandledError(() =>
480
+ flowResult(newElementState.save()),
481
+ );
482
+ const handleEnter = (): void => {
483
+ newElementState.setName('');
484
+ elementNameInputRef.current?.focus();
485
+ };
486
+
487
+ if (!newElementState.showModal) {
488
+ return null;
489
+ }
490
+ return (
491
+ <Dialog
492
+ open={newElementState.showModal}
493
+ onClose={closeModal}
494
+ TransitionProps={{
495
+ onEnter: handleEnter,
496
+ }}
497
+ classes={{ container: 'search-modal__container' }}
498
+ PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
499
+ >
500
+ <form
501
+ data-testid={LEGEND_STUDIO_TEST_ID.NEW_ELEMENT_MODAL}
502
+ onSubmit={(event) => {
503
+ event.preventDefault();
504
+ save();
505
+ }}
506
+ className="modal modal--dark search-modal"
507
+ >
508
+ <div className="modal__title">
509
+ {`Create a New ${
510
+ getElementTypeLabel(editorStore, newElementState.type) ?? 'element'
511
+ }`}
512
+ </div>
513
+ <div>
514
+ {newElementState.showType && (
515
+ <CustomSelectorInput
516
+ options={typeOptions}
517
+ disabled={typeOptions.length === 1}
518
+ onChange={handleTypeChange}
519
+ value={selectedTypeOption}
520
+ isClearable={false}
521
+ darkMode={true}
522
+ />
523
+ )}
524
+ <input
525
+ className="input--dark explorer__new-element-modal__name-input"
526
+ ref={elementNameInputRef}
527
+ spellCheck={false}
528
+ value={name}
529
+ onChange={handleNameChange}
530
+ placeholder={`Enter a name, use ${ELEMENT_PATH_DELIMITER} to create new package(s) for the ${
531
+ getElementTypeLabel(editorStore, newElementState.type) ??
532
+ 'element'
533
+ }`}
534
+ />
535
+ {renderNewElementDriver(newElementState.type, editorStore)}
536
+ </div>
537
+ <div className="search-modal__actions">
538
+ <button type="button" className="btn btn--dark" onClick={closeModal}>
539
+ Cancel
540
+ </button>
541
+ <button className="btn btn--dark" disabled={isDisabled}>
542
+ Create
543
+ </button>
544
+ </div>
545
+ </form>
546
+ </Dialog>
547
+ );
548
+ });
549
+
440
550
  export const CreateNewElementModal = observer(() => {
441
551
  const editorStore = useEditorStore();
442
552
  const applicationStore = useApplicationStore();
@@ -133,6 +133,16 @@ export class Core_LegendStudioApplicationPlugin extends LegendStudioApplicationP
133
133
  LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.CONNECTION_EDITOR,
134
134
  LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.DATABASE_BUILDER,
135
135
  LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SERVICE_EDITOR,
136
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.DATA_ELEMENT_EDITOR,
137
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.MAPPING_EDITOR,
138
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.RUNTIME_EDITOR,
139
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.BINDING_EDITOR,
140
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SCHEMA_SET_EDITOR,
141
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SCHEMA_SET_MODEL_GENERATION,
142
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_RELATIONAL_EDITOR,
143
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_EXTERNAL_FORMAT_EDITOR,
144
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_DATA_ELEMENT_REFERENCE_EDITOR,
145
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_MODEL_STORE_EDITOR,
136
146
  ];
137
147
  }
138
148
 
@@ -860,6 +860,6 @@ export class EditorGraphState {
860
860
  return label;
861
861
  }
862
862
  }
863
- return PACKAGEABLE_ELEMENT_TYPE.UNKNOWN;
863
+ return PACKAGEABLE_ELEMENT_TYPE.INTERNAL__UNKNOWN;
864
864
  }
865
865
  }
@@ -929,25 +929,37 @@ export class EditorStore implements CommandRegistrar {
929
929
  PACKAGEABLE_ELEMENT_TYPE.ASSOCIATION,
930
930
  PACKAGEABLE_ELEMENT_TYPE.FUNCTION,
931
931
  PACKAGEABLE_ELEMENT_TYPE.MEASURE,
932
- PACKAGEABLE_ELEMENT_TYPE.MAPPING,
933
- PACKAGEABLE_ELEMENT_TYPE.RUNTIME,
934
- PACKAGEABLE_ELEMENT_TYPE.CONNECTION,
935
- PACKAGEABLE_ELEMENT_TYPE.SERVICE,
936
- PACKAGEABLE_ELEMENT_TYPE.GENERATION_SPECIFICATION,
937
- PACKAGEABLE_ELEMENT_TYPE.FILE_GENERATION,
938
- PACKAGEABLE_ELEMENT_TYPE.FLAT_DATA_STORE,
939
- PACKAGEABLE_ELEMENT_TYPE.DATABASE,
940
- PACKAGEABLE_ELEMENT_TYPE.DATA,
941
932
  ] as string[]
942
933
  ).concat(
943
- this.pluginManager
944
- .getApplicationPlugins()
945
- .flatMap(
946
- (plugin) =>
947
- (
948
- plugin as DSL_LegendStudioApplicationPlugin_Extension
949
- ).getExtraSupportedElementTypes?.() ?? [],
950
- ),
934
+ (
935
+ [
936
+ PACKAGEABLE_ELEMENT_TYPE.MAPPING,
937
+ PACKAGEABLE_ELEMENT_TYPE.RUNTIME,
938
+ PACKAGEABLE_ELEMENT_TYPE.CONNECTION,
939
+ PACKAGEABLE_ELEMENT_TYPE.SERVICE,
940
+ PACKAGEABLE_ELEMENT_TYPE.GENERATION_SPECIFICATION,
941
+ PACKAGEABLE_ELEMENT_TYPE.FILE_GENERATION,
942
+ PACKAGEABLE_ELEMENT_TYPE.FLAT_DATA_STORE,
943
+ PACKAGEABLE_ELEMENT_TYPE.DATABASE,
944
+ PACKAGEABLE_ELEMENT_TYPE.DATA,
945
+ this.applicationStore.config.options
946
+ .TEMPORARY__enableLocalConnectionBuilder
947
+ ? PACKAGEABLE_ELEMENT_TYPE.TEMPORARY__LOCAL_CONNECTION
948
+ : undefined,
949
+ ] as (string | undefined)[]
950
+ )
951
+ .filter(isNonNullable)
952
+ .concat(
953
+ this.pluginManager
954
+ .getApplicationPlugins()
955
+ .flatMap(
956
+ (plugin) =>
957
+ (
958
+ plugin as DSL_LegendStudioApplicationPlugin_Extension
959
+ ).getExtraSupportedElementTypes?.() ?? [],
960
+ ),
961
+ )
962
+ .sort((a, b) => a.localeCompare(b)),
951
963
  );
952
964
  }
953
965