@finos/legend-application-studio 28.15.2 → 28.15.4
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/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
@@ -0,0 +1,303 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
import { assertErrorThrown, LogEvent, guaranteeNonNullable, ActionState, assertNonEmptyString, } from '@finos/legend-shared';
|
17
|
+
import { makeObservable, action, observable, flow, computed, flowResult, } from 'mobx';
|
18
|
+
import { ACTIVITY_MODE } from '../editor/EditorConfig.js';
|
19
|
+
import { EntityDiff, Comparison, reprocessEntityDiffs, Project, Review, ReviewApproval, } from '@finos/legend-server-sdlc';
|
20
|
+
import { LEGEND_STUDIO_APP_EVENT } from '../../__lib__/LegendStudioEvent.js';
|
21
|
+
import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
|
22
|
+
import { EntityDiffViewState } from '../editor/editor-state/entity-diff-editor-state/EntityDiffViewState.js';
|
23
|
+
import { SPECIAL_REVISION_ALIAS } from '../editor/editor-state/entity-diff-editor-state/EntityDiffEditorState.js';
|
24
|
+
export class ProjectReviewReport {
|
25
|
+
diffs;
|
26
|
+
fromEntities = [];
|
27
|
+
toEntities = [];
|
28
|
+
fromToProjectConfig;
|
29
|
+
constructor(diffs) {
|
30
|
+
this.diffs = diffs;
|
31
|
+
}
|
32
|
+
findFromEntity(entityPath) {
|
33
|
+
return this.fromEntities.find((e) => e.path === entityPath);
|
34
|
+
}
|
35
|
+
findToEntity(entityPath) {
|
36
|
+
return this.toEntities.find((e) => e.path === entityPath);
|
37
|
+
}
|
38
|
+
withFromEntities(val) {
|
39
|
+
this.fromEntities = val;
|
40
|
+
return this;
|
41
|
+
}
|
42
|
+
withToEntities(val) {
|
43
|
+
this.toEntities = val;
|
44
|
+
return this;
|
45
|
+
}
|
46
|
+
withProjectConfigChange(val) {
|
47
|
+
this.fromToProjectConfig = val;
|
48
|
+
return this;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
export class ProjectReviewerStore {
|
52
|
+
editorStore;
|
53
|
+
currentProjectId;
|
54
|
+
currentProject;
|
55
|
+
currentPatch;
|
56
|
+
currentReviewId;
|
57
|
+
currentReview;
|
58
|
+
// comparison
|
59
|
+
fetchComparisonState = ActionState.create();
|
60
|
+
reviewComparison;
|
61
|
+
reviewReport;
|
62
|
+
fetchCurrentReviewState = ActionState.create();
|
63
|
+
approveState = ActionState.create();
|
64
|
+
reviewApproval;
|
65
|
+
closeState = ActionState.create();
|
66
|
+
commitState = ActionState.create();
|
67
|
+
reOpenState = ActionState.create();
|
68
|
+
constructor(editorStore) {
|
69
|
+
makeObservable(this, {
|
70
|
+
currentProjectId: observable,
|
71
|
+
currentProject: observable,
|
72
|
+
currentPatch: observable,
|
73
|
+
currentReviewId: observable,
|
74
|
+
currentReview: observable,
|
75
|
+
fetchCurrentReviewState: observable,
|
76
|
+
fetchComparisonState: observable,
|
77
|
+
approveState: observable,
|
78
|
+
closeState: observable,
|
79
|
+
commitState: observable,
|
80
|
+
reOpenState: observable,
|
81
|
+
reviewReport: observable,
|
82
|
+
reviewApproval: observable,
|
83
|
+
projectId: computed,
|
84
|
+
patchReleaseVersionId: computed,
|
85
|
+
reviewId: computed,
|
86
|
+
review: computed,
|
87
|
+
setProjectIdAndReviewId: action,
|
88
|
+
refresh: action,
|
89
|
+
initializeEngine: flow,
|
90
|
+
fetchReviewComparison: flow,
|
91
|
+
fetchProject: flow,
|
92
|
+
fetchReviewApprovals: flow,
|
93
|
+
fetchReview: flow,
|
94
|
+
approveReview: flow,
|
95
|
+
commitReview: flow,
|
96
|
+
reOpenReview: flow,
|
97
|
+
closeReview: flow,
|
98
|
+
});
|
99
|
+
this.editorStore = editorStore;
|
100
|
+
this.editorStore.activeActivity = ACTIVITY_MODE.REVIEW;
|
101
|
+
}
|
102
|
+
get projectId() {
|
103
|
+
return guaranteeNonNullable(this.currentProjectId, 'Project ID must exist');
|
104
|
+
}
|
105
|
+
get patchReleaseVersionId() {
|
106
|
+
return this.currentPatch?.patchReleaseVersionId.id;
|
107
|
+
}
|
108
|
+
get reviewId() {
|
109
|
+
return guaranteeNonNullable(this.currentReviewId, 'Review ID must exist');
|
110
|
+
}
|
111
|
+
get review() {
|
112
|
+
return guaranteeNonNullable(this.currentReview, 'Review must exist');
|
113
|
+
}
|
114
|
+
get comparison() {
|
115
|
+
return guaranteeNonNullable(this.reviewComparison, 'review Comparison must exist');
|
116
|
+
}
|
117
|
+
get approvalString() {
|
118
|
+
const approvals = this.reviewApproval?.approvedBy;
|
119
|
+
if (approvals?.length) {
|
120
|
+
return `Approved by ${approvals.map((e) => e.name).join(',')}.`;
|
121
|
+
}
|
122
|
+
return undefined;
|
123
|
+
}
|
124
|
+
setProjectIdAndReviewId(projectId, reviewId) {
|
125
|
+
this.currentProjectId = projectId;
|
126
|
+
this.currentReviewId = reviewId;
|
127
|
+
}
|
128
|
+
initialize() {
|
129
|
+
flowResult(this.initializeEngine()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
130
|
+
flowResult(this.fetchReview()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
131
|
+
flowResult(this.fetchProject()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
132
|
+
flowResult(this.fetchReviewApprovals()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
133
|
+
flowResult(this.fetchReviewComparison()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
134
|
+
}
|
135
|
+
*initializeEngine() {
|
136
|
+
try {
|
137
|
+
// setup engine used for to/from grammar transfomation
|
138
|
+
yield this.editorStore.graphManagerState.graphManager.initialize({
|
139
|
+
env: this.editorStore.applicationStore.config.env,
|
140
|
+
tabSize: DEFAULT_TAB_SIZE,
|
141
|
+
clientConfig: {
|
142
|
+
baseUrl: this.editorStore.applicationStore.config.engineServerUrl,
|
143
|
+
queryBaseUrl: this.editorStore.applicationStore.config.engineQueryServerUrl,
|
144
|
+
enableCompression: true,
|
145
|
+
},
|
146
|
+
}, {
|
147
|
+
tracerService: this.editorStore.applicationStore.tracerService,
|
148
|
+
});
|
149
|
+
}
|
150
|
+
catch (error) {
|
151
|
+
assertErrorThrown(error);
|
152
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
153
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
openReviewChange(diff) {
|
157
|
+
const fromEntityGetter = (entityPath) => entityPath ? this.reviewReport?.findFromEntity(entityPath) : undefined;
|
158
|
+
const toEntityGetter = (entityPath) => entityPath ? this.reviewReport?.findToEntity(entityPath) : undefined;
|
159
|
+
const fromEntity = EntityDiff.shouldOldEntityExist(diff)
|
160
|
+
? guaranteeNonNullable(fromEntityGetter(diff.getValidatedOldPath()), `Can't find entity with path '${diff.oldPath}'`)
|
161
|
+
: undefined;
|
162
|
+
const toEntity = EntityDiff.shouldNewEntityExist(diff)
|
163
|
+
? guaranteeNonNullable(toEntityGetter(diff.getValidatedNewPath()), `Can't find entity with path '${diff.newPath}'`)
|
164
|
+
: undefined;
|
165
|
+
const diffState = new EntityDiffViewState(this.editorStore, SPECIAL_REVISION_ALIAS.WORKSPACE_BASE, SPECIAL_REVISION_ALIAS.WORKSPACE_HEAD, diff.oldPath, diff.newPath, fromEntity, toEntity, fromEntityGetter, toEntityGetter);
|
166
|
+
this.editorStore.tabManagerState.openTab(this.editorStore.tabManagerState.tabs.find((t) => t.match(diffState)) ??
|
167
|
+
diffState);
|
168
|
+
}
|
169
|
+
refresh() {
|
170
|
+
this.editorStore.tabManagerState.closeAllTabs();
|
171
|
+
this.reviewComparison = undefined;
|
172
|
+
this.reviewReport = undefined;
|
173
|
+
flowResult(this.fetchReviewComparison()).catch(this.editorStore.applicationStore.alertUnhandledError);
|
174
|
+
}
|
175
|
+
/**
|
176
|
+
* To save load time, this function will levergae the reviewId coming from the URl and doesn't
|
177
|
+
* assume the review has completed been fetched
|
178
|
+
*/
|
179
|
+
*fetchReviewComparison() {
|
180
|
+
this.fetchComparisonState.inProgress();
|
181
|
+
try {
|
182
|
+
const [comparison, fromEntities, toEntities] = (yield Promise.all([
|
183
|
+
this.editorStore.sdlcServerClient.getReviewComparision(this.projectId, this.patchReleaseVersionId, this.reviewId),
|
184
|
+
this.editorStore.sdlcServerClient.getReviewFromEntities(this.projectId, this.patchReleaseVersionId, this.reviewId),
|
185
|
+
this.editorStore.sdlcServerClient.getReviewToEntities(this.projectId, this.patchReleaseVersionId, this.reviewId),
|
186
|
+
]));
|
187
|
+
const resolvedComparison = Comparison.serialization.fromJson(comparison);
|
188
|
+
this.reviewComparison = resolvedComparison;
|
189
|
+
const report = new ProjectReviewReport(reprocessEntityDiffs(resolvedComparison.entityDiffs));
|
190
|
+
report.withFromEntities(fromEntities).withToEntities(toEntities);
|
191
|
+
this.reviewReport = report;
|
192
|
+
if (comparison.projectConfigurationUpdated) {
|
193
|
+
const [fromConfig, toConfig] = (yield Promise.all([
|
194
|
+
this.editorStore.sdlcServerClient.getReviewFromConfiguration(this.projectId, this.patchReleaseVersionId, this.reviewId),
|
195
|
+
this.editorStore.sdlcServerClient.getReviewToConfiguration(this.projectId, this.patchReleaseVersionId, this.reviewId),
|
196
|
+
]));
|
197
|
+
if (fromConfig && toConfig) {
|
198
|
+
report.withProjectConfigChange([fromConfig, toConfig]);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
catch (error) {
|
203
|
+
assertErrorThrown(error);
|
204
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
205
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
206
|
+
}
|
207
|
+
finally {
|
208
|
+
this.fetchComparisonState.complete();
|
209
|
+
}
|
210
|
+
}
|
211
|
+
*fetchProject() {
|
212
|
+
try {
|
213
|
+
this.currentProject = Project.serialization.fromJson((yield this.editorStore.sdlcServerClient.getProject(this.projectId)));
|
214
|
+
}
|
215
|
+
catch (error) {
|
216
|
+
assertErrorThrown(error);
|
217
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
218
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
219
|
+
}
|
220
|
+
}
|
221
|
+
*fetchReviewApprovals() {
|
222
|
+
try {
|
223
|
+
this.reviewApproval = ReviewApproval.serialization.fromJson((yield this.editorStore.sdlcServerClient.getReviewApprovals(this.projectId, this.patchReleaseVersionId, this.reviewId)));
|
224
|
+
}
|
225
|
+
catch (error) {
|
226
|
+
assertErrorThrown(error);
|
227
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
228
|
+
}
|
229
|
+
}
|
230
|
+
*fetchReview() {
|
231
|
+
try {
|
232
|
+
// TODO: can we assume review also an integer ?
|
233
|
+
assertNonEmptyString(this.currentReviewId, 'Review ID provided must be a valid non empty string');
|
234
|
+
this.fetchCurrentReviewState.inProgress();
|
235
|
+
this.currentReview = Review.serialization.fromJson((yield this.editorStore.sdlcServerClient.getReview(this.projectId, this.patchReleaseVersionId, this.reviewId)));
|
236
|
+
}
|
237
|
+
catch (error) {
|
238
|
+
assertErrorThrown(error);
|
239
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
240
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
241
|
+
}
|
242
|
+
finally {
|
243
|
+
this.fetchCurrentReviewState.complete();
|
244
|
+
}
|
245
|
+
}
|
246
|
+
*approveReview() {
|
247
|
+
this.approveState.inProgress();
|
248
|
+
try {
|
249
|
+
this.currentReview = Review.serialization.fromJson((yield this.editorStore.sdlcServerClient.approveReview(this.projectId, this.patchReleaseVersionId, this.review.id)));
|
250
|
+
}
|
251
|
+
catch (error) {
|
252
|
+
assertErrorThrown(error);
|
253
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
254
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
255
|
+
}
|
256
|
+
finally {
|
257
|
+
this.approveState.complete();
|
258
|
+
}
|
259
|
+
}
|
260
|
+
*commitReview() {
|
261
|
+
this.commitState.inProgress();
|
262
|
+
try {
|
263
|
+
this.currentReview = Review.serialization.fromJson((yield this.editorStore.sdlcServerClient.commitReview(this.projectId, this.patchReleaseVersionId, this.review.id, { message: `${this.review.title} [review]` })));
|
264
|
+
}
|
265
|
+
catch (error) {
|
266
|
+
assertErrorThrown(error);
|
267
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
268
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
269
|
+
}
|
270
|
+
finally {
|
271
|
+
this.commitState.complete();
|
272
|
+
}
|
273
|
+
}
|
274
|
+
*reOpenReview() {
|
275
|
+
this.reOpenState.inProgress();
|
276
|
+
try {
|
277
|
+
this.currentReview = Review.serialization.fromJson((yield this.editorStore.sdlcServerClient.reopenReview(this.projectId, this.patchReleaseVersionId, this.review.id)));
|
278
|
+
}
|
279
|
+
catch (error) {
|
280
|
+
assertErrorThrown(error);
|
281
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
282
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
283
|
+
}
|
284
|
+
finally {
|
285
|
+
this.reOpenState.complete();
|
286
|
+
}
|
287
|
+
}
|
288
|
+
*closeReview() {
|
289
|
+
this.closeState.inProgress();
|
290
|
+
try {
|
291
|
+
this.currentReview = Review.serialization.fromJson((yield this.editorStore.sdlcServerClient.closeReview(this.projectId, this.patchReleaseVersionId, this.review.id)));
|
292
|
+
}
|
293
|
+
catch (error) {
|
294
|
+
assertErrorThrown(error);
|
295
|
+
this.editorStore.applicationStore.logService.error(LogEvent.create(LEGEND_STUDIO_APP_EVENT.SDLC_MANAGER_FAILURE), error);
|
296
|
+
this.editorStore.applicationStore.notificationService.notifyError(error);
|
297
|
+
}
|
298
|
+
finally {
|
299
|
+
this.closeState.complete();
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
//# sourceMappingURL=ProjectReviewerStore.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ProjectReviewerStore.js","sourceRoot":"","sources":["../../../src/stores/project-reviewer/ProjectReviewerStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,WAAW,EACX,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,MAAM,EACN,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,UAAU,GACX,MAAM,MAAM,CAAC;AAEd,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,UAAU,EAEV,UAAU,EACV,oBAAoB,EACpB,OAAO,EACP,MAAM,EAEN,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wEAAwE,CAAC;AAC7G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0EAA0E,CAAC;AAElH,MAAM,OAAO,mBAAmB;IAC9B,KAAK,CAAe;IACpB,YAAY,GAAa,EAAE,CAAC;IAC5B,UAAU,GAAa,EAAE,CAAC;IAC1B,mBAAmB,CAEL;IAEd,YAAY,KAAmB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,cAAc,CAAC,UAAkB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,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AC,KAAK,CAAC,CAAC;SAC1E;gBAAS;YACR,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;SAC5B;IACH,CAAC;CACF"}
|
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.4",
|
4
4
|
"description": "Legend Studio application core",
|
5
5
|
"keywords": [
|
6
6
|
"legend",
|
@@ -45,13 +45,13 @@
|
|
45
45
|
"test:watch": "jest --watch"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
|
-
"@finos/legend-application": "15.0.
|
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.0",
|
51
|
+
"@finos/legend-lego": "1.2.4",
|
52
|
+
"@finos/legend-query-builder": "4.14.4",
|
53
53
|
"@finos/legend-server-depot": "6.0.36",
|
54
|
-
"@finos/legend-server-sdlc": "5.3.
|
54
|
+
"@finos/legend-server-sdlc": "5.3.7",
|
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",
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"yaml": "2.3.3"
|
72
72
|
},
|
73
73
|
"devDependencies": {
|
74
|
-
"@finos/legend-dev-utils": "2.1.
|
74
|
+
"@finos/legend-dev-utils": "2.1.3",
|
75
75
|
"@jest/globals": "29.7.0",
|
76
76
|
"cross-env": "7.0.3",
|
77
77
|
"eslint": "8.52.0",
|
@@ -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
|
@@ -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
|
+
);
|
@@ -46,7 +46,6 @@ import { ShowcaseManager } from '../ShowcaseManager.js';
|
|
46
46
|
import { CabinetIcon } from '@finos/legend-art';
|
47
47
|
import { ShowcaseManagerState } from '../../stores/ShowcaseManagerState.js';
|
48
48
|
import type { LegendStudioApplicationStore } from '../../stores/LegendStudioBaseStore.js';
|
49
|
-
import { registerDownloadHelperServiceWorker } from '@finos/legend-lego/download-helper';
|
50
49
|
|
51
50
|
export const SHOWCASE_MANAGER_VIRTUAL_ASSISTANT_TAB_KEY = 'showcase-manager';
|
52
51
|
|
@@ -80,7 +79,6 @@ export class Core_LegendStudioApplicationPlugin extends LegendStudioApplicationP
|
|
80
79
|
).getExtraPureGrammarKeywords?.() ?? [],
|
81
80
|
),
|
82
81
|
});
|
83
|
-
registerDownloadHelperServiceWorker();
|
84
82
|
},
|
85
83
|
];
|
86
84
|
}
|
@@ -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.fetchComparisonState.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>
|