@finos/legend-application-studio 28.13.13 → 28.13.15
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.
- package/lib/__lib__/LegendStudioEvent.d.ts +3 -0
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +4 -2
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioNavigation.d.ts +7 -0
- package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioNavigation.js +2 -0
- package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +10 -0
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +10 -0
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
- package/lib/components/LegendStudioWebApplication.js +7 -1
- package/lib/components/LegendStudioWebApplication.js.map +1 -1
- package/lib/components/editor/ActivityBar.d.ts.map +1 -1
- package/lib/components/editor/ActivityBar.js +23 -14
- package/lib/components/editor/ActivityBar.js.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/GrammarTextEditor.js +11 -6
- package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
- package/lib/components/lazy-text-editor/LazyTextEditor.d.ts +18 -0
- package/lib/components/lazy-text-editor/LazyTextEditor.d.ts.map +1 -0
- package/lib/components/lazy-text-editor/LazyTextEditor.js +170 -0
- package/lib/components/lazy-text-editor/LazyTextEditor.js.map +1 -0
- package/lib/components/workspace-setup/WorkspaceSetup.js +13 -13
- package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/ShowcaseManagerState.d.ts +3 -1
- package/lib/stores/ShowcaseManagerState.d.ts.map +1 -1
- package/lib/stores/ShowcaseManagerState.js +29 -8
- package/lib/stores/ShowcaseManagerState.js.map +1 -1
- package/lib/stores/editor/EditorConfig.d.ts +2 -1
- package/lib/stores/editor/EditorConfig.d.ts.map +1 -1
- package/lib/stores/editor/EditorConfig.js +1 -0
- package/lib/stores/editor/EditorConfig.js.map +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts +1 -0
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +17 -0
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +4 -0
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +69 -6
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.d.ts +6 -1
- package/lib/stores/editor/GraphEditGrammarModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditGrammarModeState.js +6 -1
- package/lib/stores/editor/GraphEditGrammarModeState.js.map +1 -1
- package/lib/stores/editor/GraphEditorMode.d.ts +6 -1
- package/lib/stores/editor/GraphEditorMode.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditorMode.js +3 -0
- package/lib/stores/editor/GraphEditorMode.js.map +1 -1
- package/lib/stores/lazy-text-editor/LazyTextEditorStore.d.ts +30 -0
- package/lib/stores/lazy-text-editor/LazyTextEditorStore.d.ts.map +1 -0
- package/lib/stores/lazy-text-editor/LazyTextEditorStore.js +66 -0
- package/lib/stores/lazy-text-editor/LazyTextEditorStore.js.map +1 -0
- package/lib/stores/showcase/ShowcaseViewerStore.d.ts.map +1 -1
- package/lib/stores/showcase/ShowcaseViewerStore.js +3 -0
- package/lib/stores/showcase/ShowcaseViewerStore.js.map +1 -1
- package/package.json +6 -6
- package/src/__lib__/LegendStudioEvent.ts +4 -2
- package/src/__lib__/LegendStudioNavigation.ts +8 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +32 -0
- package/src/components/LegendStudioWebApplication.tsx +13 -1
- package/src/components/editor/ActivityBar.tsx +118 -111
- package/src/components/editor/editor-group/GrammarTextEditor.tsx +14 -7
- package/src/components/lazy-text-editor/LazyTextEditor.tsx +458 -0
- package/src/components/workspace-setup/WorkspaceSetup.tsx +21 -21
- package/src/stores/ShowcaseManagerState.ts +41 -11
- package/src/stores/editor/EditorConfig.ts +1 -0
- package/src/stores/editor/EditorGraphState.ts +25 -0
- package/src/stores/editor/EditorStore.ts +123 -8
- package/src/stores/editor/GraphEditGrammarModeState.ts +14 -2
- package/src/stores/editor/GraphEditorMode.ts +9 -1
- package/src/stores/lazy-text-editor/LazyTextEditorStore.ts +99 -0
- package/src/stores/showcase/ShowcaseViewerStore.ts +6 -0
- package/tsconfig.json +2 -0
@@ -0,0 +1,458 @@
|
|
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 { useEffect } from 'react';
|
18
|
+
import { observer } from 'mobx-react-lite';
|
19
|
+
import {
|
20
|
+
type ResizablePanelHandlerProps,
|
21
|
+
getCollapsiblePanelGroupProps,
|
22
|
+
ResizablePanel,
|
23
|
+
ResizablePanelGroup,
|
24
|
+
ResizablePanelSplitter,
|
25
|
+
useResizeDetector,
|
26
|
+
ResizablePanelSplitterLine,
|
27
|
+
clsx,
|
28
|
+
CodeBranchIcon,
|
29
|
+
ErrorIcon,
|
30
|
+
WarningIcon,
|
31
|
+
CloudUploadIcon,
|
32
|
+
TerminalIcon,
|
33
|
+
AssistantIcon,
|
34
|
+
HammerIcon,
|
35
|
+
} from '@finos/legend-art';
|
36
|
+
import {
|
37
|
+
generateSetupRoute,
|
38
|
+
type WorkspaceEditorPathParams,
|
39
|
+
} from '../../__lib__/LegendStudioNavigation.js';
|
40
|
+
import { guaranteeNonNullable } from '@finos/legend-shared';
|
41
|
+
import { flowResult } from 'mobx';
|
42
|
+
import {
|
43
|
+
useApplicationStore,
|
44
|
+
useApplicationNavigationContext,
|
45
|
+
useCommands,
|
46
|
+
} from '@finos/legend-application';
|
47
|
+
import { useParams } from '@finos/legend-application/browser';
|
48
|
+
import { WorkspaceType } from '@finos/legend-server-sdlc';
|
49
|
+
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../__lib__/LegendStudioApplicationNavigationContext.js';
|
50
|
+
import {
|
51
|
+
useEditorStore,
|
52
|
+
withEditorStore,
|
53
|
+
} from '../editor/EditorStoreProvider.js';
|
54
|
+
import { ActivityBar } from '../editor/ActivityBar.js';
|
55
|
+
import { SideBar } from '../editor/side-bar/SideBar.js';
|
56
|
+
import { GrammarTextEditor } from '../editor/editor-group/GrammarTextEditor.js';
|
57
|
+
import { PanelGroup } from '../editor/panel-group/PanelGroup.js';
|
58
|
+
import {
|
59
|
+
ACTIVITY_MODE,
|
60
|
+
GRAPH_EDITOR_MODE,
|
61
|
+
PANEL_MODE,
|
62
|
+
} from '../../stores/editor/EditorConfig.js';
|
63
|
+
import { QuickInput } from '../editor/QuickInput.js';
|
64
|
+
import { useLegendStudioApplicationStore } from '../LegendStudioFrameworkProvider.js';
|
65
|
+
import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
|
66
|
+
|
67
|
+
const LazyStatusBar = observer((props: { actionsDisabled: boolean }) => {
|
68
|
+
const { actionsDisabled } = props;
|
69
|
+
const params = useParams<WorkspaceEditorPathParams>();
|
70
|
+
const editorStore = useEditorStore();
|
71
|
+
const applicationStore = useLegendStudioApplicationStore();
|
72
|
+
const isInConflictResolutionMode = editorStore.isInConflictResolutionMode;
|
73
|
+
// SDLC
|
74
|
+
const projectId = params.projectId;
|
75
|
+
const workspaceType = params.groupWorkspaceId
|
76
|
+
? WorkspaceType.GROUP
|
77
|
+
: WorkspaceType.USER;
|
78
|
+
const patchReleaseVersionId = params.patchReleaseVersionId
|
79
|
+
? `patch / ${params.patchReleaseVersionId} / `
|
80
|
+
: '';
|
81
|
+
const workspaceId = guaranteeNonNullable(
|
82
|
+
params.groupWorkspaceId ?? params.workspaceId,
|
83
|
+
`Workspace/group workspace ID is not provided`,
|
84
|
+
);
|
85
|
+
const currentProject = editorStore.sdlcState.currentProject;
|
86
|
+
const goToWorkspaceUpdater = (): void =>
|
87
|
+
editorStore.setActiveActivity(
|
88
|
+
isInConflictResolutionMode
|
89
|
+
? ACTIVITY_MODE.CONFLICT_RESOLUTION
|
90
|
+
: ACTIVITY_MODE.WORKSPACE_UPDATER,
|
91
|
+
);
|
92
|
+
|
93
|
+
const goToLocalChanges = (): void =>
|
94
|
+
editorStore.setActiveActivity(ACTIVITY_MODE.LOCAL_CHANGES);
|
95
|
+
// Change Detection
|
96
|
+
const changes =
|
97
|
+
editorStore.changeDetectionState.workspaceLocalLatestRevisionState.changes
|
98
|
+
.length;
|
99
|
+
|
100
|
+
const configurationState = editorStore.projectConfigurationEditorState;
|
101
|
+
const pushLocalChanges = applicationStore.guardUnhandledError(() =>
|
102
|
+
flowResult(editorStore.localChangesState.pushLocalChanges()),
|
103
|
+
);
|
104
|
+
// TODO: we probably should refactor this, these messages are not that helpful and
|
105
|
+
// meant for different purposes
|
106
|
+
const pushStatusText =
|
107
|
+
editorStore.graphManagerState.graphBuildState.hasFailed ||
|
108
|
+
editorStore.changeDetectionState.initState.hasFailed
|
109
|
+
? 'change detection halted'
|
110
|
+
: !editorStore.changeDetectionState.initState.hasSucceeded
|
111
|
+
? editorStore.changeDetectionState.workspaceLocalLatestRevisionState
|
112
|
+
.isBuildingEntityHashesIndex
|
113
|
+
? 'building indexes...'
|
114
|
+
: 'starting change detection...'
|
115
|
+
: editorStore.localChangesState.pushChangesState.isInProgress
|
116
|
+
? 'pushing local changes...'
|
117
|
+
: configurationState.updatingConfigurationState.isInProgress
|
118
|
+
? 'updating configuration...'
|
119
|
+
: changes
|
120
|
+
? `${changes} unpushed changes`
|
121
|
+
: 'no changes detected';
|
122
|
+
const workspaceOutOfSync =
|
123
|
+
!actionsDisabled && editorStore.sdlcState.isWorkspaceOutOfSync;
|
124
|
+
|
125
|
+
// Problems
|
126
|
+
const error = editorStore.graphState.error;
|
127
|
+
const warnings = editorStore.graphState.warnings;
|
128
|
+
|
129
|
+
// Other actions
|
130
|
+
const togglePanel = (): void => editorStore.panelGroupDisplayState.toggle();
|
131
|
+
|
132
|
+
const showCompilationWarnings = (): void => {
|
133
|
+
editorStore.panelGroupDisplayState.open();
|
134
|
+
editorStore.setActivePanelMode(PANEL_MODE.PROBLEMS);
|
135
|
+
};
|
136
|
+
const compile = applicationStore.guardUnhandledError(() =>
|
137
|
+
flowResult(editorStore.graphEditorMode.globalCompile()),
|
138
|
+
);
|
139
|
+
const toggleAssistant = (): void =>
|
140
|
+
applicationStore.assistantService.toggleAssistant();
|
141
|
+
|
142
|
+
return (
|
143
|
+
<div
|
144
|
+
data-testid={LEGEND_STUDIO_TEST_ID.STATUS_BAR}
|
145
|
+
className={clsx('editor__status-bar', 'lazy-text-editor__status-bar')}
|
146
|
+
>
|
147
|
+
<div className="editor__status-bar__left">
|
148
|
+
<div className="editor__status-bar__workspace">
|
149
|
+
<div className="editor__status-bar__workspace__icon">
|
150
|
+
<CodeBranchIcon />
|
151
|
+
</div>
|
152
|
+
<button
|
153
|
+
className="editor__status-bar__workspace__project"
|
154
|
+
title="Go back to workspace setup using the specified project"
|
155
|
+
tabIndex={-1}
|
156
|
+
onClick={(): void =>
|
157
|
+
applicationStore.navigationService.navigator.visitAddress(
|
158
|
+
applicationStore.navigationService.navigator.generateAddress(
|
159
|
+
generateSetupRoute(projectId, undefined),
|
160
|
+
),
|
161
|
+
)
|
162
|
+
}
|
163
|
+
>
|
164
|
+
{currentProject?.name ?? 'unknown'}
|
165
|
+
</button>
|
166
|
+
/
|
167
|
+
<button
|
168
|
+
className="editor__status-bar__workspace__workspace"
|
169
|
+
title="Go back to workspace setup using the specified workspace"
|
170
|
+
tabIndex={-1}
|
171
|
+
onClick={(): void =>
|
172
|
+
applicationStore.navigationService.navigator.visitAddress(
|
173
|
+
applicationStore.navigationService.navigator.generateAddress(
|
174
|
+
generateSetupRoute(projectId, workspaceId, workspaceType),
|
175
|
+
),
|
176
|
+
)
|
177
|
+
}
|
178
|
+
>
|
179
|
+
{patchReleaseVersionId}
|
180
|
+
{workspaceId}
|
181
|
+
{editorStore.localChangesState.hasUnpushedChanges ? '*' : ''}
|
182
|
+
</button>
|
183
|
+
{workspaceOutOfSync && (
|
184
|
+
<button
|
185
|
+
className="editor__status-bar__workspace__status__btn"
|
186
|
+
tabIndex={-1}
|
187
|
+
onClick={goToLocalChanges}
|
188
|
+
title={
|
189
|
+
'Local workspace is out-of-sync. Click to see incoming changes to your workspace.'
|
190
|
+
}
|
191
|
+
>
|
192
|
+
OUT-OF-SYNC
|
193
|
+
</button>
|
194
|
+
)}
|
195
|
+
{editorStore.sdlcState.isWorkspaceOutdated && !workspaceOutOfSync && (
|
196
|
+
<button
|
197
|
+
className="editor__status-bar__workspace__status__btn"
|
198
|
+
tabIndex={-1}
|
199
|
+
onClick={goToWorkspaceUpdater}
|
200
|
+
title={
|
201
|
+
'Workspace is outdated. Click to see latest changes of the project'
|
202
|
+
}
|
203
|
+
>
|
204
|
+
OUTDATED
|
205
|
+
</button>
|
206
|
+
)}
|
207
|
+
<button
|
208
|
+
className="editor__status-bar__problems"
|
209
|
+
tabIndex={-1}
|
210
|
+
onClick={showCompilationWarnings}
|
211
|
+
title={`${error ? 'Error: 1, ' : ''}Warnings: ${warnings.length}`}
|
212
|
+
>
|
213
|
+
<div className="editor__status-bar__problems__icon">
|
214
|
+
<ErrorIcon />
|
215
|
+
</div>
|
216
|
+
<div className="editor__status-bar__problems__counter">
|
217
|
+
{error ? 1 : 0}
|
218
|
+
</div>
|
219
|
+
<div className="editor__status-bar__problems__icon">
|
220
|
+
<WarningIcon />
|
221
|
+
</div>
|
222
|
+
<div className="editor__status-bar__problems__counter">
|
223
|
+
{warnings.length}
|
224
|
+
</div>
|
225
|
+
</button>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
<div
|
229
|
+
data-testid={LEGEND_STUDIO_TEST_ID.EDITOR__STATUS_BAR__RIGHT}
|
230
|
+
className="editor__status-bar__right"
|
231
|
+
>
|
232
|
+
{!isInConflictResolutionMode && (
|
233
|
+
<div className="editor__status-bar__workspace-sync">
|
234
|
+
<div className="editor__status-bar__workspace-sync__status">
|
235
|
+
{pushStatusText}
|
236
|
+
</div>
|
237
|
+
<button
|
238
|
+
className={clsx('editor__status-bar__push-changes__btn', {
|
239
|
+
'editor__status-bar__push-changes__btn--loading':
|
240
|
+
editorStore.localChangesState.pushChangesState.isInProgress ||
|
241
|
+
configurationState.updatingConfigurationState.isInProgress,
|
242
|
+
})}
|
243
|
+
onClick={pushLocalChanges}
|
244
|
+
disabled={
|
245
|
+
!changes ||
|
246
|
+
configurationState.updatingConfigurationState.isInProgress ||
|
247
|
+
editorStore.localChangesState.pushChangesState.isInProgress ||
|
248
|
+
editorStore.changeDetectionState
|
249
|
+
.workspaceLocalLatestRevisionState
|
250
|
+
.isBuildingEntityHashesIndex ||
|
251
|
+
actionsDisabled
|
252
|
+
}
|
253
|
+
tabIndex={-1}
|
254
|
+
title="Push local changes (Ctrl + S)"
|
255
|
+
>
|
256
|
+
<CloudUploadIcon />
|
257
|
+
</button>
|
258
|
+
</div>
|
259
|
+
)}
|
260
|
+
<button
|
261
|
+
className={clsx(
|
262
|
+
'editor__status-bar__action editor__status-bar__compile-btn',
|
263
|
+
{
|
264
|
+
'editor__status-bar__compile-btn--wiggling':
|
265
|
+
editorStore.graphState.isRunningGlobalCompile,
|
266
|
+
},
|
267
|
+
)}
|
268
|
+
disabled={
|
269
|
+
editorStore.graphState.isApplicationUpdateOperationIsRunning ||
|
270
|
+
actionsDisabled
|
271
|
+
}
|
272
|
+
onClick={compile}
|
273
|
+
tabIndex={-1}
|
274
|
+
title="Compile (F9)"
|
275
|
+
>
|
276
|
+
<HammerIcon />
|
277
|
+
</button>
|
278
|
+
<button
|
279
|
+
className={clsx(
|
280
|
+
'editor__status-bar__action editor__status-bar__action__toggler',
|
281
|
+
{
|
282
|
+
'editor__status-bar__action__toggler--active':
|
283
|
+
editorStore.panelGroupDisplayState.isOpen,
|
284
|
+
},
|
285
|
+
)}
|
286
|
+
onClick={togglePanel}
|
287
|
+
tabIndex={-1}
|
288
|
+
title="Toggle panel (Ctrl + `)"
|
289
|
+
>
|
290
|
+
<TerminalIcon />
|
291
|
+
</button>
|
292
|
+
<button
|
293
|
+
className={clsx(
|
294
|
+
'editor__status-bar__action editor__status-bar__action__toggler',
|
295
|
+
{
|
296
|
+
'editor__status-bar__action__toggler--active':
|
297
|
+
!applicationStore.assistantService.isHidden,
|
298
|
+
},
|
299
|
+
)}
|
300
|
+
onClick={toggleAssistant}
|
301
|
+
tabIndex={-1}
|
302
|
+
title="Toggle assistant"
|
303
|
+
>
|
304
|
+
<AssistantIcon />
|
305
|
+
</button>
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
);
|
309
|
+
});
|
310
|
+
|
311
|
+
export const LazyTextEditor = withEditorStore(
|
312
|
+
observer(() => {
|
313
|
+
const params = useParams<WorkspaceEditorPathParams>();
|
314
|
+
const projectId = params.projectId;
|
315
|
+
const patchReleaseVersionId = params.patchReleaseVersionId;
|
316
|
+
const workspaceType = params.groupWorkspaceId
|
317
|
+
? WorkspaceType.GROUP
|
318
|
+
: WorkspaceType.USER;
|
319
|
+
const workspaceId = guaranteeNonNullable(
|
320
|
+
params.groupWorkspaceId ?? params.workspaceId,
|
321
|
+
`Workspace/group workspace ID is not provided`,
|
322
|
+
);
|
323
|
+
const editorStore = useEditorStore();
|
324
|
+
const applicationStore = useApplicationStore();
|
325
|
+
const editable =
|
326
|
+
editorStore.graphManagerState.graphBuildState.hasCompleted &&
|
327
|
+
editorStore.isInitialized;
|
328
|
+
|
329
|
+
// layout
|
330
|
+
const { ref, width, height } = useResizeDetector<HTMLDivElement>();
|
331
|
+
// These create snapping effect on panel resizing
|
332
|
+
const resizeSideBar = (handleProps: ResizablePanelHandlerProps): void =>
|
333
|
+
editorStore.sideBarDisplayState.setSize(
|
334
|
+
(handleProps.domElement as HTMLDivElement).getBoundingClientRect()
|
335
|
+
.width,
|
336
|
+
);
|
337
|
+
const resizePanel = (handleProps: ResizablePanelHandlerProps): void =>
|
338
|
+
editorStore.panelGroupDisplayState.setSize(
|
339
|
+
(handleProps.domElement as HTMLDivElement).getBoundingClientRect()
|
340
|
+
.height,
|
341
|
+
);
|
342
|
+
const collapsibleSideBarGroupProps = getCollapsiblePanelGroupProps(
|
343
|
+
editorStore.sideBarDisplayState.size === 0,
|
344
|
+
{
|
345
|
+
onStopResize: resizeSideBar,
|
346
|
+
size: editorStore.sideBarDisplayState.size,
|
347
|
+
},
|
348
|
+
);
|
349
|
+
const collapsiblePanelGroupProps = getCollapsiblePanelGroupProps(
|
350
|
+
editorStore.panelGroupDisplayState.size === 0,
|
351
|
+
{
|
352
|
+
onStopResize: resizePanel,
|
353
|
+
size: editorStore.panelGroupDisplayState.size,
|
354
|
+
},
|
355
|
+
);
|
356
|
+
const maximizedCollapsiblePanelGroupProps = getCollapsiblePanelGroupProps(
|
357
|
+
editorStore.panelGroupDisplayState.isMaximized,
|
358
|
+
);
|
359
|
+
// Extensions
|
360
|
+
useEffect(() => {
|
361
|
+
if (ref.current) {
|
362
|
+
editorStore.panelGroupDisplayState.setMaxSize(ref.current.offsetHeight);
|
363
|
+
}
|
364
|
+
}, [editorStore, ref, height, width]);
|
365
|
+
|
366
|
+
// initialize
|
367
|
+
useEffect(() => {
|
368
|
+
editorStore.internalizeEntityPath(params);
|
369
|
+
}, [editorStore, params]);
|
370
|
+
useEffect(() => {
|
371
|
+
flowResult(
|
372
|
+
editorStore.lazyTextEditorStore.init(
|
373
|
+
projectId,
|
374
|
+
patchReleaseVersionId,
|
375
|
+
workspaceId,
|
376
|
+
workspaceType,
|
377
|
+
),
|
378
|
+
).catch(applicationStore.alertUnhandledError);
|
379
|
+
}, [
|
380
|
+
editorStore,
|
381
|
+
patchReleaseVersionId,
|
382
|
+
applicationStore,
|
383
|
+
projectId,
|
384
|
+
workspaceId,
|
385
|
+
workspaceType,
|
386
|
+
]);
|
387
|
+
|
388
|
+
useApplicationNavigationContext(
|
389
|
+
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.EDITOR,
|
390
|
+
);
|
391
|
+
|
392
|
+
useCommands(editorStore);
|
393
|
+
|
394
|
+
// Cleanup the editor
|
395
|
+
useEffect(() => (): void => editorStore.cleanUp(), [editorStore]);
|
396
|
+
return (
|
397
|
+
<div className="app__page">
|
398
|
+
<div className="editor">
|
399
|
+
<div className="editor__body">
|
400
|
+
<ActivityBar />
|
401
|
+
<div ref={ref} className="editor__content-container">
|
402
|
+
<div className="editor__content">
|
403
|
+
<ResizablePanelGroup orientation="vertical">
|
404
|
+
<ResizablePanel
|
405
|
+
{...collapsibleSideBarGroupProps.collapsiblePanel}
|
406
|
+
direction={1}
|
407
|
+
>
|
408
|
+
<SideBar />
|
409
|
+
</ResizablePanel>
|
410
|
+
<ResizablePanelSplitter />
|
411
|
+
<ResizablePanel
|
412
|
+
{...collapsibleSideBarGroupProps.remainingPanel}
|
413
|
+
minSize={300}
|
414
|
+
>
|
415
|
+
<ResizablePanelGroup orientation="horizontal">
|
416
|
+
<ResizablePanel
|
417
|
+
{...maximizedCollapsiblePanelGroupProps.collapsiblePanel}
|
418
|
+
{...(editorStore.panelGroupDisplayState.size === 0
|
419
|
+
? collapsiblePanelGroupProps.remainingPanel
|
420
|
+
: {})}
|
421
|
+
>
|
422
|
+
{editable &&
|
423
|
+
editorStore.graphEditorMode.mode ===
|
424
|
+
GRAPH_EDITOR_MODE.GRAMMAR_TEXT && (
|
425
|
+
<GrammarTextEditor />
|
426
|
+
)}
|
427
|
+
</ResizablePanel>
|
428
|
+
<ResizablePanelSplitter>
|
429
|
+
<ResizablePanelSplitterLine
|
430
|
+
color={
|
431
|
+
editorStore.panelGroupDisplayState.isMaximized
|
432
|
+
? 'transparent'
|
433
|
+
: 'var(--color-dark-grey-250)'
|
434
|
+
}
|
435
|
+
/>
|
436
|
+
</ResizablePanelSplitter>
|
437
|
+
<ResizablePanel
|
438
|
+
{...collapsiblePanelGroupProps.collapsiblePanel}
|
439
|
+
{...(editorStore.panelGroupDisplayState.isMaximized
|
440
|
+
? maximizedCollapsiblePanelGroupProps.remainingPanel
|
441
|
+
: {})}
|
442
|
+
direction={-1}
|
443
|
+
>
|
444
|
+
<PanelGroup />
|
445
|
+
</ResizablePanel>
|
446
|
+
</ResizablePanelGroup>
|
447
|
+
</ResizablePanel>
|
448
|
+
</ResizablePanelGroup>
|
449
|
+
</div>
|
450
|
+
</div>
|
451
|
+
</div>
|
452
|
+
<QuickInput />
|
453
|
+
<LazyStatusBar actionsDisabled={!editable} />
|
454
|
+
</div>
|
455
|
+
</div>
|
456
|
+
);
|
457
|
+
}),
|
458
|
+
);
|
@@ -32,8 +32,8 @@ import {
|
|
32
32
|
LongArrowRightIcon,
|
33
33
|
DividerWithText,
|
34
34
|
SearchIcon,
|
35
|
-
FileImportIcon,
|
36
35
|
BaseCard,
|
36
|
+
OpenIcon,
|
37
37
|
} from '@finos/legend-art';
|
38
38
|
import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
|
39
39
|
import {
|
@@ -108,7 +108,7 @@ export const ShowcaseCard: React.FC<{ hideDocumentation?: boolean }> = (
|
|
108
108
|
title: 'Showcase explorer',
|
109
109
|
content: (
|
110
110
|
<div className="workspace-setup__content__card__action__icon">
|
111
|
-
<
|
111
|
+
<OpenIcon />
|
112
112
|
</div>
|
113
113
|
),
|
114
114
|
action: () => openShowcaseManager(applicationStore),
|
@@ -145,7 +145,7 @@ export const DocumentationCard: React.FC = () => {
|
|
145
145
|
title: 'Review documentation',
|
146
146
|
content: (
|
147
147
|
<div className="workspace-setup__content__card__action__icon">
|
148
|
-
<
|
148
|
+
<OpenIcon />
|
149
149
|
</div>
|
150
150
|
),
|
151
151
|
action: () => {
|
@@ -180,7 +180,7 @@ export const ProductionCard: React.FC = () => {
|
|
180
180
|
title: productionDocument.text,
|
181
181
|
content: (
|
182
182
|
<div className="workspace-setup__content__card__action__icon">
|
183
|
-
<
|
183
|
+
<OpenIcon />
|
184
184
|
</div>
|
185
185
|
),
|
186
186
|
action: () => {
|
@@ -216,7 +216,7 @@ export const SandboxCard: React.FC = () => {
|
|
216
216
|
title: sandboxDocument.text,
|
217
217
|
content: (
|
218
218
|
<div className="workspace-setup__content__card__action__icon">
|
219
|
-
<
|
219
|
+
<OpenIcon />
|
220
220
|
</div>
|
221
221
|
),
|
222
222
|
action: () => {
|
@@ -254,7 +254,7 @@ export const RuleEngagementCard: React.FC = () => {
|
|
254
254
|
title: ruleEngagementDocument.text,
|
255
255
|
content: (
|
256
256
|
<div className="workspace-setup__content__card__action__icon">
|
257
|
-
<
|
257
|
+
<OpenIcon />
|
258
258
|
</div>
|
259
259
|
),
|
260
260
|
action: () => {
|
@@ -443,7 +443,7 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
|
|
443
443
|
<div className="workspace-setup__selectors__container">
|
444
444
|
<div className="workspace-setup__selector">
|
445
445
|
<div className="workspace-setup__selector__header">
|
446
|
-
Search for project
|
446
|
+
Search for an existing project
|
447
447
|
</div>
|
448
448
|
<div className="workspace-setup__selector__content">
|
449
449
|
<div
|
@@ -478,7 +478,7 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
|
|
478
478
|
</div>
|
479
479
|
<div className="workspace-setup__selector">
|
480
480
|
<div className="workspace-setup__selector__header">
|
481
|
-
Choose
|
481
|
+
Choose an existing workspace
|
482
482
|
</div>
|
483
483
|
<div className="workspace-setup__selector__content">
|
484
484
|
<div
|
@@ -534,6 +534,19 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
|
|
534
534
|
</div>
|
535
535
|
<div className="workspace-setup__actions-combo">
|
536
536
|
<div className="workspace-setup__actions">
|
537
|
+
<button
|
538
|
+
className="workspace-setup__new-workspace-btn"
|
539
|
+
onClick={showCreateWorkspaceModal}
|
540
|
+
title="Create a Workspace after choosing one project"
|
541
|
+
disabled={
|
542
|
+
!setupStore.currentProject ||
|
543
|
+
!setupStore.currentProjectConfigurationStatus ||
|
544
|
+
!setupStore.currentProjectConfigurationStatus
|
545
|
+
.isConfigured
|
546
|
+
}
|
547
|
+
>
|
548
|
+
{`Don't have a workspace?`}
|
549
|
+
</button>
|
537
550
|
<div className="workspace-setup__actions__button">
|
538
551
|
<button
|
539
552
|
className="workspace-setup__go-btn btn--dark"
|
@@ -566,19 +579,6 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
|
|
566
579
|
>
|
567
580
|
Create New Project
|
568
581
|
</button>
|
569
|
-
<button
|
570
|
-
className="workspace-setup__new-btn btn--dark"
|
571
|
-
onClick={showCreateWorkspaceModal}
|
572
|
-
title="Create a Workspace after choosing one project"
|
573
|
-
disabled={
|
574
|
-
!setupStore.currentProject ||
|
575
|
-
!setupStore.currentProjectConfigurationStatus ||
|
576
|
-
!setupStore.currentProjectConfigurationStatus
|
577
|
-
.isConfigured
|
578
|
-
}
|
579
|
-
>
|
580
|
-
Create New Workspace
|
581
|
-
</button>
|
582
582
|
</div>
|
583
583
|
</div>
|
584
584
|
</div>
|