@finos/legend-application-studio 28.15.3 → 28.15.5
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/__lib__/LegendStudioNavigation.d.ts +1 -1
- package/lib/components/LegendStudioWebApplication.js +2 -2
- package/lib/components/editor/editor-group/UnsupportedElementEditor.d.ts +2 -0
- package/lib/components/editor/editor-group/UnsupportedElementEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/UnsupportedElementEditor.js +12 -3
- package/lib/components/editor/editor-group/UnsupportedElementEditor.js.map +1 -1
- 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/{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 +2 -2
- package/lib/index.css.map +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/ElementEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js +10 -3
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
- 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 +75 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js +325 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -0
- package/package.json +5 -5
- package/src/__lib__/LegendStudioNavigation.ts +1 -1
- package/src/components/LegendStudioWebApplication.tsx +2 -2
- package/src/components/editor/editor-group/UnsupportedElementEditor.tsx +38 -9
- package/src/components/editor/editor-group/diff-editor/ProjectConfigDiffView.tsx +60 -0
- 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/ElementEditorState.ts +22 -5
- 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/project-reviewer/ProjectReviewerStore.ts +515 -0
- 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
- package/src/stores/workspace-review/WorkspaceReviewStore.ts +0 -312
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@finos/legend-application-studio",
|
3
|
-
"version": "28.15.
|
3
|
+
"version": "28.15.5",
|
4
4
|
"description": "Legend Studio application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -47,11 +47,11 @@
|
|
47
47
|
"dependencies": {
|
48
48
|
"@finos/legend-application": "15.0.67",
|
49
49
|
"@finos/legend-art": "7.1.19",
|
50
|
-
"@finos/legend-graph": "31.
|
51
|
-
"@finos/legend-lego": "1.2.
|
52
|
-
"@finos/legend-query-builder": "4.14.
|
50
|
+
"@finos/legend-graph": "31.8.1",
|
51
|
+
"@finos/legend-lego": "1.2.5",
|
52
|
+
"@finos/legend-query-builder": "4.14.5",
|
53
53
|
"@finos/legend-server-depot": "6.0.36",
|
54
|
-
"@finos/legend-server-sdlc": "5.3.
|
54
|
+
"@finos/legend-server-sdlc": "5.3.8",
|
55
55
|
"@finos/legend-server-showcase": "0.2.5",
|
56
56
|
"@finos/legend-shared": "10.0.32",
|
57
57
|
"@finos/legend-storage": "3.0.82",
|
@@ -64,7 +64,7 @@ export const LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN = Object.freeze({
|
|
64
64
|
SHOWCASE_PROJECT: `/showcase/*`,
|
65
65
|
});
|
66
66
|
|
67
|
-
export type
|
67
|
+
export type ProjectReviewerPathParams = {
|
68
68
|
[LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PROJECT_ID]: string;
|
69
69
|
[LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.REVIEW_ID]: string;
|
70
70
|
};
|
@@ -17,7 +17,7 @@
|
|
17
17
|
import { useEffect } from 'react';
|
18
18
|
import { WorkspaceSetup } from './workspace-setup/WorkspaceSetup.js';
|
19
19
|
import { Editor } from './editor/Editor.js';
|
20
|
-
import {
|
20
|
+
import { ProjectReviewer } from './project-reviewer/ProjectReviewer.js';
|
21
21
|
import { ProjectViewer } from './project-view/ProjectViewer.js';
|
22
22
|
import { observer } from 'mobx-react-lite';
|
23
23
|
import { clsx, GhostIcon, MarkdownTextViewer } from '@finos/legend-art';
|
@@ -172,7 +172,7 @@ export const LegendStudioWebApplicationRouter = observer(() => {
|
|
172
172
|
path={LEGEND_STUDIO_ROUTE_PATTERN.REVIEW}
|
173
173
|
component={
|
174
174
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
175
|
-
|
175
|
+
ProjectReviewer as TEMPORARY__ReactRouterComponentType
|
176
176
|
}
|
177
177
|
/>
|
178
178
|
<Route
|
@@ -27,27 +27,55 @@ import { UnsupportedElementEditorState } from '../../../stores/editor/editor-sta
|
|
27
27
|
import { flowResult } from 'mobx';
|
28
28
|
import { useEditorStore } from '../EditorStoreProvider.js';
|
29
29
|
import { useApplicationStore } from '@finos/legend-application';
|
30
|
+
import { ELEMENT_NATIVE_VIEW_MODE } from '../../../stores/editor/EditorConfig.js';
|
31
|
+
import { INTERNAL__UnknownPackageableElement } from '@finos/legend-graph';
|
32
|
+
import { isType } from '@finos/legend-shared';
|
30
33
|
|
31
34
|
export const UnsupportedEditorPanel = observer(
|
32
|
-
(props: {
|
33
|
-
|
35
|
+
(props: {
|
36
|
+
text: string;
|
37
|
+
isReadOnly: boolean;
|
38
|
+
unsupportedElementEditorState?: UnsupportedElementEditorState;
|
39
|
+
}) => {
|
40
|
+
const { text, isReadOnly, unsupportedElementEditorState } = props;
|
34
41
|
const editorStore = useEditorStore();
|
35
42
|
const applicationStore = useApplicationStore();
|
43
|
+
|
44
|
+
const isUnknownEntity = unsupportedElementEditorState
|
45
|
+
? isType(
|
46
|
+
unsupportedElementEditorState.element,
|
47
|
+
INTERNAL__UnknownPackageableElement,
|
48
|
+
)
|
49
|
+
: false;
|
50
|
+
|
36
51
|
const handleTextModeClick = applicationStore.guardUnhandledError(() =>
|
37
52
|
flowResult(editorStore.toggleTextMode()),
|
38
53
|
);
|
39
54
|
|
55
|
+
const handleJsonModeClick = (): void => {
|
56
|
+
unsupportedElementEditorState?.setEditMode(ELEMENT_NATIVE_VIEW_MODE.JSON);
|
57
|
+
};
|
58
|
+
|
40
59
|
return (
|
41
60
|
<BlankPanelContent>
|
42
61
|
<div className="unsupported-element-editor__main">
|
43
62
|
<div className="unsupported-element-editor__summary">{text}</div>
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
63
|
+
<div className="unsupported-element-editor__actions">
|
64
|
+
{!isReadOnly && (
|
65
|
+
<Button
|
66
|
+
className="unsupported-element-editor__to-text-mode__btn"
|
67
|
+
onClick={handleTextModeClick}
|
68
|
+
text="Edit in text mode"
|
69
|
+
/>
|
70
|
+
)}
|
71
|
+
{isUnknownEntity && (
|
72
|
+
<Button
|
73
|
+
className="unsupported-element-editor__to-text-mode__btn unsupported-element-editor__btn--dark"
|
74
|
+
onClick={handleJsonModeClick}
|
75
|
+
text="View content"
|
76
|
+
/>
|
77
|
+
)}
|
78
|
+
</div>
|
51
79
|
</div>
|
52
80
|
</BlankPanelContent>
|
53
81
|
);
|
@@ -82,6 +110,7 @@ export const UnsupportedElementEditor = observer(() => {
|
|
82
110
|
<UnsupportedEditorPanel
|
83
111
|
text="Can't display this element in form-mode"
|
84
112
|
isReadOnly={isReadOnly}
|
113
|
+
unsupportedElementEditorState={unsupportedElementEditorState}
|
85
114
|
/>
|
86
115
|
</PanelContent>
|
87
116
|
</Panel>
|
@@ -0,0 +1,60 @@
|
|
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 type { ProjectConfigurationDiffEditorState } from '../../../../stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.js';
|
19
|
+
import { CompareIcon } from '@finos/legend-art';
|
20
|
+
import { JSONDiffView } from '@finos/legend-lego/code-editor';
|
21
|
+
import { sortObjectKeys } from '@finos/legend-shared';
|
22
|
+
import { getPrettyLabelForRevision } from '../../../../stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.js';
|
23
|
+
|
24
|
+
export const ProjectConfigDiffView = observer(
|
25
|
+
(props: { configDiffState: ProjectConfigurationDiffEditorState }) => {
|
26
|
+
const { configDiffState } = props;
|
27
|
+
|
28
|
+
return (
|
29
|
+
<div className="entity-diff-view">
|
30
|
+
<div className="entity-diff-view__header">
|
31
|
+
<div className="entity-diff-view__header__info">
|
32
|
+
<div className="entity-diff-view__header__info__revision-summary">
|
33
|
+
<div className="entity-diff-view__header__info__revision-summary__revision">
|
34
|
+
{getPrettyLabelForRevision(configDiffState.fromRevision)}
|
35
|
+
</div>
|
36
|
+
<div className="entity-diff-view__header__info__revision-summary__icon">
|
37
|
+
<CompareIcon />
|
38
|
+
</div>
|
39
|
+
<div className="entity-diff-view__header__info__revision-summary__revision">
|
40
|
+
{getPrettyLabelForRevision(configDiffState.toRevision)}
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<div className="entity-diff-view__header__info__revision-summary__icon">
|
44
|
+
<CompareIcon />
|
45
|
+
</div>
|
46
|
+
<div className="entity-diff-view__header__info__revision-summary__revision">
|
47
|
+
{getPrettyLabelForRevision(configDiffState.toRevision)}
|
48
|
+
</div>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
<div className="entity-diff-view__content">
|
52
|
+
<JSONDiffView
|
53
|
+
from={sortObjectKeys(configDiffState.fromConfig)}
|
54
|
+
to={sortObjectKeys(configDiffState.toConfig)}
|
55
|
+
/>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
);
|
59
|
+
},
|
60
|
+
);
|
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
clsx,
|
21
21
|
PanelLoadingIndicator,
|
22
22
|
TruncatedGitMergeIcon,
|
23
|
+
RefreshIcon,
|
23
24
|
TimesIcon,
|
24
25
|
ArrowUpIcon,
|
25
26
|
CheckIcon,
|
@@ -29,19 +30,27 @@ import {
|
|
29
30
|
import { EntityDiffViewState } from '../../stores/editor/editor-state/entity-diff-editor-state/EntityDiffViewState.js';
|
30
31
|
import { LEGEND_STUDIO_TEST_ID } from '../../__lib__/LegendStudioTesting.js';
|
31
32
|
import { flowResult } from 'mobx';
|
32
|
-
import {
|
33
|
+
import {
|
34
|
+
type EntityDiff,
|
35
|
+
ReviewState,
|
36
|
+
EntityChangeType,
|
37
|
+
getChangeTypeIconFromChange,
|
38
|
+
} from '@finos/legend-server-sdlc';
|
33
39
|
import { entityDiffSorter } from '../../stores/editor/EditorSDLCState.js';
|
34
|
-
import {
|
40
|
+
import { useProjectReviewerStore } from './ProjectReviewStoreProvider.js';
|
35
41
|
import { useEditorStore } from '../editor/EditorStoreProvider.js';
|
36
42
|
import { useApplicationStore } from '@finos/legend-application';
|
37
43
|
import { formatDistanceToNow } from '@finos/legend-shared';
|
44
|
+
import { SPECIAL_REVISION_ALIAS } from '../../stores/editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.js';
|
45
|
+
import { ProjectConfigurationDiffEditorState } from '../../stores/editor/editor-state/diff-viewer-state/ProjectConfigurationDiffEditorState.js';
|
38
46
|
|
39
|
-
export const
|
40
|
-
const reviewStore =
|
47
|
+
export const ProjectReviewerSideBar = observer(() => {
|
48
|
+
const reviewStore = useProjectReviewerStore();
|
41
49
|
const editorStore = useEditorStore();
|
42
50
|
const applicationStore = useApplicationStore();
|
43
51
|
const workspaceContainsSnapshotDependencies =
|
44
52
|
editorStore.projectConfigurationEditorState.containsSnapshotDependencies;
|
53
|
+
const approvalString = reviewStore.approvalString;
|
45
54
|
// Review infos
|
46
55
|
const review = reviewStore.review;
|
47
56
|
const currentUser = editorStore.sdlcServerClient.currentUser;
|
@@ -81,11 +90,11 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
81
90
|
}
|
82
91
|
// Actions
|
83
92
|
const isDispatchingAction =
|
84
|
-
reviewStore.
|
85
|
-
reviewStore.
|
86
|
-
reviewStore.
|
87
|
-
reviewStore.
|
88
|
-
reviewStore.
|
93
|
+
reviewStore.buildReviewReportState.isInProgress ||
|
94
|
+
reviewStore.approveState.isInProgress ||
|
95
|
+
reviewStore.closeState.isInProgress ||
|
96
|
+
reviewStore.commitState.isInProgress ||
|
97
|
+
reviewStore.reOpenState.isInProgress;
|
89
98
|
const closeReview = applicationStore.guardUnhandledError(() =>
|
90
99
|
flowResult(reviewStore.closeReview()),
|
91
100
|
);
|
@@ -98,8 +107,12 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
98
107
|
const approveReview = applicationStore.guardUnhandledError(() =>
|
99
108
|
flowResult(reviewStore.approveReview()),
|
100
109
|
);
|
110
|
+
|
111
|
+
const refresh = (): void => {
|
112
|
+
reviewStore.refresh();
|
113
|
+
};
|
101
114
|
// Changes
|
102
|
-
const changes =
|
115
|
+
const changes = reviewStore.reviewReport?.diffs ?? [];
|
103
116
|
const currentTabState = editorStore.tabManagerState.currentTab;
|
104
117
|
const isSelectedDiff = (diff: EntityDiff): boolean =>
|
105
118
|
currentTabState instanceof EntityDiffViewState &&
|
@@ -108,7 +121,25 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
108
121
|
const openChange =
|
109
122
|
(diff: EntityDiff): (() => void) =>
|
110
123
|
(): void =>
|
111
|
-
|
124
|
+
reviewStore.openReviewChange(diff);
|
125
|
+
|
126
|
+
const openConfiguration = (): void => {
|
127
|
+
const diffs = reviewStore.reviewReport?.fromToProjectConfig;
|
128
|
+
if (diffs) {
|
129
|
+
const newTab = new ProjectConfigurationDiffEditorState(
|
130
|
+
diffs[0],
|
131
|
+
diffs[1],
|
132
|
+
reviewStore.editorStore,
|
133
|
+
SPECIAL_REVISION_ALIAS.WORKSPACE_BASE,
|
134
|
+
SPECIAL_REVISION_ALIAS.WORKSPACE_HEAD,
|
135
|
+
);
|
136
|
+
reviewStore.editorStore.tabManagerState.openTab(
|
137
|
+
reviewStore.editorStore.tabManagerState.tabs.find((t) =>
|
138
|
+
t.match(newTab),
|
139
|
+
) ?? newTab,
|
140
|
+
);
|
141
|
+
}
|
142
|
+
};
|
112
143
|
|
113
144
|
return (
|
114
145
|
<div className="panel workspace-review__side-bar">
|
@@ -119,6 +150,14 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
119
150
|
</div>
|
120
151
|
</div>
|
121
152
|
<div className="panel__header__actions side-bar__header__actions">
|
153
|
+
<button
|
154
|
+
className="panel__header__action side-bar__header__action workspace-review__close-btn"
|
155
|
+
tabIndex={-1}
|
156
|
+
title="Retrieves latest changes from review"
|
157
|
+
onClick={refresh}
|
158
|
+
>
|
159
|
+
<RefreshIcon />
|
160
|
+
</button>
|
122
161
|
{review.state !== ReviewState.COMMITTED && (
|
123
162
|
<button
|
124
163
|
className="panel__header__action side-bar__header__action workspace-review__close-btn"
|
@@ -157,6 +196,7 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
157
196
|
</span>
|
158
197
|
</div>
|
159
198
|
</div>
|
199
|
+
|
160
200
|
{review.state === ReviewState.CLOSED && (
|
161
201
|
<button
|
162
202
|
className="workspace-review__side-bar__review__info__action btn--dark btn--sm"
|
@@ -207,6 +247,11 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
207
247
|
</>
|
208
248
|
)}
|
209
249
|
</div>
|
250
|
+
{approvalString && (
|
251
|
+
<div className="workspace-review__side-bar__review__info__content__status">
|
252
|
+
{approvalString}
|
253
|
+
</div>
|
254
|
+
)}
|
210
255
|
<div className="workspace-review__side-bar__review__info__content__status">
|
211
256
|
{reviewStatus}
|
212
257
|
</div>
|
@@ -242,6 +287,41 @@ export const WorkspaceReviewSideBar = observer(() => {
|
|
242
287
|
openDiff={openChange(diff)}
|
243
288
|
/>
|
244
289
|
))}
|
290
|
+
|
291
|
+
{Boolean(reviewStore.reviewReport?.fromToProjectConfig) && (
|
292
|
+
<button
|
293
|
+
className={clsx('side-bar__panel__item', {
|
294
|
+
'side-bar__panel__item--selected':
|
295
|
+
editorStore.tabManagerState.currentTab instanceof
|
296
|
+
ProjectConfigurationDiffEditorState,
|
297
|
+
})}
|
298
|
+
tabIndex={-1}
|
299
|
+
title={`Project Configuration Modified`}
|
300
|
+
onClick={openConfiguration}
|
301
|
+
>
|
302
|
+
<div className="diff-panel__item__info">
|
303
|
+
<span
|
304
|
+
className={clsx(
|
305
|
+
'diff-panel__item__info-name',
|
306
|
+
`diff-panel__item__info-name--${EntityChangeType.MODIFY.toLowerCase()}`,
|
307
|
+
)}
|
308
|
+
>
|
309
|
+
config
|
310
|
+
</span>
|
311
|
+
<span className="diff-panel__item__info-path">
|
312
|
+
project configuration
|
313
|
+
</span>
|
314
|
+
</div>
|
315
|
+
<div
|
316
|
+
className={clsx(
|
317
|
+
'diff-panel__item__type',
|
318
|
+
`diff-panel__item__type--${EntityChangeType.MODIFY.toLowerCase()}`,
|
319
|
+
)}
|
320
|
+
>
|
321
|
+
{getChangeTypeIconFromChange(EntityChangeType.MODIFY)}
|
322
|
+
</div>
|
323
|
+
</button>
|
324
|
+
)}
|
245
325
|
</PanelContent>
|
246
326
|
</div>
|
247
327
|
</div>
|
@@ -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.buildReviewReportState.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>
|