@finos/legend-application-studio 28.8.0 → 28.10.0

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 (170) hide show
  1. package/lib/__lib__/LegendStudioCommand.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioCommand.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioCommand.js +5 -0
  4. package/lib/__lib__/LegendStudioCommand.js.map +1 -1
  5. package/lib/__lib__/LegendStudioNavigation.d.ts +6 -0
  6. package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioNavigation.js +5 -0
  8. package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
  9. package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
  10. package/lib/components/LegendStudioWebApplication.js +4 -1
  11. package/lib/components/LegendStudioWebApplication.js.map +1 -1
  12. package/lib/components/ShowcaseManager.d.ts.map +1 -1
  13. package/lib/components/ShowcaseManager.js +10 -2
  14. package/lib/components/ShowcaseManager.js.map +1 -1
  15. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  16. package/lib/components/editor/ActivityBar.js +20 -17
  17. package/lib/components/editor/ActivityBar.js.map +1 -1
  18. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  19. package/lib/components/editor/editor-group/EditorGroup.js +7 -1
  20. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  21. package/lib/components/editor/editor-group/GrammarTextEditor.js +1 -1
  22. package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
  23. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts +5 -0
  24. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.d.ts.map +1 -1
  25. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js +28 -10
  26. package/lib/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.js.map +1 -1
  27. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts +11 -0
  28. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.d.ts.map +1 -1
  29. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js +22 -10
  30. package/lib/components/editor/editor-group/connection-editor/DatabaseModelBuilder.js.map +1 -1
  31. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts +7 -0
  32. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  33. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +3 -3
  34. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  35. package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.d.ts +59 -0
  36. package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.d.ts.map +1 -0
  37. package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js +145 -0
  38. package/lib/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.js.map +1 -0
  39. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  40. package/lib/components/editor/side-bar/Explorer.js +3 -2
  41. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  42. package/lib/components/editor/side-bar/SideBar.d.ts.map +1 -1
  43. package/lib/components/editor/side-bar/SideBar.js +4 -1
  44. package/lib/components/editor/side-bar/SideBar.js.map +1 -1
  45. package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.d.ts +23 -0
  46. package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.d.ts.map +1 -0
  47. package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js +41 -0
  48. package/lib/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.js.map +1 -0
  49. package/lib/components/project-view/ProjectViewer.d.ts.map +1 -1
  50. package/lib/components/project-view/ProjectViewer.js +37 -5
  51. package/lib/components/project-view/ProjectViewer.js.map +1 -1
  52. package/lib/components/showcase/ShowcaseViewer.d.ts +18 -0
  53. package/lib/components/showcase/ShowcaseViewer.d.ts.map +1 -0
  54. package/lib/components/showcase/ShowcaseViewer.js +147 -0
  55. package/lib/components/showcase/ShowcaseViewer.js.map +1 -0
  56. package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts +23 -0
  57. package/lib/components/showcase/ShowcaseViewerStoreProvider.d.ts.map +1 -0
  58. package/lib/components/showcase/ShowcaseViewerStoreProvider.js +36 -0
  59. package/lib/components/showcase/ShowcaseViewerStoreProvider.js.map +1 -0
  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/LegendStudioBaseStore.d.ts.map +1 -1
  64. package/lib/stores/LegendStudioBaseStore.js +1 -0
  65. package/lib/stores/LegendStudioBaseStore.js.map +1 -1
  66. package/lib/stores/ShowcaseManagerState.d.ts +1 -0
  67. package/lib/stores/ShowcaseManagerState.d.ts.map +1 -1
  68. package/lib/stores/ShowcaseManagerState.js +11 -1
  69. package/lib/stores/ShowcaseManagerState.js.map +1 -1
  70. package/lib/stores/editor/EditorConfig.d.ts +3 -1
  71. package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
  72. package/lib/stores/editor/EditorConfig.js +4 -1
  73. package/lib/stores/editor/EditorConfig.js.map +1 -1
  74. package/lib/stores/editor/EditorMode.d.ts +4 -0
  75. package/lib/stores/editor/EditorMode.d.ts.map +1 -1
  76. package/lib/stores/editor/EditorMode.js +9 -0
  77. package/lib/stores/editor/EditorMode.js.map +1 -1
  78. package/lib/stores/editor/EditorStore.d.ts +2 -0
  79. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  80. package/lib/stores/editor/EditorStore.js +14 -3
  81. package/lib/stores/editor/EditorStore.js.map +1 -1
  82. package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
  83. package/lib/stores/editor/ExplorerTreeState.js +1 -1
  84. package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
  85. package/lib/stores/editor/GraphEditGrammarModeState.d.ts.map +1 -1
  86. package/lib/stores/editor/GraphEditGrammarModeState.js.map +1 -1
  87. package/lib/stores/editor/NewElementState.d.ts +1 -0
  88. package/lib/stores/editor/NewElementState.d.ts.map +1 -1
  89. package/lib/stores/editor/NewElementState.js +1 -1
  90. package/lib/stores/editor/NewElementState.js.map +1 -1
  91. package/lib/stores/editor/StandardEditorMode.d.ts +1 -0
  92. package/lib/stores/editor/StandardEditorMode.d.ts.map +1 -1
  93. package/lib/stores/editor/StandardEditorMode.js +4 -0
  94. package/lib/stores/editor/StandardEditorMode.js.map +1 -1
  95. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +6 -2
  96. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
  97. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +53 -34
  98. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
  99. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.d.ts.map +1 -1
  100. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js +1 -1
  101. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.js.map +1 -1
  102. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts +3 -2
  103. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.d.ts.map +1 -1
  104. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js +8 -5
  105. package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.js.map +1 -1
  106. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  107. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +20 -4
  108. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  109. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts +3 -0
  110. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -1
  111. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +17 -2
  112. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -1
  113. package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts +22 -0
  114. package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.d.ts.map +1 -0
  115. package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js +25 -0
  116. package/lib/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js.map +1 -0
  117. package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts +113 -0
  118. package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.d.ts.map +1 -0
  119. package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js +494 -0
  120. package/lib/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js.map +1 -0
  121. package/lib/stores/project-view/ProjectViewerEditorMode.d.ts +3 -0
  122. package/lib/stores/project-view/ProjectViewerEditorMode.d.ts.map +1 -1
  123. package/lib/stores/project-view/ProjectViewerEditorMode.js +10 -0
  124. package/lib/stores/project-view/ProjectViewerEditorMode.js.map +1 -1
  125. package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts +28 -0
  126. package/lib/stores/showcase/ShowcaseViewerEditorMode.d.ts.map +1 -0
  127. package/lib/stores/showcase/ShowcaseViewerEditorMode.js +40 -0
  128. package/lib/stores/showcase/ShowcaseViewerEditorMode.js.map +1 -0
  129. package/lib/stores/showcase/ShowcaseViewerStore.d.ts +32 -0
  130. package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -0
  131. package/lib/stores/showcase/ShowcaseViewerStore.js +193 -0
  132. package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -0
  133. package/package.json +7 -7
  134. package/src/__lib__/LegendStudioCommand.ts +5 -0
  135. package/src/__lib__/LegendStudioNavigation.ts +11 -0
  136. package/src/components/LegendStudioWebApplication.tsx +11 -1
  137. package/src/components/ShowcaseManager.tsx +44 -2
  138. package/src/components/editor/ActivityBar.tsx +56 -15
  139. package/src/components/editor/editor-group/EditorGroup.tsx +21 -1
  140. package/src/components/editor/editor-group/GrammarTextEditor.tsx +1 -1
  141. package/src/components/editor/editor-group/connection-editor/DatabaseBuilderWizard.tsx +135 -103
  142. package/src/components/editor/editor-group/connection-editor/DatabaseModelBuilder.tsx +97 -53
  143. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +4 -3
  144. package/src/components/editor/editor-group/end-to-end-flow-editor/QueryConnectionWorkflowEditor.tsx +478 -0
  145. package/src/components/editor/side-bar/Explorer.tsx +20 -12
  146. package/src/components/editor/side-bar/SideBar.tsx +13 -1
  147. package/src/components/editor/side-bar/end-to-end-workflow/EndToEndWorkflows.tsx +101 -0
  148. package/src/components/project-view/ProjectViewer.tsx +139 -4
  149. package/src/components/showcase/ShowcaseViewer.tsx +418 -0
  150. package/src/components/showcase/ShowcaseViewerStoreProvider.tsx +56 -0
  151. package/src/stores/LegendStudioBaseStore.ts +1 -0
  152. package/src/stores/ShowcaseManagerState.ts +19 -1
  153. package/src/stores/editor/EditorConfig.ts +3 -0
  154. package/src/stores/editor/EditorMode.ts +14 -0
  155. package/src/stores/editor/EditorStore.ts +17 -8
  156. package/src/stores/editor/ExplorerTreeState.ts +1 -0
  157. package/src/stores/editor/GraphEditGrammarModeState.ts +3 -3
  158. package/src/stores/editor/NewElementState.ts +1 -1
  159. package/src/stores/editor/StandardEditorMode.ts +7 -0
  160. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +77 -49
  161. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderWizardState.ts +1 -2
  162. package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseModelBuilderState.ts +12 -8
  163. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +31 -9
  164. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +23 -0
  165. package/src/stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.ts +25 -0
  166. package/src/stores/editor/sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.tsx +884 -0
  167. package/src/stores/project-view/ProjectViewerEditorMode.ts +17 -0
  168. package/src/stores/showcase/ShowcaseViewerEditorMode.ts +51 -0
  169. package/src/stores/showcase/ShowcaseViewerStore.ts +289 -0
  170. package/tsconfig.json +9 -1
@@ -0,0 +1,40 @@
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
+ import { EditorMode } from '../editor/EditorMode.js';
17
+ import { generateShowcasePath } from '../../__lib__/LegendStudioNavigation.js';
18
+ export class ShowcaseViewerEditorMode extends EditorMode {
19
+ showcaseViewerStore;
20
+ constructor(showcaseViewerStore) {
21
+ super();
22
+ this.showcaseViewerStore = showcaseViewerStore;
23
+ }
24
+ generateElementLink(elementPath) {
25
+ return generateShowcasePath(this.showcaseViewerStore.showcase.path);
26
+ }
27
+ generateDependencyElementLink(elementPath, dependencyProject) {
28
+ return generateShowcasePath(this.showcaseViewerStore.showcase.path);
29
+ }
30
+ get isInitialized() {
31
+ return Boolean(this.showcaseViewerStore._showcase);
32
+ }
33
+ get supportSdlcOperations() {
34
+ return false;
35
+ }
36
+ get label() {
37
+ return 'Showcase View';
38
+ }
39
+ }
40
+ //# sourceMappingURL=ShowcaseViewerEditorMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShowcaseViewerEditorMode.js","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerEditorMode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,OAAO,wBAAyB,SAAQ,UAAU;IAC7C,mBAAmB,CAAsB;IAElD,YAAY,mBAAwC;QAClD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;IACjD,CAAC;IAEQ,mBAAmB,CAAC,WAAmB;QAC9C,OAAO,oBAAoB,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IACQ,6BAA6B,CACpC,WAAmB,EACnB,iBAAoC;QAEpC,OAAO,oBAAoB,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,IAAa,aAAa;QACxB,OAAO,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,IAAa,qBAAqB;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAa,KAAK;QAChB,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
@@ -0,0 +1,32 @@
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
+ import { type GeneratorFn } from '@finos/legend-shared';
17
+ import type { EditorStore } from '../editor/EditorStore.js';
18
+ import type { ShowcaseViewerPathParams } from '../../__lib__/LegendStudioNavigation.js';
19
+ import { type Showcase } from '@finos/legend-server-showcase';
20
+ import type { Entity } from '@finos/legend-storage';
21
+ export declare class ShowcaseViewerStore {
22
+ readonly editorStore: EditorStore;
23
+ private readonly showcaseServerClient?;
24
+ _showcase: Showcase | undefined;
25
+ constructor(editorStore: EditorStore);
26
+ private get client();
27
+ get showcase(): Showcase;
28
+ setShowcase(val: Showcase): void;
29
+ initialize(params: ShowcaseViewerPathParams): GeneratorFn<void>;
30
+ buildGraph(entities: Entity[]): GeneratorFn<boolean>;
31
+ }
32
+ //# sourceMappingURL=ShowcaseViewerStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShowcaseViewerStore.d.ts","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,KAAK,WAAW,EAKjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAEL,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AAYvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAA+B;IACrE,SAAS,EAAE,QAAQ,GAAG,SAAS,CAAC;gBAEpB,WAAW,EAAE,WAAW;IAcpC,OAAO,KAAK,MAAM,GAKjB;IAED,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAI/B,UAAU,CAAC,MAAM,EAAE,wBAAwB,GAAG,WAAW,CAAC,IAAI,CAAC;IAwF/D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC;CAyHtD"}
@@ -0,0 +1,193 @@
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
+ import { guaranteeNonNullable, assertErrorThrown, StopWatch, LogEvent, assertNonEmptyString, } from '@finos/legend-shared';
17
+ import { flow, flowResult, makeObservable, observable } from 'mobx';
18
+ import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js';
19
+ import { ShowcaseRegistryServerClient, } from '@finos/legend-server-showcase';
20
+ import { DependencyGraphBuilderError, GRAPH_MANAGER_EVENT, GraphBuilderError, GraphDataDeserializationError, createGraphBuilderReport, } from '@finos/legend-graph';
21
+ import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
22
+ import { payloadDebugger } from '../editor/panel-group/DevToolPanelState.js';
23
+ import { LegendStudioTelemetryHelper } from '../../__lib__/LegendStudioTelemetryHelper.js';
24
+ import { GRAPH_EDITOR_MODE } from '../editor/EditorConfig.js';
25
+ export class ShowcaseViewerStore {
26
+ editorStore;
27
+ showcaseServerClient;
28
+ _showcase;
29
+ constructor(editorStore) {
30
+ this.editorStore = editorStore;
31
+ makeObservable(this, {
32
+ _showcase: observable,
33
+ initialize: flow,
34
+ buildGraph: flow,
35
+ });
36
+ if (this.editorStore.applicationStore.config.showcaseServerUrl) {
37
+ this.showcaseServerClient = new ShowcaseRegistryServerClient({
38
+ baseUrl: this.editorStore.applicationStore.config.showcaseServerUrl,
39
+ });
40
+ }
41
+ }
42
+ get client() {
43
+ return guaranteeNonNullable(this.showcaseServerClient, `Showcase registry server client is not configured`);
44
+ }
45
+ get showcase() {
46
+ return guaranteeNonNullable(this._showcase);
47
+ }
48
+ setShowcase(val) {
49
+ this._showcase = val;
50
+ }
51
+ *initialize(params) {
52
+ if (!this.editorStore.initState.isInInitialState) {
53
+ return;
54
+ }
55
+ const showcasePath = params[0];
56
+ this.editorStore.initState.inProgress();
57
+ const onLeave = (hasBuildSucceeded) => {
58
+ this.editorStore.initState.complete(hasBuildSucceeded);
59
+ };
60
+ try {
61
+ const stopWatch = new StopWatch();
62
+ assertNonEmptyString(showcasePath, 'Showcase path expected');
63
+ // fetch showcase
64
+ this.editorStore.initState.setMessage(`Fetching Showcase Data...`);
65
+ this._showcase = (yield this.client.getShowcase(showcasePath));
66
+ // initialize graph manager
67
+ yield this.editorStore.graphManagerState.graphManager.initialize({
68
+ env: this.editorStore.applicationStore.config.env,
69
+ tabSize: DEFAULT_TAB_SIZE,
70
+ clientConfig: {
71
+ baseUrl: this.editorStore.applicationStore.config.engineServerUrl,
72
+ queryBaseUrl: this.editorStore.applicationStore.config.engineQueryServerUrl,
73
+ enableCompression: true,
74
+ payloadDebugger,
75
+ },
76
+ }, {
77
+ tracerService: this.editorStore.applicationStore.tracerService,
78
+ });
79
+ // convert code to entities
80
+ stopWatch.record();
81
+ const grammar = this.showcase.code;
82
+ this.editorStore.initState.setMessage(`Converting showcase code to entities...`);
83
+ const entities = (yield this.editorStore.graphManagerState.graphManager.pureCodeToEntities(grammar,
84
+ // we want to keep section index so we read imports correctly
85
+ {
86
+ TEMPORARY__keepSectionIndex: true,
87
+ }));
88
+ this.editorStore.initState.setMessage(undefined);
89
+ stopWatch.record(GRAPH_MANAGER_EVENT.FETCH_GRAPH_ENTITIES__SUCCESS);
90
+ const graphBuilderResult = (yield flowResult(this.buildGraph(entities)));
91
+ if (!graphBuilderResult) {
92
+ onLeave(false);
93
+ return;
94
+ }
95
+ this.editorStore.initState.setMessage(`Generating elements...`);
96
+ if (this.editorStore.graphManagerState.graph.ownGenerationSpecifications
97
+ .length) {
98
+ yield flowResult(this.editorStore.graphState.graphGenerationState.globalGenerate());
99
+ }
100
+ // build explorer tree
101
+ this.editorStore.explorerTreeState.buildImmutableModelTrees();
102
+ this.editorStore.explorerTreeState.build();
103
+ // complete actions
104
+ this.editorStore.initState.setMessage(undefined);
105
+ onLeave(true);
106
+ }
107
+ catch (error) {
108
+ assertErrorThrown(error);
109
+ this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
110
+ this.editorStore.applicationStore.notificationService.notifyError(error);
111
+ onLeave(false);
112
+ }
113
+ }
114
+ *buildGraph(entities) {
115
+ try {
116
+ const stopWatch = new StopWatch();
117
+ yield this.editorStore.graphManagerState.initializeSystem();
118
+ // reset
119
+ this.editorStore.graphManagerState.resetGraph();
120
+ // build dependencies
121
+ stopWatch.record();
122
+ const dependencyManager = this.editorStore.graphManagerState.graphManager.createDependencyManager();
123
+ this.editorStore.graphManagerState.graph.dependencyManager =
124
+ dependencyManager;
125
+ const dependency_buildReport = createGraphBuilderReport();
126
+ yield this.editorStore.graphManagerState.graphManager.buildDependencies(this.editorStore.graphManagerState.coreModel, this.editorStore.graphManagerState.systemModel, dependencyManager, new Map(), this.editorStore.graphManagerState.dependenciesBuildState, {}, dependency_buildReport);
127
+ // build graph
128
+ const graph_buildReport = createGraphBuilderReport();
129
+ yield this.editorStore.graphManagerState.graphManager.buildGraph(this.editorStore.graphManagerState.graph, entities, this.editorStore.graphManagerState.graphBuildState, undefined, graph_buildReport);
130
+ // report
131
+ stopWatch.record(GRAPH_MANAGER_EVENT.INITIALIZE_GRAPH__SUCCESS);
132
+ const graphBuilderReportData = {
133
+ timings: this.editorStore.applicationStore.timeService.finalizeTimingsRecord(stopWatch),
134
+ dependencies: dependency_buildReport,
135
+ dependenciesCount: this.editorStore.graphManagerState.graph.dependencyManager
136
+ .numberOfDependencies,
137
+ graph: graph_buildReport,
138
+ };
139
+ LegendStudioTelemetryHelper.logEvent_GraphInitializationSucceeded(this.editorStore.applicationStore.telemetryService, graphBuilderReportData);
140
+ this.editorStore.applicationStore.logService.info(LogEvent.create(GRAPH_MANAGER_EVENT.INITIALIZE_GRAPH__SUCCESS), graphBuilderReportData);
141
+ // fetch available editor configurations
142
+ yield Promise.all([
143
+ this.editorStore.graphState.graphGenerationState.globalFileGenerationState.fetchAvailableFileGenerationDescriptions(),
144
+ this.editorStore.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
145
+ this.editorStore.graphState.graphGenerationState.externalFormatState.fetchExternalFormatDescriptions(),
146
+ this.editorStore.graphState.fetchAvailableFunctionActivatorConfigurations(),
147
+ ]);
148
+ return true;
149
+ }
150
+ catch (error) {
151
+ assertErrorThrown(error);
152
+ // if graph builder fails, we fall back to text-mode
153
+ this.editorStore.applicationStore.logService.error(LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_BUILDER_FAILURE), error);
154
+ if (error instanceof DependencyGraphBuilderError) {
155
+ // no recovery if dependency models cannot be built, this makes assumption that all dependencies models are compiled successfully
156
+ // TODO: we might want to handle this more gracefully when we can show people the dependency model element in the future
157
+ this.editorStore.applicationStore.notificationService.notifyError(`Can't initialize dependency models. Error: ${error.message}`);
158
+ this.editorStore.applicationStore.alertService.setBlockingAlert({
159
+ message: `Can't initialize dependencies`,
160
+ prompt: 'Please use editor to better invesigate the issue',
161
+ });
162
+ }
163
+ else if (error instanceof GraphDataDeserializationError) {
164
+ // if something goes wrong with de-serialization, we can't really do anything but to alert
165
+ this.editorStore.applicationStore.notificationService.notifyError(`Can't deserialize graph. Error: ${error.message}`);
166
+ this.editorStore.applicationStore.alertService.setBlockingAlert({
167
+ message: `Can't deserialize graph`,
168
+ prompt: 'Please use editor to better invesigate the issue',
169
+ });
170
+ }
171
+ else if (error instanceof GraphBuilderError) {
172
+ // TODO: we should split this into 2 notifications when we support multiple notifications
173
+ this.editorStore.applicationStore.notificationService.notifyError(`Can't build graph. Redirected to text mode for debugging. Error: ${error.message}`);
174
+ yield flowResult(this.editorStore.switchModes(GRAPH_EDITOR_MODE.GRAMMAR_TEXT, {
175
+ isGraphBuildFailure: true,
176
+ }));
177
+ if (this.editorStore.graphEditorMode.mode === GRAPH_EDITOR_MODE.FORM) {
178
+ // nothing we can do here so we will just block the user
179
+ this.editorStore.applicationStore.alertService.setBlockingAlert({
180
+ message: `Can't compose Pure code from graph models`,
181
+ prompt: 'Please use editor to better invesigate the issue',
182
+ });
183
+ return false;
184
+ }
185
+ }
186
+ else {
187
+ this.editorStore.applicationStore.notificationService.notifyError(error);
188
+ }
189
+ return false;
190
+ }
191
+ }
192
+ }
193
+ //# sourceMappingURL=ShowcaseViewerStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShowcaseViewerStore.js","sourceRoot":"","sources":["../../../src/stores/showcase/ShowcaseViewerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EAEpB,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAA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C,gBAAgB,CAAC,YAAY,CAAC,gBAAgB,CAAC;wBAC9D,OAAO,EAAE,2CAA2C;wBACpD,MAAM,EAAE,kDAAkD;qBAC3D,CAAC,CAAC;oBACH,OAAO,KAAK,CAAC;iBACd;aACF;iBAAM;gBACL,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAC/D,KAAK,CACN,CAAC;aACH;YACD,OAAO,KAAK,CAAC;SACd;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.8.0",
3
+ "version": "28.10.0",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,14 +45,14 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-application": "15.0.46",
49
- "@finos/legend-art": "7.1.0",
50
- "@finos/legend-graph": "31.3.7",
51
- "@finos/legend-lego": "1.1.41",
52
- "@finos/legend-query-builder": "4.10.2",
48
+ "@finos/legend-application": "15.0.48",
49
+ "@finos/legend-art": "7.1.2",
50
+ "@finos/legend-graph": "31.3.8",
51
+ "@finos/legend-lego": "1.1.43",
52
+ "@finos/legend-query-builder": "4.11.1",
53
53
  "@finos/legend-server-depot": "6.0.31",
54
54
  "@finos/legend-server-sdlc": "5.2.2",
55
- "@finos/legend-server-showcase": "0.1.0",
55
+ "@finos/legend-server-showcase": "0.2.0",
56
56
  "@finos/legend-shared": "10.0.27",
57
57
  "@finos/legend-storage": "3.0.77",
58
58
  "@testing-library/react": "14.0.0",
@@ -20,6 +20,7 @@ export enum LEGEND_STUDIO_COMMAND_KEY {
20
20
  SYNC_WITH_WORKSPACE = 'editor.sync-workspace',
21
21
  CREATE_ELEMENT = 'editor.create-new-element',
22
22
  SEARCH_ELEMENT = 'editor.search-element',
23
+ OPEN_SHOWCASES = 'editor.show-showcases',
23
24
  TOGGLE_TEXT_MODE = 'editor.toggle-text-mode',
24
25
  GENERATE = 'editor.generate',
25
26
  COMPILE = 'editor.compile',
@@ -48,6 +49,10 @@ export const LEGEND_STUDIO_COMMAND_CONFIG: CommandConfigData = {
48
49
  title: 'Toggle model loader',
49
50
  defaultKeyboardShortcut: 'F2',
50
51
  },
52
+ [LEGEND_STUDIO_COMMAND_KEY.OPEN_SHOWCASES]: {
53
+ title: 'Open Showcases',
54
+ defaultKeyboardShortcut: 'F7',
55
+ },
51
56
  [LEGEND_STUDIO_COMMAND_KEY.TOGGLE_TEXT_MODE]: {
52
57
  title: 'Toggle text mode',
53
58
  defaultKeyboardShortcut: 'F8',
@@ -20,6 +20,7 @@ import { guaranteeNonNullable } from '@finos/legend-shared';
20
20
  import { generatePath } from '@finos/legend-application/browser';
21
21
 
22
22
  export enum LEGEND_STUDIO_ROUTE_PATTERN_TOKEN {
23
+ SHOWCASE_PATH = 'showcasePath',
23
24
  PROJECT_ID = 'projectId',
24
25
  PATCH_RELEASE_VERSION_ID = 'patchReleaseVersionId',
25
26
  WORKSPACE_ID = 'workspaceId',
@@ -58,6 +59,7 @@ export const LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN = Object.freeze({
58
59
  VIEW_BY_GAV: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}`,
59
60
  VIEW_BY_GAV_ENTITY: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}/entity/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH}`,
60
61
  PREVIEW_BY_GAV_ENTITY: `/view/archive/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.GAV}/entity/:${LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH}/preview`,
62
+ SHOWCASE_PROJECT: `/showcase/*`,
61
63
  });
62
64
 
63
65
  export type WorkspaceReviewPathParams = {
@@ -73,6 +75,10 @@ export type ProjectViewerPathParams = {
73
75
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.ENTITY_PATH]?: string;
74
76
  };
75
77
 
78
+ export type ShowcaseViewerPathParams = {
79
+ [0]?: string;
80
+ };
81
+
76
82
  export type WorkspaceEditorPathParams = {
77
83
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PROJECT_ID]: string;
78
84
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PATCH_RELEASE_VERSION_ID]?: string;
@@ -347,3 +353,8 @@ export const EXTERNAL_APPLICATION_NAVIGATION__generateServiceQueryCreatorUrl = (
347
353
  artifactId,
348
354
  versionId,
349
355
  )}/${servicePath}`;
356
+
357
+ export const generateShowcasePath = (projectPath: string): string =>
358
+ generatePath(LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.SHOWCASE_PROJECT, {
359
+ 0: projectPath,
360
+ });
@@ -40,6 +40,7 @@ import {
40
40
  type TEMPORARY__ReactRouterComponentType,
41
41
  } from '@finos/legend-application/browser';
42
42
  import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../__lib__/LegendStudioDocumentation.js';
43
+ import { ShowcaseViewer } from './showcase/ShowcaseViewer.js';
43
44
 
44
45
  const NotFoundPage = observer(() => {
45
46
  const applicationStore = useApplicationStore();
@@ -114,7 +115,6 @@ export const LegendStudioWebApplicationRouter = observer(() => {
114
115
  applicationStore.alertUnhandledError,
115
116
  );
116
117
  }, [applicationStore, baseStore]);
117
-
118
118
  return (
119
119
  <div className="app">
120
120
  {baseStore.initState.hasCompleted && (
@@ -133,6 +133,16 @@ export const LegendStudioWebApplicationRouter = observer(() => {
133
133
  ProjectViewer as TEMPORARY__ReactRouterComponentType
134
134
  }
135
135
  />
136
+ <Route
137
+ exact={true}
138
+ path={
139
+ LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.SHOWCASE_PROJECT
140
+ }
141
+ component={
142
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
143
+ ShowcaseViewer as TEMPORARY__ReactRouterComponentType
144
+ }
145
+ />
136
146
  <Route>
137
147
  <NotFoundPage />
138
148
  </Route>
@@ -32,6 +32,7 @@ import {
32
32
  TimesIcon,
33
33
  CodeIcon,
34
34
  clsx,
35
+ CopyIcon,
35
36
  } from '@finos/legend-art';
36
37
  import {
37
38
  SHOWCASE_MANAGER_SEARCH_CATEGORY,
@@ -48,6 +49,7 @@ import {
48
49
  CodeEditor,
49
50
  } from '@finos/legend-lego/code-editor';
50
51
  import React, { useEffect, useMemo, useRef } from 'react';
52
+ import { generateShowcasePath } from '../__lib__/LegendStudioNavigation.js';
51
53
 
52
54
  const ShowcasesExplorerTreeNodeContainer = observer(
53
55
  (
@@ -536,7 +538,23 @@ const ShowcaseViewer = observer(
536
538
  }) => {
537
539
  const { showcaseManagerState, showcase } = props;
538
540
  const prettyPath = showcase.path.replaceAll(/\s*\/\s*/g, ' / ');
539
-
541
+ const launchShowcase = (): void => {
542
+ const applicationStore = showcaseManagerState.applicationStore;
543
+ applicationStore.navigationService.navigator.visitAddress(
544
+ applicationStore.navigationService.navigator.generateAddress(
545
+ generateShowcasePath(showcase.path),
546
+ ),
547
+ );
548
+ };
549
+ const handleCopy =
550
+ showcaseManagerState.applicationStore.guardUnhandledError(() =>
551
+ showcaseManagerState.applicationStore.clipboardService.copyTextToClipboard(
552
+ showcase.code,
553
+ {
554
+ notifySuccessMessage: 'Showcase grammar copied to clipboard',
555
+ },
556
+ ),
557
+ );
540
558
  return (
541
559
  <div className="showcase-manager__view">
542
560
  <div className="showcase-manager__view__header">
@@ -583,7 +601,31 @@ const ShowcaseViewer = observer(
583
601
  </div>
584
602
  <div className="showcase-manager__view__content showcase-manager__viewer__content">
585
603
  <div className="showcase-manager__viewer__title">
586
- {showcase.title}
604
+ <div className="showcase-manager__viewer__title__label">
605
+ {showcase.title}
606
+ </div>
607
+ <div className="showcase-manager__viewer__title__action">
608
+ <div className="btn__dropdown-combo btn__dropdown-combo--primary showcase-manager__viewer__title__action-btn">
609
+ <button
610
+ className="btn__dropdown-combo__label"
611
+ onClick={launchShowcase}
612
+ title="Open Showcase Project"
613
+ tabIndex={-1}
614
+ >
615
+ <div className="btn__dropdown-combo__label__title">
616
+ Launch
617
+ </div>
618
+ </button>
619
+ </div>
620
+ </div>
621
+ <div className="showcase-manager__viewer__title__action">
622
+ <div
623
+ onClick={handleCopy}
624
+ className="showcase-manager__viewer__title__action-icon"
625
+ >
626
+ <CopyIcon />
627
+ </div>
628
+ </div>
587
629
  </div>
588
630
  <div className="showcase-manager__viewer__path">{prettyPath}</div>
589
631
  <div className="showcase-manager__viewer__code">
@@ -15,7 +15,11 @@
15
15
  */
16
16
 
17
17
  import { observer } from 'mobx-react-lite';
18
- import { ACTIVITY_MODE, PANEL_MODE } from '../../stores/editor/EditorConfig.js';
18
+ import {
19
+ ACTIVITY_MODE,
20
+ PANEL_MODE,
21
+ USER_JOURNEYS,
22
+ } from '../../stores/editor/EditorConfig.js';
19
23
  import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
20
24
  import {
21
25
  clsx,
@@ -36,6 +40,8 @@ import {
36
40
  MenuContentDivider,
37
41
  FlaskIcon,
38
42
  RobotIcon,
43
+ WorkflowIcon,
44
+ ReadMeIcon,
39
45
  } from '@finos/legend-art';
40
46
  import { useEditorStore } from './EditorStoreProvider.js';
41
47
  import { forwardRef, useState } from 'react';
@@ -47,8 +53,10 @@ import {
47
53
  ActivityBarItemExperimentalBadge,
48
54
  type ActivityBarItemConfig,
49
55
  } from '@finos/legend-lego/application';
50
- import { ShowcaseManagerState } from '../../stores/ShowcaseManagerState.js';
51
- import { SHOWCASE_MANAGER_VIRTUAL_ASSISTANT_TAB_KEY } from '../extensions/Core_LegendStudioApplicationPlugin.js';
56
+ import {
57
+ ShowcaseManagerState,
58
+ openShowcaseManager,
59
+ } from '../../stores/ShowcaseManagerState.js';
52
60
 
53
61
  const SettingsMenu = observer(
54
62
  forwardRef<HTMLDivElement, unknown>(function SettingsMenu(props, ref) {
@@ -103,17 +111,6 @@ export const ActivityBarMenu: React.FC = () => {
103
111
  // showcases
104
112
  const showcaseManagerState =
105
113
  ShowcaseManagerState.retrieveNullableState(applicationStore);
106
- const openShowcaseManager = (): void => {
107
- if (showcaseManagerState?.isEnabled) {
108
- applicationStore.assistantService.setIsHidden(false);
109
- applicationStore.assistantService.setIsOpen(true);
110
- applicationStore.assistantService.setIsPanelMaximized(true);
111
- applicationStore.assistantService.setSelectedTab(
112
- SHOWCASE_MANAGER_VIRTUAL_ASSISTANT_TAB_KEY,
113
- );
114
- }
115
- };
116
-
117
114
  return (
118
115
  <>
119
116
  <div className="activity-bar__menu">
@@ -128,7 +125,9 @@ export const ActivityBarMenu: React.FC = () => {
128
125
  <MenuContent>
129
126
  <MenuContentItem onClick={showAppInfo}>About</MenuContentItem>
130
127
  {showcaseManagerState?.isEnabled && (
131
- <MenuContentItem onClick={openShowcaseManager}>
128
+ <MenuContentItem
129
+ onClick={() => openShowcaseManager(applicationStore)}
130
+ >
132
131
  See Showcases
133
132
  </MenuContentItem>
134
133
  )}
@@ -363,6 +362,23 @@ export const ActivityBar = observer(() => {
363
362
  ] as (ActivityBarItemConfig | boolean)[]
364
363
  ).filter((activity): activity is ActivityBarItemConfig => Boolean(activity));
365
364
 
365
+ const userJourneys: ActivityBarItemConfig[] = (
366
+ [
367
+ !editorStore.isInConflictResolutionMode &&
368
+ editorStore.applicationStore.config.options
369
+ .TEMPORARY__enableEndtoEndWorkflow && {
370
+ mode: USER_JOURNEYS.END_TO_END_WORKFLOWS,
371
+ title: 'End to End Workflows (Beta)',
372
+ icon: (
373
+ <div>
374
+ <WorkflowIcon className="activity-bar__icon--service-registrar" />
375
+ <ActivityBarItemExperimentalBadge />
376
+ </div>
377
+ ),
378
+ },
379
+ ] as (ActivityBarItemConfig | boolean)[]
380
+ ).filter((activity): activity is ActivityBarItemConfig => Boolean(activity));
381
+
366
382
  return (
367
383
  <div className="activity-bar">
368
384
  <ActivityBarMenu />
@@ -382,9 +398,34 @@ export const ActivityBar = observer(() => {
382
398
  {activity.icon}
383
399
  </button>
384
400
  ))}
401
+ <MenuContentDivider />
402
+ {userJourneys.map((activity) => (
403
+ <button
404
+ key={activity.mode}
405
+ className={clsx('activity-bar__item', {
406
+ 'activity-bar__item--active':
407
+ editorStore.sideBarDisplayState.isOpen &&
408
+ editorStore.activeActivity === activity.mode,
409
+ })}
410
+ onClick={changeActivity(activity.mode)}
411
+ tabIndex={-1}
412
+ title={activity.title}
413
+ >
414
+ {activity.icon}
415
+ </button>
416
+ ))}
385
417
  </div>
418
+ <button
419
+ className={clsx('activity-bar__item')}
420
+ onClick={() => openShowcaseManager(editorStore.applicationStore)}
421
+ tabIndex={-1}
422
+ title={'Open Showcases'}
423
+ >
424
+ <ReadMeIcon />
425
+ </button>
386
426
  <DropdownMenu
387
427
  className="activity-bar__item"
428
+ title="Settings"
388
429
  content={<SettingsMenu />}
389
430
  menuProps={{
390
431
  anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
@@ -77,6 +77,8 @@ import { INTERNAL__UnknownFunctionActivatorEdtiorState } from '../../../stores/e
77
77
  import { INTERNAL__UnknownFunctionActivatorEdtior } from './INTERNAL__UnknownFunctionActivatorEdtior.js';
78
78
  import { getElementIcon } from '../../ElementIconUtils.js';
79
79
  import { ArtifactGenerationViewerState } from '../../../stores/editor/editor-state/ArtifactGenerationViewerState.js';
80
+ import { QueryConnectionEndToEndWorkflowEditorState } from '../../../stores/editor/editor-state/end-to-end-workflow-state/EndToEndWorkflowEditorState.js';
81
+ import { QueryConnectionWorflowEditor } from './end-to-end-flow-editor/QueryConnectionWorkflowEditor.js';
80
82
 
81
83
  export const ViewerEditorGroupSplashScreen: React.FC = () => {
82
84
  const commandListWidth = 300;
@@ -119,7 +121,6 @@ export const EditorGroupSplashScreen: React.FC = () => {
119
121
  const commandListHeight = 180;
120
122
  const [showCommandList, setShowCommandList] = useState(false);
121
123
  const { ref, width, height } = useResizeDetector<HTMLDivElement>();
122
-
123
124
  useEffect(() => {
124
125
  setShowCommandList(
125
126
  (width ?? 0) > commandListWidth && (height ?? 0) > commandListHeight,
@@ -157,6 +158,14 @@ export const EditorGroupSplashScreen: React.FC = () => {
157
158
  <div className="hotkey__key">S</div>
158
159
  </div>
159
160
  </div>
161
+ <div className="editor-group__splash-screen__content__item">
162
+ <div className="editor-group__splash-screen__content__item__label">
163
+ Open Showcases
164
+ </div>
165
+ <div className="editor-group__splash-screen__content__item__hot-keys">
166
+ <div className="hotkey__key">F7</div>
167
+ </div>
168
+ </div>
160
169
  <div className="editor-group__splash-screen__content__item">
161
170
  <div className="editor-group__splash-screen__content__item__label">
162
171
  Toggle Hackermode
@@ -315,6 +324,17 @@ export const EditorGroup = observer(() => {
315
324
  return <ModelImporter />;
316
325
  } else if (currentTabState instanceof ProjectConfigurationEditorState) {
317
326
  return <ProjectConfigurationEditor />;
327
+ } else if (
328
+ currentTabState instanceof QueryConnectionEndToEndWorkflowEditorState
329
+ ) {
330
+ return (
331
+ <QueryConnectionWorflowEditor
332
+ queryConnectionEndToEndWorkflowState={
333
+ editorStore.globalEndToEndWorkflowState
334
+ .queryConnectionEndToEndWorkflowState
335
+ }
336
+ />
337
+ );
318
338
  }
319
339
  // TODO: create an editor for unsupported tab
320
340
  return null;