@finos/legend-application-studio 28.15.2 → 28.15.4
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__/LegendStudioNavigation.d.ts +1 -1
- package/lib/components/LegendStudioWebApplication.js +2 -2
- package/lib/components/editor/editor-group/diff-editor/ProjectConfigDiffView.d.ts +22 -0
- package/lib/components/editor/editor-group/diff-editor/ProjectConfigDiffView.d.ts.map +1 -0
- package/lib/components/editor/editor-group/diff-editor/ProjectConfigDiffView.js +26 -0
- package/lib/components/editor/editor-group/diff-editor/ProjectConfigDiffView.js.map +1 -0
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.d.ts.map +1 -1
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js +0 -2
- package/lib/components/extensions/Core_LegendStudioApplicationPlugin.js.map +1 -1
- package/lib/components/{workspace-review/WorkspaceReviewSideBar.d.ts → project-reviewer/ProjectReviewSideBar.d.ts} +2 -2
- package/lib/components/project-reviewer/ProjectReviewSideBar.d.ts.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReviewSideBar.js → project-reviewer/ProjectReviewSideBar.js} +34 -18
- package/lib/components/project-reviewer/ProjectReviewSideBar.js.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReviewStoreProvider.d.ts → project-reviewer/ProjectReviewStoreProvider.d.ts} +5 -5
- package/lib/components/project-reviewer/ProjectReviewStoreProvider.d.ts.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReviewStoreProvider.js → project-reviewer/ProjectReviewStoreProvider.js} +9 -9
- package/lib/components/project-reviewer/ProjectReviewStoreProvider.js.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReview.d.ts → project-reviewer/ProjectReviewer.d.ts} +2 -2
- package/lib/components/project-reviewer/ProjectReviewer.d.ts.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReview.js → project-reviewer/ProjectReviewer.js} +19 -28
- package/lib/components/project-reviewer/ProjectReviewer.js.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReviewPanel.d.ts → project-reviewer/ProjectReviewerPanel.d.ts} +2 -2
- package/lib/components/project-reviewer/ProjectReviewerPanel.d.ts.map +1 -0
- package/lib/components/{workspace-review/WorkspaceReviewPanel.js → project-reviewer/ProjectReviewerPanel.js} +26 -10
- package/lib/components/project-reviewer/ProjectReviewerPanel.js.map +1 -0
- package/lib/index.css +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.d.ts +24 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.js +26 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.js.map +1 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.d.ts +31 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.js +39 -0
- package/lib/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/FunctionActivatorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +5 -4
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.d.ts +2 -2
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.js +2 -2
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.d.ts +0 -2
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.js +1 -3
- package/lib/stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.js.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts +73 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js +303 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -0
- package/package.json +7 -7
- package/src/__lib__/LegendStudioNavigation.ts +1 -1
- package/src/components/LegendStudioWebApplication.tsx +2 -2
- package/src/components/editor/editor-group/diff-editor/ProjectConfigDiffView.tsx +60 -0
- package/src/components/extensions/Core_LegendStudioApplicationPlugin.tsx +0 -2
- package/src/components/{workspace-review/WorkspaceReviewSideBar.tsx → project-reviewer/ProjectReviewSideBar.tsx} +91 -11
- package/src/components/{workspace-review/WorkspaceReviewStoreProvider.tsx → project-reviewer/ProjectReviewStoreProvider.tsx} +13 -13
- package/src/components/{workspace-review/WorkspaceReview.tsx → project-reviewer/ProjectReviewer.tsx} +25 -55
- package/src/components/{workspace-review/WorkspaceReviewPanel.tsx → project-reviewer/ProjectReviewerPanel.tsx} +54 -36
- package/src/stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.ts +34 -0
- package/src/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.ts +56 -0
- package/src/stores/editor/editor-state/element-editor-state/FunctionActivatorState.ts +2 -1
- package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +6 -3
- package/src/stores/editor/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.ts +1 -1
- package/src/stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.ts +2 -2
- package/src/stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.ts +1 -3
- package/src/stores/{workspace-review/WorkspaceReviewStore.ts → project-reviewer/ProjectReviewerStore.ts} +235 -57
- package/tsconfig.json +8 -5
- package/lib/components/workspace-review/WorkspaceReview.d.ts.map +0 -1
- package/lib/components/workspace-review/WorkspaceReview.js.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewPanel.d.ts.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewPanel.js.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewSideBar.d.ts.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewSideBar.js.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewStoreProvider.d.ts.map +0 -1
- package/lib/components/workspace-review/WorkspaceReviewStoreProvider.js.map +0 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts +0 -47
- package/lib/stores/workspace-review/WorkspaceReviewStore.d.ts.map +0 -1
- package/lib/stores/workspace-review/WorkspaceReviewStore.js +0 -207
- package/lib/stores/workspace-review/WorkspaceReviewStore.js.map +0 -1
|
@@ -16,43 +16,43 @@
|
|
|
16
16
|
|
|
17
17
|
import { createContext, useContext } from 'react';
|
|
18
18
|
import { useLocalObservable } from 'mobx-react-lite';
|
|
19
|
-
import {
|
|
19
|
+
import { ProjectReviewerStore } from '../../stores/project-reviewer/ProjectReviewerStore.js';
|
|
20
20
|
import { EDITOR_MODE } from '../../stores/editor/EditorConfig.js';
|
|
21
21
|
import { guaranteeNonNullable } from '@finos/legend-shared';
|
|
22
22
|
import { useEditorStore } from '../editor/EditorStoreProvider.js';
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const ProjectReviewerStoreContext = createContext<
|
|
25
|
+
ProjectReviewerStore | undefined
|
|
26
26
|
>(undefined);
|
|
27
27
|
|
|
28
|
-
export const
|
|
28
|
+
export const ProjectReviewerStoreProvider = ({
|
|
29
29
|
children,
|
|
30
30
|
}: {
|
|
31
31
|
children: React.ReactNode;
|
|
32
32
|
}): React.ReactElement => {
|
|
33
33
|
const editorStore = useEditorStore();
|
|
34
34
|
editorStore.setMode(EDITOR_MODE.REVIEW);
|
|
35
|
-
const store = useLocalObservable(() => new
|
|
35
|
+
const store = useLocalObservable(() => new ProjectReviewerStore(editorStore));
|
|
36
36
|
return (
|
|
37
|
-
<
|
|
37
|
+
<ProjectReviewerStoreContext.Provider value={store}>
|
|
38
38
|
{children}
|
|
39
|
-
</
|
|
39
|
+
</ProjectReviewerStoreContext.Provider>
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const
|
|
43
|
+
export const useProjectReviewerStore = (): ProjectReviewerStore =>
|
|
44
44
|
guaranteeNonNullable(
|
|
45
|
-
useContext(
|
|
45
|
+
useContext(ProjectReviewerStoreContext),
|
|
46
46
|
`Can't find workspace review store in context`,
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
export const
|
|
49
|
+
export const withProjectReviewerStore = (
|
|
50
50
|
WrappedComponent: React.FC,
|
|
51
51
|
): React.FC =>
|
|
52
|
-
function
|
|
52
|
+
function WithProjecteReviewerStore() {
|
|
53
53
|
return (
|
|
54
|
-
<
|
|
54
|
+
<ProjectReviewerStoreProvider>
|
|
55
55
|
<WrappedComponent />
|
|
56
|
-
</
|
|
56
|
+
</ProjectReviewerStoreProvider>
|
|
57
57
|
);
|
|
58
58
|
};
|
package/src/components/{workspace-review/WorkspaceReview.tsx → project-reviewer/ProjectReviewer.tsx}
RENAMED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
import { useEffect } from 'react';
|
|
18
18
|
import { observer } from 'mobx-react-lite';
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} from './
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
20
|
+
useProjectReviewerStore,
|
|
21
|
+
withProjectReviewerStore,
|
|
22
|
+
} from './ProjectReviewStoreProvider.js';
|
|
23
|
+
import { ProjectReviewerSideBar } from './ProjectReviewSideBar.js';
|
|
24
|
+
import { ProjectReviewerPanel } from './ProjectReviewerPanel.js';
|
|
25
25
|
import { ACTIVITY_MODE } from '../../stores/editor/EditorConfig.js';
|
|
26
26
|
import {
|
|
27
27
|
type ResizablePanelHandlerProps,
|
|
@@ -33,15 +33,13 @@ import {
|
|
|
33
33
|
ResizablePanelSplitter,
|
|
34
34
|
CheckListIcon,
|
|
35
35
|
CodeBranchIcon,
|
|
36
|
-
CogIcon,
|
|
37
36
|
UserIcon,
|
|
38
37
|
AssistantIcon,
|
|
39
38
|
} from '@finos/legend-art';
|
|
40
39
|
import {
|
|
41
|
-
type
|
|
40
|
+
type ProjectReviewerPathParams,
|
|
42
41
|
generateSetupRoute,
|
|
43
42
|
} from '../../__lib__/LegendStudioNavigation.js';
|
|
44
|
-
import { flowResult } from 'mobx';
|
|
45
43
|
import {
|
|
46
44
|
useEditorStore,
|
|
47
45
|
withEditorStore,
|
|
@@ -49,8 +47,8 @@ import {
|
|
|
49
47
|
import { useApplicationStore } from '@finos/legend-application';
|
|
50
48
|
import { useParams } from '@finos/legend-application/browser';
|
|
51
49
|
|
|
52
|
-
const
|
|
53
|
-
const reviewStore =
|
|
50
|
+
const ProjectReviewerStatusBar = observer(() => {
|
|
51
|
+
const reviewStore = useProjectReviewerStore();
|
|
54
52
|
const editorStore = useEditorStore();
|
|
55
53
|
const applicationStore = useApplicationStore();
|
|
56
54
|
const currentUserId =
|
|
@@ -59,15 +57,15 @@ const WorkspaceReviewStatusBar = observer(() => {
|
|
|
59
57
|
? reviewStore.currentProject.name
|
|
60
58
|
: reviewStore.projectId;
|
|
61
59
|
const review = reviewStore.review;
|
|
62
|
-
const reviewStatus = reviewStore.
|
|
60
|
+
const reviewStatus = reviewStore.approveState.isInProgress
|
|
63
61
|
? 'approving review...'
|
|
64
|
-
: reviewStore.
|
|
62
|
+
: reviewStore.commitState.isInProgress
|
|
65
63
|
? 'committing review...'
|
|
66
|
-
: reviewStore.
|
|
64
|
+
: reviewStore.closeState.isInProgress
|
|
67
65
|
? 'closing review...'
|
|
68
|
-
: reviewStore.
|
|
66
|
+
: reviewStore.reOpenState.isInProgress
|
|
69
67
|
? 'reopening review...'
|
|
70
|
-
: reviewStore.
|
|
68
|
+
: reviewStore.fetchComparisonState.isInProgress
|
|
71
69
|
? 'loading changes...'
|
|
72
70
|
: undefined;
|
|
73
71
|
const toggleAssistant = (): void =>
|
|
@@ -149,10 +147,8 @@ const WorkspaceReviewStatusBar = observer(() => {
|
|
|
149
147
|
);
|
|
150
148
|
});
|
|
151
149
|
|
|
152
|
-
const
|
|
153
|
-
const reviewStore = useWorkspaceReviewStore();
|
|
150
|
+
const ProjectReviewerExplorer = observer(() => {
|
|
154
151
|
const editorStore = useEditorStore();
|
|
155
|
-
const applicationStore = useApplicationStore();
|
|
156
152
|
|
|
157
153
|
// layout
|
|
158
154
|
const resizeSideBar = (handleProps: ResizablePanelHandlerProps): void =>
|
|
@@ -166,64 +162,47 @@ const WorkspaceReviewExplorer = observer(() => {
|
|
|
166
162
|
size: editorStore.sideBarDisplayState.size,
|
|
167
163
|
},
|
|
168
164
|
);
|
|
169
|
-
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
flowResult(reviewStore.fetchReviewComparison()).catch(
|
|
172
|
-
applicationStore.alertUnhandledError,
|
|
173
|
-
);
|
|
174
|
-
}, [applicationStore, reviewStore]);
|
|
175
|
-
|
|
176
165
|
return (
|
|
177
166
|
<ResizablePanelGroup orientation="vertical">
|
|
178
167
|
<ResizablePanel
|
|
179
168
|
{...sideBarCollapsiblePanelGroupProps.collapsiblePanel}
|
|
180
169
|
direction={1}
|
|
181
170
|
>
|
|
182
|
-
<
|
|
171
|
+
<ProjectReviewerSideBar />
|
|
183
172
|
</ResizablePanel>
|
|
184
173
|
<ResizablePanelSplitter />
|
|
185
174
|
<ResizablePanel
|
|
186
175
|
{...sideBarCollapsiblePanelGroupProps.remainingPanel}
|
|
187
176
|
minSize={300}
|
|
188
177
|
>
|
|
189
|
-
<
|
|
178
|
+
<ProjectReviewerPanel />
|
|
190
179
|
</ResizablePanel>
|
|
191
180
|
</ResizablePanelGroup>
|
|
192
181
|
);
|
|
193
182
|
});
|
|
194
183
|
|
|
195
|
-
export const
|
|
196
|
-
|
|
184
|
+
export const ProjectReviewer = withEditorStore(
|
|
185
|
+
withProjectReviewerStore(
|
|
197
186
|
observer(() => {
|
|
198
|
-
const params = useParams<
|
|
187
|
+
const params = useParams<ProjectReviewerPathParams>();
|
|
199
188
|
const projectId = params.projectId;
|
|
200
189
|
const reviewId = params.reviewId;
|
|
201
|
-
const reviewStore =
|
|
190
|
+
const reviewStore = useProjectReviewerStore();
|
|
202
191
|
const editorStore = useEditorStore();
|
|
203
|
-
const applicationStore = useApplicationStore();
|
|
204
192
|
const changeActivity =
|
|
205
193
|
(activity: ACTIVITY_MODE): (() => void) =>
|
|
206
194
|
(): void =>
|
|
207
195
|
editorStore.setActiveActivity(activity);
|
|
208
|
-
|
|
209
196
|
useEffect(() => {
|
|
210
197
|
reviewStore.setProjectIdAndReviewId(projectId, reviewId);
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
);
|
|
214
|
-
flowResult(reviewStore.getReview()).catch(
|
|
215
|
-
applicationStore.alertUnhandledError,
|
|
216
|
-
);
|
|
217
|
-
flowResult(reviewStore.fetchProject()).catch(
|
|
218
|
-
applicationStore.alertUnhandledError,
|
|
219
|
-
);
|
|
220
|
-
}, [applicationStore, reviewStore, projectId, reviewId]);
|
|
198
|
+
reviewStore.initialize();
|
|
199
|
+
}, [reviewStore, projectId, reviewId]);
|
|
221
200
|
|
|
222
201
|
return (
|
|
223
202
|
<div className="app__page">
|
|
224
203
|
<div className="workspace-review">
|
|
225
204
|
<PanelLoadingIndicator
|
|
226
|
-
isLoading={reviewStore.
|
|
205
|
+
isLoading={reviewStore.fetchCurrentReviewState.isInProgress}
|
|
227
206
|
/>
|
|
228
207
|
{reviewStore.currentReview && (
|
|
229
208
|
<>
|
|
@@ -240,23 +219,14 @@ export const WorkspaceReview = withEditorStore(
|
|
|
240
219
|
<CheckListIcon />
|
|
241
220
|
</button>
|
|
242
221
|
</div>
|
|
243
|
-
<div className="activity-bar__setting">
|
|
244
|
-
<button
|
|
245
|
-
className="activity-bar__item"
|
|
246
|
-
tabIndex={-1}
|
|
247
|
-
title="Settings..."
|
|
248
|
-
>
|
|
249
|
-
<CogIcon />
|
|
250
|
-
</button>
|
|
251
|
-
</div>
|
|
252
222
|
</div>
|
|
253
223
|
<div className="workspace-review__content-container">
|
|
254
224
|
<div className="workspace-review__content">
|
|
255
|
-
<
|
|
225
|
+
<ProjectReviewerExplorer />
|
|
256
226
|
</div>
|
|
257
227
|
</div>
|
|
258
228
|
</div>
|
|
259
|
-
<
|
|
229
|
+
<ProjectReviewerStatusBar />
|
|
260
230
|
</>
|
|
261
231
|
)}
|
|
262
232
|
</div>
|
|
@@ -32,12 +32,15 @@ import { EntityDiffView } from '../editor/editor-group/diff-editor/EntityDiffVie
|
|
|
32
32
|
import type { EditorState } from '../../stores/editor/editor-state/EditorState.js';
|
|
33
33
|
import { useEditorStore } from '../editor/EditorStoreProvider.js';
|
|
34
34
|
import { forwardRef } from 'react';
|
|
35
|
+
import { EditorDiffViewerState } from '../../stores/editor/editor-state/diff-viewer-state/EditorDiffViewerState.js';
|
|
36
|
+
import { ProjectConfigDiffView } from '../editor/editor-group/diff-editor/ProjectConfigDiffView.js';
|
|
37
|
+
import { ProjectConfigurationDiffEditorState } from '../../stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.js';
|
|
35
38
|
|
|
36
|
-
const
|
|
39
|
+
const ProjectReviewerPanelSplashScreen: React.FC = () => (
|
|
37
40
|
<div className="workspace-review-panel__splash-screen"></div>
|
|
38
41
|
);
|
|
39
42
|
|
|
40
|
-
const
|
|
43
|
+
const ProjectReviewerPanelHeaderTabContextMenu = observer(
|
|
41
44
|
forwardRef<
|
|
42
45
|
HTMLDivElement,
|
|
43
46
|
{
|
|
@@ -65,14 +68,14 @@ const WorkspaceReviewPanelHeaderTabContextMenu = observer(
|
|
|
65
68
|
}),
|
|
66
69
|
);
|
|
67
70
|
|
|
68
|
-
export const
|
|
71
|
+
export const ProjectReviewerPanel = observer(() => {
|
|
69
72
|
const editorStore = useEditorStore();
|
|
70
73
|
const currentTabState =
|
|
71
|
-
editorStore.tabManagerState.currentTab instanceof
|
|
74
|
+
editorStore.tabManagerState.currentTab instanceof EditorDiffViewerState
|
|
72
75
|
? editorStore.tabManagerState.currentTab
|
|
73
76
|
: undefined;
|
|
74
77
|
const openedTabStates = editorStore.tabManagerState.tabs.filter(
|
|
75
|
-
filterByType(
|
|
78
|
+
filterByType(EditorDiffViewerState),
|
|
76
79
|
);
|
|
77
80
|
const closeTab =
|
|
78
81
|
(diffState: EditorState): React.MouseEventHandler =>
|
|
@@ -91,12 +94,25 @@ export const WorkspaceReviewPanel = observer(() => {
|
|
|
91
94
|
editorStore.tabManagerState.openTab(editorState);
|
|
92
95
|
const switchViewMode =
|
|
93
96
|
(mode: DIFF_VIEW_MODE): (() => void) =>
|
|
94
|
-
(): void =>
|
|
95
|
-
currentTabState
|
|
97
|
+
(): void => {
|
|
98
|
+
if (currentTabState instanceof EntityDiffViewState) {
|
|
99
|
+
currentTabState.setDiffMode(mode);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
96
102
|
|
|
97
103
|
if (!currentTabState) {
|
|
98
|
-
return <
|
|
104
|
+
return <ProjectReviewerPanelSplashScreen />;
|
|
99
105
|
}
|
|
106
|
+
const renderActiveTabState = (
|
|
107
|
+
tab: EditorDiffViewerState,
|
|
108
|
+
): React.ReactNode => {
|
|
109
|
+
if (tab instanceof EntityDiffViewState) {
|
|
110
|
+
return <EntityDiffView entityDiffViewState={tab} />;
|
|
111
|
+
} else if (tab instanceof ProjectConfigurationDiffEditorState) {
|
|
112
|
+
return <ProjectConfigDiffView configDiffState={tab} />;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
100
116
|
return (
|
|
101
117
|
<div className="panel workspace-review-panel">
|
|
102
118
|
<div className="panel__header workspace-review-panel__header">
|
|
@@ -113,7 +129,7 @@ export const WorkspaceReviewPanel = observer(() => {
|
|
|
113
129
|
<ContextMenu
|
|
114
130
|
className="workspace-review-panel__header__tab__content"
|
|
115
131
|
content={
|
|
116
|
-
<
|
|
132
|
+
<ProjectReviewerPanelHeaderTabContextMenu
|
|
117
133
|
editorState={editorState}
|
|
118
134
|
/>
|
|
119
135
|
}
|
|
@@ -137,38 +153,40 @@ export const WorkspaceReviewPanel = observer(() => {
|
|
|
137
153
|
))}
|
|
138
154
|
</div>
|
|
139
155
|
<div className="workspace-review-panel__header__actions">
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
<div
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
{currentTabState instanceof EntityDiffViewState && (
|
|
157
|
+
<DropdownMenu
|
|
158
|
+
className="workspace-review-panel__element-view__type"
|
|
159
|
+
title="View as..."
|
|
160
|
+
content={
|
|
161
|
+
<div className="workspace-review-panel__element-view__options">
|
|
162
|
+
<div
|
|
163
|
+
className="workspace-review-panel__element-view__option"
|
|
164
|
+
onClick={switchViewMode(DIFF_VIEW_MODE.GRAMMAR)}
|
|
165
|
+
>
|
|
166
|
+
{DIFF_VIEW_MODE.GRAMMAR}
|
|
167
|
+
</div>
|
|
168
|
+
<div
|
|
169
|
+
className="workspace-review-panel__element-view__option"
|
|
170
|
+
onClick={switchViewMode(DIFF_VIEW_MODE.JSON)}
|
|
171
|
+
>
|
|
172
|
+
{DIFF_VIEW_MODE.JSON}
|
|
173
|
+
</div>
|
|
156
174
|
</div>
|
|
175
|
+
}
|
|
176
|
+
menuProps={{
|
|
177
|
+
anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
|
|
178
|
+
transformOrigin: { vertical: 'top', horizontal: 'right' },
|
|
179
|
+
}}
|
|
180
|
+
>
|
|
181
|
+
<div className="workspace-review-panel__element-view__type__label">
|
|
182
|
+
{currentTabState.diffMode}
|
|
157
183
|
</div>
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
|
|
161
|
-
transformOrigin: { vertical: 'top', horizontal: 'right' },
|
|
162
|
-
}}
|
|
163
|
-
>
|
|
164
|
-
<div className="workspace-review-panel__element-view__type__label">
|
|
165
|
-
{currentTabState.diffMode}
|
|
166
|
-
</div>
|
|
167
|
-
</DropdownMenu>
|
|
184
|
+
</DropdownMenu>
|
|
185
|
+
)}
|
|
168
186
|
</div>
|
|
169
187
|
</div>
|
|
170
188
|
<div className="panel__content workspace-review-panel__content">
|
|
171
|
-
|
|
189
|
+
{renderActiveTabState(currentTabState)}
|
|
172
190
|
</div>
|
|
173
191
|
</div>
|
|
174
192
|
);
|
|
@@ -0,0 +1,34 @@
|
|
|
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 type { EditorStore } from '../../EditorStore.js';
|
|
18
|
+
import { EditorState } from '../EditorState.js';
|
|
19
|
+
import type { SPECIAL_REVISION_ALIAS } from '../entity-diff-editor-state/EntityDiffEditorState.js';
|
|
20
|
+
|
|
21
|
+
export abstract class EditorDiffViewerState extends EditorState {
|
|
22
|
+
fromRevision: SPECIAL_REVISION_ALIAS | string;
|
|
23
|
+
toRevision: SPECIAL_REVISION_ALIAS | string;
|
|
24
|
+
|
|
25
|
+
constructor(
|
|
26
|
+
fromRevision: SPECIAL_REVISION_ALIAS | string,
|
|
27
|
+
toRevision: SPECIAL_REVISION_ALIAS | string,
|
|
28
|
+
editorStore: EditorStore,
|
|
29
|
+
) {
|
|
30
|
+
super(editorStore);
|
|
31
|
+
this.fromRevision = fromRevision;
|
|
32
|
+
this.toRevision = toRevision;
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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 { prettyCONSTName, type PlainObject } from '@finos/legend-shared';
|
|
18
|
+
import type { ProjectConfiguration } from '@finos/legend-server-sdlc';
|
|
19
|
+
import type { EditorStore } from '../../EditorStore.js';
|
|
20
|
+
import { EditorDiffViewerState } from './EditorDiffViewerState.js';
|
|
21
|
+
import type { SPECIAL_REVISION_ALIAS } from '../entity-diff-editor-state/EntityDiffEditorState.js';
|
|
22
|
+
import type { EditorState } from '../EditorState.js';
|
|
23
|
+
|
|
24
|
+
export const PROJECT_CONFIGURATION = 'PROJECT_CONFIGURATION';
|
|
25
|
+
|
|
26
|
+
export class ProjectConfigurationDiffEditorState extends EditorDiffViewerState {
|
|
27
|
+
fromConfig: PlainObject<ProjectConfiguration>;
|
|
28
|
+
toConfig: PlainObject<ProjectConfiguration>;
|
|
29
|
+
constructor(
|
|
30
|
+
fromConfig: PlainObject<ProjectConfiguration>,
|
|
31
|
+
toConfig: PlainObject<ProjectConfiguration>,
|
|
32
|
+
editorStore: EditorStore,
|
|
33
|
+
fromRevision: SPECIAL_REVISION_ALIAS | string,
|
|
34
|
+
toRevision: SPECIAL_REVISION_ALIAS | string,
|
|
35
|
+
) {
|
|
36
|
+
super(fromRevision, toRevision, editorStore);
|
|
37
|
+
this.fromConfig = fromConfig;
|
|
38
|
+
this.toConfig = toConfig;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override get label(): string {
|
|
42
|
+
return prettyCONSTName(PROJECT_CONFIGURATION);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
override match(tab: EditorState): boolean {
|
|
46
|
+
return (
|
|
47
|
+
tab instanceof ProjectConfigurationDiffEditorState &&
|
|
48
|
+
tab.fromRevision === this.fromRevision &&
|
|
49
|
+
tab.toRevision === this.toRevision
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override get description(): string {
|
|
54
|
+
return prettyCONSTName(PROJECT_CONFIGURATION);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
extractElementNameFromPath,
|
|
25
25
|
extractPackagePathFromPath,
|
|
26
26
|
SnowflakeAppDeploymentConfiguration,
|
|
27
|
+
DeploymentOwner,
|
|
27
28
|
} from '@finos/legend-graph';
|
|
28
29
|
import { type GeneratorFn } from '@finos/legend-shared';
|
|
29
30
|
import { FUNCTION_ACTIVATE_TYPE } from '../../../../components/editor/editor-group/function-activator/FunctionEditor.js';
|
|
@@ -92,7 +93,7 @@ export class FunctionActivatorState {
|
|
|
92
93
|
const snowflakeApp = new SnowflakeApp(activatorName);
|
|
93
94
|
snowflakeApp.applicationName = '';
|
|
94
95
|
snowflakeApp.description = '';
|
|
95
|
-
snowflakeApp.
|
|
96
|
+
snowflakeApp.ownership = new DeploymentOwner('', snowflakeApp);
|
|
96
97
|
snowflakeApp.function =
|
|
97
98
|
PackageableElementExplicitReference.create(functionElement);
|
|
98
99
|
snowflakeApp.activationConfiguration =
|
|
@@ -22,6 +22,8 @@ import {
|
|
|
22
22
|
PackageableElementExplicitReference,
|
|
23
23
|
observe_SnowflakeAppDeploymentConfiguration,
|
|
24
24
|
observe_SnowflakeApp,
|
|
25
|
+
DeploymentOwner,
|
|
26
|
+
observe_DeploymentOwnership,
|
|
25
27
|
} from '@finos/legend-graph';
|
|
26
28
|
import {
|
|
27
29
|
type GeneratorFn,
|
|
@@ -43,7 +45,7 @@ export class SnowflakeAppFunctionActivatorEdtiorState extends ElementEditorState
|
|
|
43
45
|
makeObservable(this, {
|
|
44
46
|
activator: computed,
|
|
45
47
|
reprocess: action,
|
|
46
|
-
|
|
48
|
+
updateOwnership: action,
|
|
47
49
|
updateAppDescription: action,
|
|
48
50
|
updateApplicationName: action,
|
|
49
51
|
updateConnection: action,
|
|
@@ -70,8 +72,9 @@ export class SnowflakeAppFunctionActivatorEdtiorState extends ElementEditorState
|
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
this.activator.
|
|
75
|
+
updateOwnership(val: string): void {
|
|
76
|
+
this.activator.ownership = new DeploymentOwner(val, this.activator);
|
|
77
|
+
observe_DeploymentOwnership(this.activator.ownership);
|
|
75
78
|
}
|
|
76
79
|
|
|
77
80
|
updateApplicationName(val: string): void {
|
package/src/stores/editor/editor-state/entity-diff-editor-state/EntityChangeConflictEditorState.ts
CHANGED
|
@@ -181,7 +181,7 @@ export class EntityChangeConflictEditorState extends EntityDiffViewerState {
|
|
|
181
181
|
entityPath: string | undefined,
|
|
182
182
|
) => Entity | undefined,
|
|
183
183
|
) {
|
|
184
|
-
super(editorStore);
|
|
184
|
+
super(baseRevision, currentChangeRevision, editorStore);
|
|
185
185
|
|
|
186
186
|
makeObservable<
|
|
187
187
|
EntityChangeConflictEditorState,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { EditorDiffViewerState } from '../diff-viewer-state/EditorDiffViewerState.js';
|
|
18
18
|
|
|
19
19
|
export enum SPECIAL_REVISION_ALIAS {
|
|
20
20
|
LOCAL = 'LOCAL_REVISION',
|
|
@@ -43,6 +43,6 @@ export const getPrettyLabelForRevision = (
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
export abstract class EntityDiffViewerState extends
|
|
46
|
+
export abstract class EntityDiffViewerState extends EditorDiffViewerState {
|
|
47
47
|
abstract refresh(): void;
|
|
48
48
|
}
|
|
@@ -49,8 +49,6 @@ export class EntityDiffViewState extends EntityDiffViewerState {
|
|
|
49
49
|
diffMode = DIFF_VIEW_MODE.GRAMMAR;
|
|
50
50
|
fromEntityPath?: string | undefined;
|
|
51
51
|
toEntityPath?: string | undefined;
|
|
52
|
-
fromRevision: SPECIAL_REVISION_ALIAS | string;
|
|
53
|
-
toRevision: SPECIAL_REVISION_ALIAS | string;
|
|
54
52
|
// to and from entities
|
|
55
53
|
fromEntity?: Entity | undefined;
|
|
56
54
|
toEntity?: Entity | undefined;
|
|
@@ -75,7 +73,7 @@ export class EntityDiffViewState extends EntityDiffViewerState {
|
|
|
75
73
|
fromEntityGetter?: (entityPath: string | undefined) => Entity | undefined,
|
|
76
74
|
toEntityGetter?: (entityPath: string | undefined) => Entity | undefined,
|
|
77
75
|
) {
|
|
78
|
-
super(editorStore);
|
|
76
|
+
super(fromRevision, toRevision, editorStore);
|
|
79
77
|
|
|
80
78
|
makeObservable<
|
|
81
79
|
EntityDiffViewState,
|