@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "27.0.0",
3
+ "version": "27.1.1",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,11 +45,11 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-application": "15.0.24",
49
- "@finos/legend-art": "7.0.24",
50
- "@finos/legend-graph": "30.0.9",
51
- "@finos/legend-lego": "1.1.0",
52
- "@finos/legend-query-builder": "4.0.13",
48
+ "@finos/legend-application": "15.0.25",
49
+ "@finos/legend-art": "7.0.25",
50
+ "@finos/legend-graph": "30.0.10",
51
+ "@finos/legend-lego": "1.1.2",
52
+ "@finos/legend-query-builder": "4.1.1",
53
53
  "@finos/legend-server-depot": "6.0.16",
54
54
  "@finos/legend-server-sdlc": "5.0.17",
55
55
  "@finos/legend-shared": "10.0.15",
@@ -23,6 +23,7 @@ export enum LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY {
23
23
  EDITOR = 'studio.editor',
24
24
 
25
25
  MODEL_LOADER = 'studio.editor.model-loader',
26
+ MODEL_LOADER_EXTERNAL_FORMAT_IMPORTER = 'studio.editor.model-loader-external-format-importer',
26
27
  TEXT_MODE_EDITOR = 'studio.editor.text-mode-editor',
27
28
  EMBEDDED_QUERY_BUILDER = 'studio.editor.embedded-query-builder',
28
29
 
@@ -56,7 +57,17 @@ export enum LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY {
56
57
  SERVICE_EDITOR_EXECUTION = 'studio.editor.service-editor.execution',
57
58
  SERVICE_EDITOR_TEST = 'studio.editor.service-editor.test',
58
59
 
60
+ SQL_PLAYGROUND = 'studio.editor.panel-group.sql-playground',
61
+
62
+ // DataElement/Embedded data
59
63
  DATA_ELEMENT_EDITOR = 'studio.editor.data-element-editor',
64
+ EMBEDDED_DATA_RELATIONAL_EDITOR = 'studio.editor.embedded-data-relational-editor',
65
+ EMBEDDED_DATA_EXTERNAL_FORMAT_EDITOR = 'studio.editor.embedded-data-external-format-editor',
66
+ EMBEDDED_DATA_DATA_ELEMENT_REFERENCE_EDITOR = 'studio.editor.embedded-data-data-element-reference-editor',
67
+ EMBEDDED_DATA_MODEL_STORE_EDITOR = 'studio.editor.embedded-data-model-store-editor',
60
68
 
61
- SQL_PLAYGROUND = 'studio.editor.panel-group.sql-playground',
69
+ // external format
70
+ SCHEMA_SET_EDITOR = 'dsl-external-format.studio.editor.schema-set-editor',
71
+ SCHEMA_SET_MODEL_GENERATION = 'dsl-external-format.studio.editor.schema-set-model-generation',
72
+ BINDING_EDITOR = 'dsl-external-format.studio.editor.binding-editor',
62
73
  }
@@ -35,7 +35,7 @@ export enum LEGEND_STUDIO_APP_EVENT {
35
35
  SERVICE_TEST_SETUP_FAILURE = 'editor.service-editor.test-setup.failure',
36
36
  GENERATION_FAILURE = 'editor.generation.failure',
37
37
  EXTERNAL_FORMAT_FAILURE = 'editor.external-format.failure',
38
-
38
+ MAPPING_TEST_FAILURE = 'editor.mapping-editor.test-runner.failure',
39
39
  // SDLC
40
40
  // TODO: consider to split this generic errors into more specific events
41
41
  SDLC_MANAGER_FAILURE = 'sdlc.manager.failure',
@@ -74,6 +74,13 @@ class LegendStudioApplicationCoreOptions {
74
74
  */
75
75
  TEMPORARY__enableFunctionActivatorSupport = false;
76
76
 
77
+ /**
78
+ * This flag can be removed when the support for local connection is official
79
+ * Right now it's done to support the SnowflakeApp creation demo
80
+ * See https://github.com/finos/legend-engine/pull/1819
81
+ */
82
+ TEMPORARY__enableLocalConnectionBuilder = false;
83
+
77
84
  /**
78
85
  * This flag can be removed when the support for raw SQL execution is official
79
86
  * See https://github.com/finos/legend-engine/pull/1841
@@ -110,6 +117,7 @@ class LegendStudioApplicationCoreOptions {
110
117
  TEMPORARY__preserveSectionIndex: optional(primitive()),
111
118
  TEMPORARY__enableFunctionActivatorSupport: optional(primitive()),
112
119
  TEMPORARY__enableRawSQLExecutor: optional(primitive()),
120
+ TEMPORARY__enableLocalConnectionBuilder: optional(primitive()),
113
121
  TEMPORARY__enableMappingTestableEditor: optional(primitive()),
114
122
  TEMPORARY__serviceRegistrationConfig: list(
115
123
  object(ServiceRegistrationEnvironmentConfig),
@@ -42,6 +42,7 @@ import {
42
42
  PURE_PackageIcon,
43
43
  PURE_DataIcon,
44
44
  LaunchIcon,
45
+ LinkIcon,
45
46
  } from '@finos/legend-art';
46
47
  import { PACKAGEABLE_ELEMENT_TYPE } from '../stores/editor/utils/ModelClassifierUtils.js';
47
48
 
@@ -88,6 +89,8 @@ export const getElementTypeIcon = (
88
89
  return <PURE_ServiceIcon />;
89
90
  case PACKAGEABLE_ELEMENT_TYPE.CONNECTION:
90
91
  return <PURE_ConnectionIcon />;
92
+ case PACKAGEABLE_ELEMENT_TYPE.TEMPORARY__LOCAL_CONNECTION:
93
+ return <LinkIcon />;
91
94
  case PACKAGEABLE_ELEMENT_TYPE.RUNTIME:
92
95
  return <PURE_RuntimeIcon />;
93
96
  case PACKAGEABLE_ELEMENT_TYPE.FILE_GENERATION:
@@ -100,6 +100,10 @@ const ExternalFormatModelImporterEditor = observer(
100
100
  </BlankPanelContent>
101
101
  );
102
102
  };
103
+
104
+ useApplicationNavigationContext(
105
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.MODEL_LOADER_EXTERNAL_FORMAT_IMPORTER,
106
+ );
103
107
  return (
104
108
  <Panel className="schema-set-panel">
105
109
  <PanelContent className="model-loader">
@@ -22,7 +22,6 @@ import {
22
22
  ResizablePanel,
23
23
  ResizablePanelSplitter,
24
24
  PanelLoadingIndicator,
25
- clsx,
26
25
  TreeView,
27
26
  PURE_DatabaseSchemaIcon,
28
27
  PURE_DatabaseTableIcon,
@@ -139,7 +138,7 @@ const DatabaseBuilderTreeNodeContainer = observer(
139
138
 
140
139
  return (
141
140
  <div
142
- className={clsx('tree-view__node__container')}
141
+ className="tree-view__node__container"
143
142
  style={{
144
143
  paddingLeft: `${level * (stepPaddingInRem ?? 1)}rem`,
145
144
  display: 'flex',
@@ -151,7 +150,7 @@ const DatabaseBuilderTreeNodeContainer = observer(
151
150
  {nodeExpandIcon}
152
151
  </div>
153
152
  <div
154
- className={clsx('database-builder-tree__checker-icon')}
153
+ className="database-builder-tree__checker-icon"
155
154
  onClick={(event) => {
156
155
  event.stopPropagation();
157
156
  toggleCheckedNode(node);
@@ -198,6 +197,13 @@ export const DatabaseBuilderExplorer = observer(
198
197
  );
199
198
  };
200
199
 
200
+ const getChildNodes = (
201
+ node: DatabaseBuilderTreeNodeData,
202
+ ): DatabaseBuilderTreeNodeData[] =>
203
+ databaseBuilderState
204
+ .getChildNodes(node, treeData)
205
+ ?.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
206
+
201
207
  const isPartiallySelected = (
202
208
  node: DatabaseBuilderTreeNodeData,
203
209
  ): boolean => {
@@ -208,22 +214,15 @@ export const DatabaseBuilderExplorer = observer(
208
214
  return Boolean(
209
215
  databaseBuilderState
210
216
  .getChildNodes(node, treeData)
211
- ?.find((s) => s.isChecked === true),
217
+ ?.find((childNode) => childNode.isChecked === true),
212
218
  );
213
219
  }
214
220
  return false;
215
221
  };
216
222
 
217
- const getChildNodes = (
218
- node: DatabaseBuilderTreeNodeData,
219
- ): DatabaseBuilderTreeNodeData[] =>
220
- databaseBuilderState
221
- .getChildNodes(node, treeData)
222
- ?.sort((a, b) => a.label.localeCompare(b.label)) ?? [];
223
-
224
- const toggleCheckedNode = (node: DatabaseBuilderTreeNodeData): void => {
223
+ const toggleCheckedNode = (node: DatabaseBuilderTreeNodeData): void =>
225
224
  databaseBuilderState.toggleCheckedNode(node, treeData);
226
- };
225
+
227
226
  return (
228
227
  <TreeView
229
228
  className="database-builder-tree"
@@ -62,6 +62,8 @@ import {
62
62
  import { RelationalCSVDataEditor } from './RelationalCSVDataEditor.js';
63
63
  import { CodeEditor } from '@finos/legend-lego/code-editor';
64
64
  import { getEditorLanguageForFormat } from '../../../../stores/editor/editor-state/ArtifactGenerationViewerState.js';
65
+ import { useApplicationNavigationContext } from '@finos/legend-application';
66
+ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
65
67
 
66
68
  export const ExternalFormatDataEditor = observer(
67
69
  (props: {
@@ -92,6 +94,9 @@ export const ExternalFormatDataEditor = observer(
92
94
  ),
93
95
  );
94
96
  const format = (): void => externalFormatDataState.format();
97
+ useApplicationNavigationContext(
98
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_EXTERNAL_FORMAT_EDITOR,
99
+ );
95
100
  return (
96
101
  <div className="panel external-format-data-editor">
97
102
  <div className="external-format-data-editor__header">
@@ -147,16 +152,14 @@ export const ExternalFormatDataEditor = observer(
147
152
  </DropdownMenu>
148
153
  </div>
149
154
  </div>
150
- <div className={clsx('external-format-data-editor__content')}>
151
- <div className="external-format-data-editor__content__input">
152
- <CodeEditor
153
- language={language}
154
- inputValue={externalFormatDataState.embeddedData.data}
155
- updateInput={changeData}
156
- hideGutter={true}
157
- />
158
- </div>
159
- </div>
155
+ <PanelContent className="model-loader__editor">
156
+ <CodeEditor
157
+ language={language}
158
+ inputValue={externalFormatDataState.embeddedData.data}
159
+ updateInput={changeData}
160
+ hideGutter={true}
161
+ />
162
+ </PanelContent>
160
163
  </div>
161
164
  );
162
165
  },
@@ -184,6 +187,9 @@ export const DataElementReferenceDataEditor = observer(
184
187
  };
185
188
  const visitData = (): void =>
186
189
  editorStore.graphEditorMode.openElement(dataElement);
190
+ useApplicationNavigationContext(
191
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_DATA_ELEMENT_REFERENCE_EDITOR,
192
+ );
187
193
  return (
188
194
  <div className="panel data-element-reference-editor">
189
195
  <div className="data-element-reference-editor__header">
@@ -240,6 +246,7 @@ export const ModelEmbeddedDataEditor = observer(
240
246
  }) => {
241
247
  const { isReadOnly, modelStoreDataState, modelDataState } = props;
242
248
  const modelData = modelDataState.modelData;
249
+ const hideClass = modelStoreDataState.hideClass;
243
250
  const classSelectorRef = useRef<SelectComponent>(null);
244
251
  const elementFilterOption = createFilter({
245
252
  ignoreCase: true,
@@ -271,34 +278,32 @@ export const ModelEmbeddedDataEditor = observer(
271
278
  };
272
279
 
273
280
  return (
274
- <div>
275
- <div className="sample-data-generator__controller">
276
- <div
277
- className="sample-data-generator__controller__icon"
278
- title="class"
279
- >
280
- <PURE_ClassIcon />
281
+ <>
282
+ {!hideClass && (
283
+ <div className="sample-data-generator__controller">
284
+ <div
285
+ className="sample-data-generator__controller__icon"
286
+ title="class"
287
+ >
288
+ <PURE_ClassIcon />
289
+ </div>
290
+ <CustomSelectorInput
291
+ ref={classSelectorRef}
292
+ className="sample-data-generator__controller__class-selector"
293
+ options={classOptions}
294
+ onChange={changeClass}
295
+ value={selectedClassOption}
296
+ darkMode={true}
297
+ filterOption={elementFilterOption}
298
+ formatOptionLabel={getPackageableElementOptionFormatter({
299
+ darkMode: true,
300
+ })}
301
+ />
281
302
  </div>
282
- <CustomSelectorInput
283
- ref={classSelectorRef}
284
- className="sample-data-generator__controller__class-selector"
285
- options={classOptions}
286
- onChange={changeClass}
287
- value={selectedClassOption}
288
- darkMode={true}
289
- filterOption={elementFilterOption}
290
- formatOptionLabel={getPackageableElementOptionFormatter({
291
- darkMode: true,
292
- })}
293
- />
294
- </div>
295
- <div>
296
- {renderEmbeddedDataEditor(
297
- modelDataState.embeddedDataState,
298
- isReadOnly,
299
- )}
300
- </div>
301
- </div>
303
+ )}
304
+
305
+ {renderEmbeddedDataEditor(modelDataState.embeddedDataState, isReadOnly)}
306
+ </>
302
307
  );
303
308
  },
304
309
  );
@@ -309,7 +314,9 @@ export const ModelStoreDataEditor = observer(
309
314
  isReadOnly: boolean;
310
315
  }) => {
311
316
  const { isReadOnly, modelStoreDataState } = props;
312
-
317
+ useApplicationNavigationContext(
318
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_MODEL_STORE_EDITOR,
319
+ );
313
320
  return (
314
321
  <div className="panel connection-editor">
315
322
  {modelStoreDataState.modelDataStates.map((_modelDataState) => {
@@ -18,6 +18,7 @@ import {
18
18
  BlankPanelPlaceholder,
19
19
  clsx,
20
20
  ContextMenu,
21
+ CustomSelectorInput,
21
22
  Dialog,
22
23
  MenuContent,
23
24
  MenuContentItem,
@@ -26,6 +27,7 @@ import {
26
27
  ModalFooter,
27
28
  ModalFooterButton,
28
29
  ModalHeader,
30
+ PanelFormBooleanField,
29
31
  PlusIcon,
30
32
  ResizablePanel,
31
33
  ResizablePanelGroup,
@@ -33,7 +35,11 @@ import {
33
35
  ResizablePanelSplitterLine,
34
36
  UploadIcon,
35
37
  } from '@finos/legend-art';
36
- import type { RelationalCSVDataTable } from '@finos/legend-graph';
38
+ import {
39
+ type Table,
40
+ getAllTablesFromDatabase,
41
+ RelationalCSVDataTable,
42
+ } from '@finos/legend-graph';
37
43
  import { observer } from 'mobx-react-lite';
38
44
  import { forwardRef, useState } from 'react';
39
45
  import type { RelationalCSVDataState } from '../../../../stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js';
@@ -41,22 +47,92 @@ import {
41
47
  CODE_EDITOR_LANGUAGE,
42
48
  CodeEditor,
43
49
  } from '@finos/legend-lego/code-editor';
50
+ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
51
+ import { useApplicationNavigationContext } from '@finos/legend-application';
52
+ import {
53
+ relationalData_addTable,
54
+ relationalData_setTableName,
55
+ relationalData_setTableSchemaName,
56
+ } from '../../../../stores/graph-modifier/DSL_Data_GraphModifierHelper.js';
57
+ import { createMockDataForMappingElementSource } from '../../../../stores/editor/utils/MockDataUtils.js';
44
58
 
45
- const RelationalTableIdentifierModal = observer(
59
+ interface TableOption {
60
+ value: Table;
61
+ label: string;
62
+ }
63
+
64
+ const RelationalTableIdentifierEditor = observer(
46
65
  (props: { dataState: RelationalCSVDataState; isReadOnly: boolean }) => {
47
66
  const { isReadOnly, dataState } = props;
48
- const tableIdentifierState = dataState.tableIdentifierState;
49
- const editableTable = tableIdentifierState.table;
67
+ const resolvedDb = dataState.database;
68
+ const existingDataTable = dataState.tableToEdit;
69
+
70
+ // table
71
+ const [schemaName, setSchemaName] = useState<string | undefined>(
72
+ existingDataTable?.schema,
73
+ );
74
+ const [tableName, setTableName] = useState<string | undefined>(
75
+ existingDataTable?.table,
76
+ );
77
+ // selectors if db provided
78
+ const tables = resolvedDb
79
+ ? getAllTablesFromDatabase(resolvedDb)
80
+ : undefined;
81
+ const [dbTable, setDbTable] = useState<Table | undefined>(tables?.[0]);
82
+ const [includeBare, setIncludeBare] = useState(true);
83
+ const showFullPath = resolvedDb && resolvedDb.schemas.length > 2;
84
+ const tableOptions =
85
+ tables?.map((_t) => ({
86
+ label: showFullPath ? `${_t.schema.name}.${_t.name}` : `${_t.name}`,
87
+ value: _t,
88
+ })) ?? [];
89
+ const onTableChange = (val: TableOption | null): void => {
90
+ setDbTable(val?.value);
91
+ };
92
+ const selectedTable = dbTable
93
+ ? {
94
+ label: showFullPath
95
+ ? `${dbTable.schema.name}.${dbTable.name}`
96
+ : `${dbTable.name}`,
97
+ value: dbTable,
98
+ }
99
+ : undefined;
50
100
  const closeModal = (): void => dataState.closeModal();
51
- const changeTableValue: React.ChangeEventHandler<HTMLInputElement> = (
101
+ const changeSchemaValue: React.ChangeEventHandler<HTMLInputElement> = (
52
102
  event,
53
103
  ) => {
54
- tableIdentifierState.setTableName(event.target.value);
104
+ setSchemaName(event.target.value);
55
105
  };
56
- const changeSchemaValue: React.ChangeEventHandler<HTMLInputElement> = (
106
+ const changeTableValue: React.ChangeEventHandler<HTMLInputElement> = (
57
107
  event,
58
108
  ) => {
59
- tableIdentifierState.setSchemaName(event.target.value);
109
+ setTableName(event.target.value);
110
+ };
111
+ const toggleIncludeBare = (): void => {
112
+ setIncludeBare(!includeBare);
113
+ };
114
+ const useSelector = resolvedDb && !existingDataTable;
115
+ const isDisabled = useSelector ? !dbTable : !(schemaName && tableName);
116
+
117
+ const handleSubmit = (): void => {
118
+ const newTable = new RelationalCSVDataTable();
119
+ newTable.values = '';
120
+ const editTable = existingDataTable ?? newTable;
121
+ const _schemaName = useSelector ? dbTable?.schema.name : schemaName;
122
+ const _name = useSelector ? dbTable?.name : tableName;
123
+ relationalData_setTableSchemaName(editTable, _schemaName ?? '');
124
+ relationalData_setTableName(editTable, _name ?? '');
125
+ if (!existingDataTable && dbTable && includeBare) {
126
+ editTable.values = createMockDataForMappingElementSource(
127
+ dbTable,
128
+ dataState.editorStore,
129
+ );
130
+ }
131
+ if (!existingDataTable) {
132
+ relationalData_addTable(dataState.embeddedData, editTable);
133
+ dataState.changeSelectedTable(editTable);
134
+ }
135
+ closeModal();
60
136
  };
61
137
  return (
62
138
  <Dialog
@@ -68,42 +144,71 @@ const RelationalTableIdentifierModal = observer(
68
144
  <form
69
145
  onSubmit={(event) => {
70
146
  event.preventDefault();
71
- tableIdentifierState.handleSubmit();
147
+ handleSubmit();
72
148
  closeModal();
73
149
  }}
74
150
  className="modal modal--dark search-modal"
75
151
  >
76
152
  <div className="modal__title">
77
- {editableTable
153
+ {existingDataTable
78
154
  ? 'Rename Relational Data Table'
79
155
  : 'Add Relational Data Table'}
80
156
  </div>
81
157
  <div className="relational-data-editor__identifier">
82
- <div className="relational-data-editor__identifier__values">
83
- <input
84
- className="panel__content__form__section__input"
85
- disabled={isReadOnly}
86
- placeholder="schemaName"
87
- value={tableIdentifierState.schemaName}
88
- onChange={changeSchemaValue}
89
- />
90
- </div>
91
- <div className="relational-data-editor__identifier__values">
92
- <input
93
- className="relational-data-editor__identifier__values panel__content__form__section__input"
94
- disabled={isReadOnly}
95
- placeholder="tableName"
96
- value={tableIdentifierState.tableName}
97
- onChange={changeTableValue}
98
- />
99
- </div>
158
+ {resolvedDb && !existingDataTable ? (
159
+ <>
160
+ <div className="panel__content__form__section">
161
+ <div className="panel__content__form__section__header__label">
162
+ Table
163
+ </div>
164
+ <div className="explorer__new-element-modal__driver">
165
+ <CustomSelectorInput
166
+ className="explorer__new-element-modal__driver__dropdown"
167
+ options={tableOptions}
168
+ onChange={onTableChange}
169
+ value={selectedTable}
170
+ isClearable={false}
171
+ darkMode={true}
172
+ />
173
+ </div>
174
+ </div>
175
+ <PanelFormBooleanField
176
+ isReadOnly={isReadOnly}
177
+ value={includeBare}
178
+ name="Include Columns and First Row"
179
+ prompt="Will include table columns and first row using table definition"
180
+ update={toggleIncludeBare}
181
+ />
182
+ </>
183
+ ) : (
184
+ <>
185
+ <div className="relational-data-editor__identifier__values">
186
+ <input
187
+ className="panel__content__form__section__input"
188
+ disabled={isReadOnly}
189
+ placeholder="schemaName"
190
+ value={schemaName}
191
+ onChange={changeSchemaValue}
192
+ />
193
+ </div>
194
+ <div className="relational-data-editor__identifier__values">
195
+ <input
196
+ className="relational-data-editor__identifier__values panel__content__form__section__input"
197
+ disabled={isReadOnly}
198
+ placeholder="tableName"
199
+ value={tableName}
200
+ onChange={changeTableValue}
201
+ />
202
+ </div>
203
+ </>
204
+ )}
100
205
  </div>
101
206
  <div className="search-modal__actions">
102
207
  <button
103
208
  className="btn btn--dark"
104
- disabled={tableIdentifierState.isEditingDisabled || isReadOnly}
209
+ disabled={isDisabled || isReadOnly}
105
210
  >
106
- {editableTable ? 'Rename' : 'Add'}
211
+ {existingDataTable ? 'Rename' : 'Add'}
107
212
  </button>
108
213
  </div>
109
214
  </form>
@@ -199,6 +304,10 @@ export const RelationalCSVDataEditor = observer(
199
304
  const isTableActive = (table: RelationalCSVDataTable): boolean =>
200
305
  currentTableState?.table === table;
201
306
  const showCSVModal = (): void => dataState.setShowImportCsvModal(true);
307
+
308
+ useApplicationNavigationContext(
309
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EMBEDDED_DATA_RELATIONAL_EDITOR,
310
+ );
202
311
  return (
203
312
  <ResizablePanelGroup orientation="vertical">
204
313
  <ResizablePanel minSize={30} size={300}>
@@ -308,7 +417,7 @@ export const RelationalCSVDataEditor = observer(
308
417
  />
309
418
  )}
310
419
  {dataState.showTableIdentifierModal && (
311
- <RelationalTableIdentifierModal
420
+ <RelationalTableIdentifierEditor
312
421
  dataState={dataState}
313
422
  isReadOnly={isReadOnly}
314
423
  />
@@ -59,6 +59,8 @@ import {
59
59
  externalFormat_modelUnit_deletePackageableElementExcludes,
60
60
  externalFormat_modelUnit_deletePackageableElementIncludes,
61
61
  } from '../../../../stores/graph-modifier/DSL_ExternalFormat_GraphModifierHelper.js';
62
+ import { useApplicationNavigationContext } from '@finos/legend-application';
63
+ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
62
64
 
63
65
  const ModelUnitPackagableElementEntryEditor = observer(
64
66
  (props: {
@@ -424,6 +426,11 @@ export const BindingEditor = observer(() => {
424
426
  (tab: BINDING_TAB_TYPE): (() => void) =>
425
427
  (): void =>
426
428
  editorState.setSelectedTab(tab);
429
+
430
+ useApplicationNavigationContext(
431
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.BINDING_EDITOR,
432
+ );
433
+
427
434
  return (
428
435
  <div className="binding-editor">
429
436
  <div className="binding-editor__header">
@@ -59,6 +59,8 @@ import {
59
59
  CodeEditor,
60
60
  } from '@finos/legend-lego/code-editor';
61
61
  import { getEditorLanguageForFormat } from '../../../../stores/editor/editor-state/ArtifactGenerationViewerState.js';
62
+ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
63
+ import { useApplicationNavigationContext } from '@finos/legend-application';
62
64
 
63
65
  const SchemaLoader = observer(
64
66
  (props: {
@@ -415,6 +417,10 @@ export const SchemaSetEditor = observer(() => {
415
417
  );
416
418
  };
417
419
 
420
+ useApplicationNavigationContext(
421
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SCHEMA_SET_EDITOR,
422
+ );
423
+
418
424
  return (
419
425
  <div className="panel schema-set-panel">
420
426
  <div className="schema-set-panel__header">
@@ -39,6 +39,8 @@ import {
39
39
  CODE_EDITOR_LANGUAGE,
40
40
  CodeEditor,
41
41
  } from '@finos/legend-lego/code-editor';
42
+ import { useApplicationNavigationContext } from '@finos/legend-application';
43
+ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../__lib__/LegendStudioApplicationNavigationContext.js';
42
44
 
43
45
  enum HIDDEN_CONFIGURATION_PROPERTIES {
44
46
  FORMAT = 'format',
@@ -100,6 +102,10 @@ export const SchemaSetModelGenerationEditor = observer(
100
102
  modelGenerationState.importGeneratedModelsIntoGraph();
101
103
  };
102
104
 
105
+ useApplicationNavigationContext(
106
+ LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SCHEMA_SET_MODEL_GENERATION,
107
+ );
108
+
103
109
  return (
104
110
  <PanelContent className="file-generation-editor__content">
105
111
  <ResizablePanelGroup orientation="vertical">