@finos/legend-application-studio 28.18.26 → 28.18.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/lib/__lib__/LegendStudioNavigation.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioNavigation.js +1 -0
  4. package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
  5. package/lib/application/LegendStudioApplicationConfig.d.ts +4 -0
  6. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendStudioApplicationConfig.js +5 -0
  8. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  9. package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
  10. package/lib/components/LegendStudioWebApplication.js +8 -3
  11. package/lib/components/LegendStudioWebApplication.js.map +1 -1
  12. package/lib/components/editor/ActivityBar.d.ts +3 -1
  13. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  14. package/lib/components/editor/ActivityBar.js +10 -4
  15. package/lib/components/editor/ActivityBar.js.map +1 -1
  16. package/lib/components/editor/Editor.d.ts.map +1 -1
  17. package/lib/components/editor/Editor.js +14 -2
  18. package/lib/components/editor/Editor.js.map +1 -1
  19. package/lib/components/editor/ShowcaseSideBar.d.ts +24 -0
  20. package/lib/components/editor/ShowcaseSideBar.d.ts.map +1 -0
  21. package/lib/components/editor/ShowcaseSideBar.js +36 -0
  22. package/lib/components/editor/ShowcaseSideBar.js.map +1 -0
  23. package/lib/components/pct/PureCompatibilityTest.d.ts +19 -0
  24. package/lib/components/pct/PureCompatibilityTest.d.ts.map +1 -0
  25. package/lib/components/pct/PureCompatibilityTest.js +27 -0
  26. package/lib/components/pct/PureCompatibilityTest.js.map +1 -0
  27. package/lib/index.css +2 -2
  28. package/lib/index.css.map +1 -1
  29. package/lib/package.json +1 -1
  30. package/lib/stores/editor/EditorStore.d.ts +3 -0
  31. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  32. package/lib/stores/editor/EditorStore.js +18 -2
  33. package/lib/stores/editor/EditorStore.js.map +1 -1
  34. package/package.json +5 -5
  35. package/src/__lib__/LegendStudioNavigation.ts +1 -0
  36. package/src/application/LegendStudioApplicationConfig.ts +9 -0
  37. package/src/components/LegendStudioWebApplication.tsx +18 -1
  38. package/src/components/editor/ActivityBar.tsx +15 -4
  39. package/src/components/editor/Editor.tsx +32 -2
  40. package/src/components/editor/ShowcaseSideBar.tsx +66 -0
  41. package/src/components/pct/PureCompatibilityTest.tsx +35 -0
  42. package/src/stores/editor/EditorStore.ts +25 -2
  43. package/tsconfig.json +2 -0
@@ -40,8 +40,9 @@ 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';
44
43
  import { LazyTextEditor } from './lazy-text-editor/LazyTextEditor.js';
44
+ import { PureCompatibilityTestManager } from './pct/PureCompatibilityTest.js';
45
+ import { ShowcaseViewer } from './showcase/ShowcaseViewer.js';
45
46
 
46
47
  const NotFoundPage = observer(() => {
47
48
  const applicationStore = useApplicationStore();
@@ -143,6 +144,14 @@ export const LegendStudioWebApplicationRouter = observer(() => {
143
144
  ShowcaseViewer as TEMPORARY__ReactRouterComponentType
144
145
  }
145
146
  />
147
+ <Route
148
+ exact={true}
149
+ path={LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.PCT_REPORT}
150
+ component={
151
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
152
+ PureCompatibilityTestManager as TEMPORARY__ReactRouterComponentType
153
+ }
154
+ />
146
155
  <Route>
147
156
  <NotFoundPage />
148
157
  </Route>
@@ -220,6 +229,14 @@ export const LegendStudioWebApplicationRouter = observer(() => {
220
229
  WorkspaceSetup as TEMPORARY__ReactRouterComponentType
221
230
  }
222
231
  />
232
+ <Route
233
+ exact={true}
234
+ path={LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.PCT_REPORT}
235
+ component={
236
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
237
+ PureCompatibilityTestManager as TEMPORARY__ReactRouterComponentType
238
+ }
239
+ />
223
240
  {extraApplicationPageEntries.map((entry) => (
224
241
  <Route
225
242
  key={entry.key}
@@ -62,6 +62,7 @@ import {
62
62
  ShowcaseManagerState,
63
63
  openShowcaseManager,
64
64
  } from '../../stores/ShowcaseManagerState.js';
65
+ import { toggleShowcasePanel } from './ShowcaseSideBar.js';
65
66
 
66
67
  const SettingsMenu = observer(
67
68
  forwardRef<HTMLDivElement, unknown>(function SettingsMenu(props, ref) {
@@ -81,7 +82,9 @@ const SettingsMenu = observer(
81
82
  }),
82
83
  );
83
84
 
84
- export const ActivityBarMenu: React.FC = () => {
85
+ export const ActivityBarMenu: React.FC<{
86
+ openShowcasePanel?: () => void;
87
+ }> = ({ openShowcasePanel }) => {
85
88
  const applicationStore = useLegendStudioApplicationStore();
86
89
  const appDocUrl = applicationStore.documentationService.url;
87
90
  const docLinks = applicationStore.documentationService.links;
@@ -136,7 +139,11 @@ export const ActivityBarMenu: React.FC = () => {
136
139
  <MenuContentItem onClick={showAppInfo}>About</MenuContentItem>
137
140
  {showcaseManagerState?.isEnabled && (
138
141
  <MenuContentItem
139
- onClick={() => openShowcaseManager(applicationStore)}
142
+ onClick={() =>
143
+ openShowcasePanel
144
+ ? openShowcasePanel()
145
+ : openShowcaseManager(applicationStore)
146
+ }
140
147
  >
141
148
  See Showcases
142
149
  </MenuContentItem>
@@ -398,9 +405,13 @@ export const ActivityBar = observer(() => {
398
405
  },
399
406
  ].filter((activity) => !activity.disabled);
400
407
 
408
+ const openShowcasePanel = () => {
409
+ toggleShowcasePanel(editorStore);
410
+ };
411
+
401
412
  return (
402
413
  <div className="activity-bar">
403
- <ActivityBarMenu />
414
+ <ActivityBarMenu openShowcasePanel={openShowcasePanel} />
404
415
  <div className="activity-bar__items">
405
416
  {activities.map((activity) => (
406
417
  <button
@@ -436,7 +447,7 @@ export const ActivityBar = observer(() => {
436
447
  </div>
437
448
  <button
438
449
  className={clsx('activity-bar__item')}
439
- onClick={() => openShowcaseManager(editorStore.applicationStore)}
450
+ onClick={() => openShowcasePanel()}
440
451
  tabIndex={-1}
441
452
  title={'Open Showcases'}
442
453
  >
@@ -34,6 +34,7 @@ import {
34
34
  import { GrammarTextEditor } from './editor-group/GrammarTextEditor.js';
35
35
  import { StatusBar } from './StatusBar.js';
36
36
  import { ActivityBar } from './ActivityBar.js';
37
+ import { ShowcaseSideBar } from './ShowcaseSideBar.js';
37
38
  import type { WorkspaceEditorPathParams } from '../../__lib__/LegendStudioNavigation.js';
38
39
  import { ProjectSearchCommand } from '../editor/command-center/ProjectSearchCommand.js';
39
40
  import { guaranteeNonNullable, isNonNullable } from '@finos/legend-shared';
@@ -53,6 +54,7 @@ import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../__lib__/
53
54
  import { EmbeddedQueryBuilder } from './EmbeddedQueryBuilder.js';
54
55
  import { GRAPH_EDITOR_MODE } from '../../stores/editor/EditorConfig.js';
55
56
  import { QuickInput } from './QuickInput.js';
57
+ import { ShowcaseManager } from '../ShowcaseManager.js';
56
58
 
57
59
  export const Editor = withEditorStore(
58
60
  observer(() => {
@@ -118,6 +120,22 @@ export const Editor = withEditorStore(
118
120
  const maximizedCollapsiblePanelGroupProps = getCollapsiblePanelGroupProps(
119
121
  editorStore.panelGroupDisplayState.isMaximized,
120
122
  );
123
+ // handle resizing showcase sidebar
124
+ const showcaseResizeSideBar = (
125
+ handleProps: ResizablePanelHandlerProps,
126
+ ): void =>
127
+ editorStore.showcasePanelDisplayState.setSize(
128
+ (handleProps.domElement as HTMLDivElement).getBoundingClientRect()
129
+ .width,
130
+ );
131
+
132
+ const showcaseCollapsibleSideBarGroupProps = getCollapsiblePanelGroupProps(
133
+ editorStore.showcasePanelDisplayState.size === 0,
134
+ {
135
+ onStopResize: showcaseResizeSideBar,
136
+ size: editorStore.showcasePanelDisplayState.size,
137
+ },
138
+ );
121
139
 
122
140
  useEffect(() => {
123
141
  if (ref.current) {
@@ -193,7 +211,6 @@ export const Editor = withEditorStore(
193
211
 
194
212
  // Cleanup the editor
195
213
  useEffect(() => (): void => editorStore.cleanUp(), [editorStore]);
196
-
197
214
  return (
198
215
  <div className="app__page">
199
216
  <div className="editor">
@@ -210,7 +227,10 @@ export const Editor = withEditorStore(
210
227
  </ResizablePanel>
211
228
  <ResizablePanelSplitter />
212
229
  <ResizablePanel
213
- {...collapsibleSideBarGroupProps.remainingPanel}
230
+ {...(!editorStore.sideBarDisplayState.isOpen &&
231
+ !editorStore.showcasePanelDisplayState.isOpen
232
+ ? { flex: 1 }
233
+ : {})}
214
234
  minSize={300}
215
235
  >
216
236
  <ResizablePanelGroup orientation="horizontal">
@@ -250,9 +270,19 @@ export const Editor = withEditorStore(
250
270
  </ResizablePanel>
251
271
  </ResizablePanelGroup>
252
272
  </ResizablePanel>
273
+ <ResizablePanelSplitter />
274
+ <ResizablePanel
275
+ {...showcaseCollapsibleSideBarGroupProps.collapsiblePanel}
276
+ direction={-1}
277
+ >
278
+ <div className="panel__content explorer__content__container">
279
+ <ShowcaseManager />
280
+ </div>
281
+ </ResizablePanel>
253
282
  </ResizablePanelGroup>
254
283
  </div>
255
284
  </div>
285
+ <ShowcaseSideBar />
256
286
  </div>
257
287
  <QuickInput />
258
288
  <StatusBar actionsDisabled={!editable} />
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { observer } from 'mobx-react-lite';
18
+ import {
19
+ MenuContentDivider,
20
+ DoubleArrowLeft,
21
+ DoubleArrowRight,
22
+ } from '@finos/legend-art';
23
+ import { useEditorStore } from './EditorStoreProvider.js';
24
+ import type { EditorStore } from '../../stores/editor/EditorStore.js';
25
+
26
+ export enum SHOWCASE_PANEL_LOCAL_STORAGE {
27
+ PANEL_STATE_KEY = 'ShowShowcasePanel',
28
+ }
29
+
30
+ export const toggleShowcasePanel = (editorStore: EditorStore) => {
31
+ editorStore.showcasePanelDisplayState.toggle();
32
+ editorStore.applicationStore.userDataService.persistValue(
33
+ SHOWCASE_PANEL_LOCAL_STORAGE.PANEL_STATE_KEY,
34
+ editorStore.showcasePanelDisplayState.isOpen,
35
+ );
36
+ };
37
+
38
+ export const ShowcaseSideBar = observer(() => {
39
+ const editorStore = useEditorStore();
40
+
41
+ return (
42
+ <div className="activity-bar">
43
+ <div className="activity-bar__items">
44
+ <button
45
+ className="activity-bar__item"
46
+ onClick={() => {
47
+ toggleShowcasePanel(editorStore);
48
+ }}
49
+ tabIndex={-1}
50
+ title={
51
+ editorStore.showcasePanelDisplayState.isOpen
52
+ ? 'Close Showcases'
53
+ : 'Open Showcases'
54
+ }
55
+ >
56
+ {editorStore.showcasePanelDisplayState.isOpen ? (
57
+ <DoubleArrowRight />
58
+ ) : (
59
+ <DoubleArrowLeft />
60
+ )}
61
+ </button>
62
+ <MenuContentDivider />
63
+ </div>
64
+ </div>
65
+ );
66
+ });
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { observer } from 'mobx-react-lite';
18
+ import { useLegendStudioApplicationStore } from '../LegendStudioFrameworkProvider.js';
19
+
20
+ export const PureCompatibilityTestManager = observer(() => {
21
+ const studioApplicationStore = useLegendStudioApplicationStore();
22
+ const config = studioApplicationStore.config;
23
+ if (!config.pctReportUrl) {
24
+ return null;
25
+ }
26
+ return (
27
+ <div className="app__page">
28
+ <iframe
29
+ src={config.pctReportUrl}
30
+ style={{ width: '100%', height: '100%', border: 'none' }}
31
+ title="Legend Pure Compatibility Test"
32
+ />
33
+ </div>
34
+ );
35
+ });
@@ -109,7 +109,10 @@ import { GlobalBulkServiceRegistrationState } from './sidebar-state/BulkServiceR
109
109
  import { SQLPlaygroundPanelState } from './panel-group/SQLPlaygroundPanelState.js';
110
110
  import type { QuickInputState } from './QuickInputState.js';
111
111
  import { GlobalEndToEndWorkflowState } from './sidebar-state/end-to-end-workflow/GlobalEndToEndFlowState.js';
112
- import { openShowcaseManager } from '../ShowcaseManagerState.js';
112
+ import {
113
+ SHOWCASE_PANEL_LOCAL_STORAGE,
114
+ toggleShowcasePanel,
115
+ } from '../../components/editor/ShowcaseSideBar.js';
113
116
  import {
114
117
  GraphEditLazyGrammarModeState,
115
118
  LazyTextEditorStore,
@@ -196,6 +199,8 @@ export class EditorStore implements CommandRegistrar {
196
199
  default: 300,
197
200
  snap: 150,
198
201
  });
202
+ readonly showcasePanelDisplayState: PanelDisplayState;
203
+ readonly showcaseDefaultSize = 500;
199
204
  readonly tabManagerState = new EditorTabManagerState(this);
200
205
  supportedElementTypesWithCategory: Map<string, string[]>;
201
206
 
@@ -303,6 +308,24 @@ export class EditorStore implements CommandRegistrar {
303
308
  .filter(isNonNullable);
304
309
  this.supportedElementTypesWithCategory =
305
310
  this.getSupportedElementTypesWithCategory();
311
+
312
+ this.showcasePanelDisplayState = new PanelDisplayState({
313
+ initial: this.showcaseInitialSize,
314
+ default: this.showcaseDefaultSize,
315
+ snap: 150,
316
+ });
317
+ }
318
+
319
+ get showcaseInitialSize(): number {
320
+ const showcasesSavedAsOpen =
321
+ this.applicationStore.userDataService.getBooleanValue(
322
+ SHOWCASE_PANEL_LOCAL_STORAGE.PANEL_STATE_KEY,
323
+ );
324
+ if (showcasesSavedAsOpen || showcasesSavedAsOpen === undefined) {
325
+ return this.showcaseDefaultSize;
326
+ } else {
327
+ return 0;
328
+ }
306
329
  }
307
330
 
308
331
  get isInitialized(): boolean {
@@ -439,7 +462,7 @@ export class EditorStore implements CommandRegistrar {
439
462
  this.conflictResolutionState.hasResolvedAllConflicts),
440
463
  ),
441
464
  action: () => {
442
- openShowcaseManager(this.applicationStore);
465
+ toggleShowcasePanel(this);
443
466
  },
444
467
  });
445
468
  this.applicationStore.commandService.registerCommand({
package/tsconfig.json CHANGED
@@ -215,6 +215,7 @@
215
215
  "./src/components/editor/EditorStoreProvider.tsx",
216
216
  "./src/components/editor/EmbeddedQueryBuilder.tsx",
217
217
  "./src/components/editor/QuickInput.tsx",
218
+ "./src/components/editor/ShowcaseSideBar.tsx",
218
219
  "./src/components/editor/StatusBar.tsx",
219
220
  "./src/components/editor/__test-utils__/EditorComponentTestUtils.tsx",
220
221
  "./src/components/editor/command-center/ProjectSearchCommand.tsx",
@@ -321,6 +322,7 @@
321
322
  "./src/components/extensions/Core_LegendStudioApplicationPlugin.tsx",
322
323
  "./src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx",
323
324
  "./src/components/lazy-text-editor/LazyTextEditor.tsx",
325
+ "./src/components/pct/PureCompatibilityTest.tsx",
324
326
  "./src/components/project-reviewer/ProjectReviewSideBar.tsx",
325
327
  "./src/components/project-reviewer/ProjectReviewStoreProvider.tsx",
326
328
  "./src/components/project-reviewer/ProjectReviewer.tsx",