@finos/legend-application-studio 22.3.8 → 22.4.1
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/components/editor/command-center/ProjectSearchCommand.js +1 -1
- package/lib/components/editor/command-center/ProjectSearchCommand.js.map +1 -1
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts +2 -2
- package/lib/components/editor/edit-panel/GrammarTextEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js +1 -1
- package/lib/components/editor/edit-panel/connection-editor/ConnectionEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.d.ts +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/MappingExplorer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts +2 -2
- package/lib/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/NewMappingElementModal.js.map +1 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.d.ts.map +1 -1
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.js +2 -2
- package/lib/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.js.map +1 -1
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js +3 -3
- package/lib/components/editor/edit-panel/uml-editor/ClassEditor.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +46 -29
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/components/editor/side-bar/ProjectDependantsEditor.d.ts +20 -0
- package/lib/components/editor/side-bar/ProjectDependantsEditor.d.ts.map +1 -0
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js +62 -0
- package/lib/components/editor/side-bar/ProjectDependantsEditor.js.map +1 -0
- package/lib/components/editor/side-bar/ProjectOverview.d.ts.map +1 -1
- package/lib/components/editor/side-bar/ProjectOverview.js +4 -0
- package/lib/components/editor/side-bar/ProjectOverview.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +6 -6
- package/lib/stores/EditorStore.d.ts.map +1 -1
- package/lib/stores/EditorStore.js +4 -1
- package/lib/stores/EditorStore.js.map +1 -1
- package/lib/stores/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/ExplorerTreeState.js +1 -0
- package/lib/stores/ExplorerTreeState.js.map +1 -1
- package/lib/stores/LegendStudioRouter.d.ts +2 -0
- package/lib/stores/LegendStudioRouter.d.ts.map +1 -1
- package/lib/stores/LegendStudioRouter.js +22 -0
- package/lib/stores/LegendStudioRouter.js.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.d.ts.map +1 -1
- package/lib/stores/editor-state/GrammarTextEditorState.js +8 -2
- package/lib/stores/editor-state/GrammarTextEditorState.js.map +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js +1 -1
- package/lib/stores/editor-state/element-editor-state/service/ServiceExecutionState.js.map +1 -1
- package/lib/stores/sidebar-state/ProjectDependantEditorState.d.ts +31 -0
- package/lib/stores/sidebar-state/ProjectDependantEditorState.d.ts.map +1 -0
- package/lib/stores/sidebar-state/ProjectDependantEditorState.js +42 -0
- package/lib/stores/sidebar-state/ProjectDependantEditorState.js.map +1 -0
- package/lib/stores/sidebar-state/ProjectOverviewState.d.ts +4 -0
- package/lib/stores/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/sidebar-state/ProjectOverviewState.js +48 -0
- package/lib/stores/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/package.json +15 -15
- package/src/components/editor/command-center/ProjectSearchCommand.tsx +1 -1
- package/src/components/editor/edit-panel/connection-editor/ConnectionEditor.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/EnumerationMappingEditor.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/MappingExecutionQueryBuilder.tsx +1 -1
- package/src/components/editor/edit-panel/mapping-editor/NewMappingElementModal.tsx +1 -1
- package/src/components/editor/edit-panel/project-configuration-editor/ProjectDependencyEditor.tsx +2 -6
- package/src/components/editor/edit-panel/uml-editor/ClassEditor.tsx +3 -3
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +1 -1
- package/src/components/editor/side-bar/Explorer.tsx +69 -41
- package/src/components/editor/side-bar/ProjectDependantsEditor.tsx +223 -0
- package/src/components/editor/side-bar/ProjectOverview.tsx +4 -0
- package/src/stores/EditorStore.ts +8 -2
- package/src/stores/ExplorerTreeState.ts +1 -0
- package/src/stores/LegendStudioRouter.ts +42 -0
- package/src/stores/editor-state/GrammarTextEditorState.ts +10 -3
- package/src/stores/editor-state/element-editor-state/service/ServiceExecutionState.ts +1 -1
- package/src/stores/sidebar-state/ProjectDependantEditorState.ts +50 -0
- package/src/stores/sidebar-state/ProjectOverviewState.ts +88 -0
- package/tsconfig.json +2 -0
|
@@ -37,10 +37,17 @@ import {
|
|
|
37
37
|
areWorkspacesEquivalent,
|
|
38
38
|
} from '@finos/legend-server-sdlc';
|
|
39
39
|
import { LEGEND_STUDIO_APP_EVENT } from '../LegendStudioAppEvent.js';
|
|
40
|
+
import { ProjectDependantEditorState } from './ProjectDependantEditorState.js';
|
|
41
|
+
import {
|
|
42
|
+
ProjectData,
|
|
43
|
+
ProjectVersionPlatformDependency,
|
|
44
|
+
} from '@finos/legend-server-depot';
|
|
45
|
+
import { compareSemVerVersions } from '@finos/legend-storage';
|
|
40
46
|
|
|
41
47
|
export enum PROJECT_OVERVIEW_ACTIVITY_MODE {
|
|
42
48
|
RELEASE = 'RELEASE',
|
|
43
49
|
OVERVIEW = 'OVERVIEW',
|
|
50
|
+
DEPENDANTS = 'DEPENDANTS',
|
|
44
51
|
VERSIONS = 'VERSIONS',
|
|
45
52
|
WORKSPACES = 'WORKSPACES',
|
|
46
53
|
}
|
|
@@ -54,6 +61,7 @@ export class ProjectOverviewState {
|
|
|
54
61
|
latestProjectVersion?: Version | null; // `undefined` if API is not yet called, `null` if fetched but no version exists
|
|
55
62
|
currentProjectRevision?: Revision | undefined;
|
|
56
63
|
projectWorkspaces: Workspace[] = [];
|
|
64
|
+
projectDependantEditorState: ProjectDependantEditorState;
|
|
57
65
|
|
|
58
66
|
isCreatingVersion = false;
|
|
59
67
|
isFetchingProjectWorkspaces = false;
|
|
@@ -76,17 +84,23 @@ export class ProjectOverviewState {
|
|
|
76
84
|
isUpdatingProject: observable,
|
|
77
85
|
isFetchingLatestVersion: observable,
|
|
78
86
|
isFetchingCurrentProjectRevision: observable,
|
|
87
|
+
projectDependantEditorState: observable,
|
|
79
88
|
setActivityMode: action,
|
|
80
89
|
fetchProjectWorkspaces: flow,
|
|
81
90
|
deleteWorkspace: flow,
|
|
82
91
|
updateProject: flow,
|
|
83
92
|
fetchLatestProjectVersion: flow,
|
|
93
|
+
fetchDependants: flow,
|
|
84
94
|
createVersion: flow,
|
|
85
95
|
});
|
|
86
96
|
|
|
87
97
|
this.editorStore = editorStore;
|
|
88
98
|
this.sdlcState = sdlcState;
|
|
89
99
|
this.releaseVersion = new CreateVersionCommand();
|
|
100
|
+
this.projectDependantEditorState = new ProjectDependantEditorState(
|
|
101
|
+
this,
|
|
102
|
+
this.editorStore,
|
|
103
|
+
);
|
|
90
104
|
}
|
|
91
105
|
|
|
92
106
|
setActivityMode(activityMode: PROJECT_OVERVIEW_ACTIVITY_MODE): void {
|
|
@@ -183,6 +197,80 @@ export class ProjectOverviewState {
|
|
|
183
197
|
}
|
|
184
198
|
}
|
|
185
199
|
|
|
200
|
+
*fetchDependants(): GeneratorFn<void> {
|
|
201
|
+
const groupId =
|
|
202
|
+
this.editorStore.projectConfigurationEditorState
|
|
203
|
+
.currentProjectConfiguration.groupId;
|
|
204
|
+
const artifactId =
|
|
205
|
+
this.editorStore.projectConfigurationEditorState
|
|
206
|
+
.currentProjectConfiguration.artifactId;
|
|
207
|
+
const version = this.editorStore.sdlcState.projectVersions[0]?.id.id;
|
|
208
|
+
|
|
209
|
+
if (!groupId || !artifactId || !version) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
try {
|
|
214
|
+
this.projectDependantEditorState.fetchingDependantInfoState.inProgress();
|
|
215
|
+
|
|
216
|
+
const fetchedDependants = (
|
|
217
|
+
(yield this.editorStore.depotServerClient.getIndexedDependantProjects(
|
|
218
|
+
groupId,
|
|
219
|
+
artifactId,
|
|
220
|
+
version,
|
|
221
|
+
)) as PlainObject<ProjectVersionPlatformDependency>[]
|
|
222
|
+
)
|
|
223
|
+
.map((v) => ProjectVersionPlatformDependency.serialization.fromJson(v))
|
|
224
|
+
.sort(
|
|
225
|
+
(
|
|
226
|
+
a: { groupId: string; artifactId: string },
|
|
227
|
+
b: { groupId: string; artifactId: string },
|
|
228
|
+
) => (a.groupId + a.artifactId > b.groupId + b.artifactId ? 1 : -1),
|
|
229
|
+
)
|
|
230
|
+
.sort((a: { versionId: string }, b: { versionId: string }) =>
|
|
231
|
+
compareSemVerVersions(a.versionId, b.versionId) > 0 ? 1 : -1,
|
|
232
|
+
)
|
|
233
|
+
.filter(
|
|
234
|
+
(filteredDependant: ProjectVersionPlatformDependency) =>
|
|
235
|
+
filteredDependant.versionId !== 'master-SNAPSHOT',
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
const uniqueProjects = [
|
|
239
|
+
...new Map(
|
|
240
|
+
fetchedDependants.map((item: ProjectVersionPlatformDependency) => [
|
|
241
|
+
`${item.groupId}:${item.artifactId}`,
|
|
242
|
+
item,
|
|
243
|
+
]),
|
|
244
|
+
).values(),
|
|
245
|
+
];
|
|
246
|
+
|
|
247
|
+
this.projectDependantEditorState.setDependants(uniqueProjects);
|
|
248
|
+
this.projectDependantEditorState.dependants?.map(
|
|
249
|
+
async (dependant: ProjectVersionPlatformDependency): Promise<void> => {
|
|
250
|
+
try {
|
|
251
|
+
const project = ProjectData.serialization.fromJson(
|
|
252
|
+
await this.editorStore.depotServerClient.getProject(
|
|
253
|
+
dependant.groupId,
|
|
254
|
+
dependant.artifactId,
|
|
255
|
+
),
|
|
256
|
+
);
|
|
257
|
+
dependant.projectId = project.projectId;
|
|
258
|
+
} catch (error) {
|
|
259
|
+
assertErrorThrown(error);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
);
|
|
263
|
+
this.projectDependantEditorState.fetchingDependantInfoState.complete();
|
|
264
|
+
} catch (error) {
|
|
265
|
+
assertErrorThrown(error);
|
|
266
|
+
this.projectDependantEditorState.fetchingDependantInfoState.fail();
|
|
267
|
+
this.editorStore.applicationStore.log.error(
|
|
268
|
+
LogEvent.create(LEGEND_STUDIO_APP_EVENT.DEPOT_MANAGER_FAILURE),
|
|
269
|
+
error,
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
186
274
|
*fetchLatestProjectVersion(): GeneratorFn<void> {
|
|
187
275
|
try {
|
|
188
276
|
this.isFetchingLatestVersion = true;
|
package/tsconfig.json
CHANGED
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"./src/stores/shared/modifier/Testable_GraphModifierHelper.ts",
|
|
142
142
|
"./src/stores/shared/testable/TestableUtils.ts",
|
|
143
143
|
"./src/stores/sidebar-state/LocalChangesState.ts",
|
|
144
|
+
"./src/stores/sidebar-state/ProjectDependantEditorState.ts",
|
|
144
145
|
"./src/stores/sidebar-state/ProjectOverviewState.ts",
|
|
145
146
|
"./src/stores/sidebar-state/WorkflowManagerState.ts",
|
|
146
147
|
"./src/stores/sidebar-state/WorkspaceReviewState.ts",
|
|
@@ -238,6 +239,7 @@
|
|
|
238
239
|
"./src/components/editor/side-bar/CreateNewElementModal.tsx",
|
|
239
240
|
"./src/components/editor/side-bar/Explorer.tsx",
|
|
240
241
|
"./src/components/editor/side-bar/LocalChanges.tsx",
|
|
242
|
+
"./src/components/editor/side-bar/ProjectDependantsEditor.tsx",
|
|
241
243
|
"./src/components/editor/side-bar/ProjectOverview.tsx",
|
|
242
244
|
"./src/components/editor/side-bar/SideBar.tsx",
|
|
243
245
|
"./src/components/editor/side-bar/WorkflowManager.tsx",
|