@finos/legend-application-studio 26.1.6 → 26.1.7

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.
Files changed (42) hide show
  1. package/lib/__lib__/LegendStudioEvent.d.ts +1 -1
  2. package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioEvent.js +1 -1
  4. package/lib/__lib__/LegendStudioEvent.js.map +1 -1
  5. package/lib/__lib__/LegendStudioTesting.d.ts +3 -0
  6. package/lib/__lib__/LegendStudioTesting.d.ts.map +1 -1
  7. package/lib/__lib__/LegendStudioTesting.js +3 -0
  8. package/lib/__lib__/LegendStudioTesting.js.map +1 -1
  9. package/lib/components/editor/ActivityBar.js +1 -1
  10. package/lib/components/editor/ActivityBar.js.map +1 -1
  11. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +51 -3
  13. package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
  14. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  15. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +4 -3
  16. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  17. package/lib/components/editor/side-bar/Explorer.d.ts.map +1 -1
  18. package/lib/components/editor/side-bar/Explorer.js +3 -2
  19. package/lib/components/editor/side-bar/Explorer.js.map +1 -1
  20. package/lib/index.css +2 -2
  21. package/lib/index.css.map +1 -1
  22. package/lib/package.json +1 -1
  23. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  24. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +1 -1
  25. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  26. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +2 -0
  27. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
  28. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +6 -0
  29. package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
  30. package/lib/stores/editor/utils/PackageTreeUtils.d.ts.map +1 -1
  31. package/lib/stores/editor/utils/PackageTreeUtils.js +3 -3
  32. package/lib/stores/editor/utils/PackageTreeUtils.js.map +1 -1
  33. package/package.json +4 -4
  34. package/src/__lib__/LegendStudioEvent.ts +1 -1
  35. package/src/__lib__/LegendStudioTesting.ts +3 -0
  36. package/src/components/editor/ActivityBar.tsx +1 -1
  37. package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +156 -26
  38. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +15 -3
  39. package/src/components/editor/side-bar/Explorer.tsx +3 -1
  40. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +1 -3
  41. package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +7 -1
  42. package/src/stores/editor/utils/PackageTreeUtils.ts +7 -2
@@ -117,7 +117,7 @@ export const ActivityBarMenu: React.FC = () => {
117
117
  disabled={!appDocUrl}
118
118
  onClick={goToDocumentation}
119
119
  >
120
- See Documentation
120
+ Documentation
121
121
  </MenuContentItem>
122
122
  {docLinks?.map((entry) => (
123
123
  <MenuContentItem
@@ -33,6 +33,9 @@ import {
33
33
  ExclamationTriangleIcon,
34
34
  PanelFormSection,
35
35
  PanelListItem,
36
+ Button,
37
+ PencilEditIcon,
38
+ PanelDivider,
36
39
  } from '@finos/legend-art';
37
40
  import { flowResult } from 'mobx';
38
41
  import {
@@ -246,10 +249,36 @@ const PlatformDependencyViewer = observer(
246
249
  },
247
250
  );
248
251
 
252
+ const PlatformDependencyEditor = observer(
253
+ (props: { platform: PlatformConfiguration }) => {
254
+ const { platform } = props;
255
+
256
+ return (
257
+ <div className="platform-configurations-editor__dependency">
258
+ <div className="platform-configurations-editor__dependency__label">
259
+ <div className="platform-configurations-editor__dependency__label__status"></div>
260
+ <div className="platform-configurations-editor__dependency__label__text">
261
+ {platform.name}
262
+ </div>
263
+ <input
264
+ className="input input--dark"
265
+ onChange={(event) => {
266
+ platform.setVersion(event.target.value);
267
+ }}
268
+ value={platform.version}
269
+ spellCheck={false}
270
+ />
271
+ </div>
272
+ </div>
273
+ );
274
+ },
275
+ );
276
+
249
277
  const ProjectPlatformVersionEditor = observer(
250
278
  (props: { projectConfig: ProjectConfiguration; isReadOnly: boolean }) => {
251
279
  const { projectConfig, isReadOnly } = props;
252
280
  const editorStore = useEditorStore();
281
+ const applicationStore = useApplicationStore();
253
282
 
254
283
  const convertPlatformtoPlatformConfiguration = (
255
284
  platforms: Platform[] | undefined,
@@ -297,6 +326,34 @@ const ProjectPlatformVersionEditor = observer(
297
326
  }
298
327
  };
299
328
 
329
+ const toggleManualOverwrite = (): void => {
330
+ if (!editorStore.projectConfigurationEditorState.manualOverwrite) {
331
+ applicationStore.alertService.setActionAlertInfo({
332
+ message:
333
+ 'Clicking this will allow you to not just override and freeze platform versions but to input custom platform versions you would like manually and is not usually recommended except to temporarily unblock your project',
334
+ prompt: 'Do you want to proceed?',
335
+ type: ActionAlertType.CAUTION,
336
+ actions: [
337
+ {
338
+ label: 'Continue',
339
+ type: ActionAlertActionType.PROCEED_WITH_CAUTION,
340
+ handler: (): void =>
341
+ editorStore.projectConfigurationEditorState.setManualOverwrite(
342
+ true,
343
+ ),
344
+ },
345
+ {
346
+ label: 'Cancel',
347
+ type: ActionAlertActionType.PROCEED,
348
+ default: true,
349
+ },
350
+ ],
351
+ });
352
+ } else {
353
+ editorStore.projectConfigurationEditorState.setManualOverwrite(false);
354
+ }
355
+ };
356
+
300
357
  return (
301
358
  <Panel>
302
359
  <PanelForm>
@@ -339,35 +396,108 @@ const ProjectPlatformVersionEditor = observer(
339
396
  </div>
340
397
  </div>
341
398
  </div>
342
- {platformConfigurations && !isUpToDate && (
343
- <div className="platform-configurations-editor__dependencies__header__right">
344
- <button
345
- className="btn btn--dark"
346
- tabIndex={-1}
347
- onClick={updateLatestToLatestVersion}
399
+
400
+ <div className="platform-configurations-editor__dependencies__header__right">
401
+ <PanelListItem>
402
+ {platformConfigurations &&
403
+ !isUpToDate &&
404
+ !editorStore.projectConfigurationEditorState
405
+ .manualOverwrite && (
406
+ <div>
407
+ <button
408
+ className="btn btn--dark"
409
+ tabIndex={-1}
410
+ onClick={updateLatestToLatestVersion}
411
+ >
412
+ Update to the current latest platform version
413
+ </button>
414
+ </div>
415
+ )}
416
+ <Button
417
+ className={clsx(
418
+ 'project-configuration-editor__manual-btn',
419
+ {
420
+ 'project-configuration-editor__manual-btn--active':
421
+ editorStore.projectConfigurationEditorState
422
+ .manualOverwrite,
423
+ },
424
+ )}
425
+ title="Manually overwrite platform configurations"
426
+ disabled={isReadOnly}
427
+ onClick={toggleManualOverwrite}
348
428
  >
349
- Update to the current latest platform version
350
- </button>
351
- </div>
352
- )}
429
+ <PencilEditIcon />
430
+ </Button>
431
+ </PanelListItem>
432
+ </div>
353
433
  </div>
354
434
  <div className="platform-configurations-editor__dependencies__content">
355
- {!platformConfigurations &&
356
- defaultPlatforms?.map((p) => (
357
- <PlatformDependencyViewer
358
- key={p.name}
359
- isDefault={true}
360
- platform={p}
361
- />
362
- ))}
363
- {platformConfigurations?.map((p) => (
364
- <PlatformDependencyViewer
365
- key={p.name}
366
- platform={p}
367
- isDefault={false}
368
- isLatestVersion={isUpToDate}
369
- />
370
- ))}
435
+ {editorStore.projectConfigurationEditorState.manualOverwrite ? (
436
+ <>
437
+ {!platformConfigurations &&
438
+ defaultPlatforms?.map((p) => (
439
+ <PlatformDependencyEditor key={p.name} platform={p} />
440
+ ))}
441
+ {platformConfigurations?.map((p) => (
442
+ <PlatformDependencyEditor key={p.name} platform={p} />
443
+ ))}
444
+
445
+ <PanelDivider />
446
+ <PanelListItem>
447
+ <Button
448
+ className="project-configuration-editor__manual-overwrite-btn"
449
+ disabled={isReadOnly}
450
+ onClick={() => {
451
+ editorStore.projectConfigurationEditorState.setManualOverwrite(
452
+ false,
453
+ );
454
+ }}
455
+ title="Cancel manual override"
456
+ text="Cancel"
457
+ />
458
+
459
+ <Button
460
+ className="project-configuration-editor__manual-overwrite-btn"
461
+ disabled={isReadOnly}
462
+ onClick={() => {
463
+ if (!platformConfigurations) {
464
+ projectConfig.setPlatformConfigurations(
465
+ defaultPlatforms,
466
+ );
467
+ } else {
468
+ projectConfig.setPlatformConfigurations(
469
+ platformConfigurations,
470
+ );
471
+ }
472
+
473
+ editorStore.projectConfigurationEditorState.setManualOverwrite(
474
+ false,
475
+ );
476
+ }}
477
+ text="Manual override"
478
+ />
479
+ </PanelListItem>
480
+ </>
481
+ ) : (
482
+ <>
483
+ {!platformConfigurations &&
484
+ defaultPlatforms?.map((p) => (
485
+ <PlatformDependencyViewer
486
+ key={p.name}
487
+ isDefault={true}
488
+ platform={p}
489
+ />
490
+ ))}
491
+ {platformConfigurations?.map((p) => (
492
+ <PlatformDependencyViewer
493
+ key={p.name}
494
+ platform={p}
495
+ isDefault={false}
496
+ isLatestVersion={isUpToDate}
497
+ />
498
+ ))}
499
+ </>
500
+ )}
371
501
  </div>
372
502
  </div>
373
503
  </PanelForm>
@@ -87,6 +87,7 @@ import {
87
87
  CODE_EDITOR_LANGUAGE,
88
88
  CodeEditor,
89
89
  } from '@finos/legend-lego/code-editor';
90
+ import { LEGEND_STUDIO_TEST_ID } from '../../../../../__lib__/LegendStudioTesting.js';
90
91
 
91
92
  export const NewParameterModal = observer(
92
93
  (props: { setupState: ServiceTestSetupState; isReadOnly: boolean }) => {
@@ -391,7 +392,10 @@ const ServiceTestSetupEditor = observer(
391
392
  }, [setupState]);
392
393
 
393
394
  return (
394
- <div className="panel service-test-editor">
395
+ <div
396
+ data-testid={LEGEND_STUDIO_TEST_ID.SERVICE_TEST_EDITOR__SETUP}
397
+ className="panel service-test-editor"
398
+ >
395
399
  <div className="panel__header">
396
400
  <div className="service-test-suite-editor__header__title">
397
401
  <div className="service-test-suite-editor__header__title__label">
@@ -460,7 +464,12 @@ const ServiceTestSetupEditor = observer(
460
464
  <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
461
465
  </ResizablePanelSplitter>
462
466
  <ResizablePanel minSize={56}>
463
- <div className="service-test-data-editor panel">
467
+ <div
468
+ data-testid={
469
+ LEGEND_STUDIO_TEST_ID.SERVICE_TEST_EDITOR__SETUP__PARAMETERS
470
+ }
471
+ className="service-test-data-editor panel"
472
+ >
464
473
  <div className="service-test-suite-editor__header">
465
474
  <div className="service-test-suite-editor__header__title">
466
475
  <div className="service-test-suite-editor__header__title__label">
@@ -783,7 +792,10 @@ export const ServiceTestsEditor = observer(
783
792
  const renameTest = (val: string): void =>
784
793
  atomicTest_setId(guaranteeNonNullable(suiteState.testToRename), val);
785
794
  return (
786
- <div className="panel service-test-editor">
795
+ <div
796
+ data-testid={LEGEND_STUDIO_TEST_ID.SERVICE_TEST_EDITOR}
797
+ className="panel service-test-editor"
798
+ >
787
799
  <div className="service-test-suite-editor__header">
788
800
  <div className="service-test-suite-editor__header__title">
789
801
  <div className="service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--tests">
@@ -101,6 +101,7 @@ import {
101
101
  PackageableConnection,
102
102
  RelationalDatabaseConnection,
103
103
  guaranteeRelationalDatabaseConnection,
104
+ extractDependencyGACoordinateFromRootPackageName,
104
105
  } from '@finos/legend-graph';
105
106
  import { useApplicationStore } from '@finos/legend-application';
106
107
  import {
@@ -895,7 +896,8 @@ const PackageTreeNodeContainer = observer(
895
896
  tabIndex={-1}
896
897
  title={node.packageableElement.path}
897
898
  >
898
- {node.label}
899
+ {extractDependencyGACoordinateFromRootPackageName(node.label) ??
900
+ node.label}
899
901
  </button>
900
902
  </div>
901
903
  </ContextMenu>
@@ -260,9 +260,7 @@ export class ServiceTestSetupState {
260
260
  }
261
261
  } catch (error) {
262
262
  this.editorStore.applicationStore.logService.error(
263
- LogEvent.create(
264
- LEGEND_STUDIO_APP_EVENT.TEST_DATA_GENERATION__SETUP__FAILURE,
265
- ),
263
+ LogEvent.create(LEGEND_STUDIO_APP_EVENT.SERVICE_TEST_SETUP_FAILURE),
266
264
  error,
267
265
  );
268
266
  }
@@ -63,7 +63,7 @@ export class ProjectConfigurationEditorState extends EditorState {
63
63
  projects = new Map<string, StoreProjectData>();
64
64
  versions = new Map<string, string[]>();
65
65
  latestProjectStructureVersion: ProjectStructureVersion | undefined;
66
-
66
+ manualOverwrite = false;
67
67
  associatedProjectsAndVersionsFetched = false;
68
68
 
69
69
  constructor(editorStore: EditorStore, sdlcState: EditorSDLCState) {
@@ -75,6 +75,7 @@ export class ProjectConfigurationEditorState extends EditorState {
75
75
  projectConfiguration: observable,
76
76
  selectedTab: observable,
77
77
  isReadOnly: observable,
78
+ manualOverwrite: observable,
78
79
  projects: observable,
79
80
  versions: observable,
80
81
  associatedProjectsAndVersionsFetched: observable,
@@ -88,6 +89,7 @@ export class ProjectConfigurationEditorState extends EditorState {
88
89
  setOriginalProjectConfiguration: action,
89
90
  setProjectConfiguration: action,
90
91
  setSelectedTab: action,
92
+ setManualOverwrite: action,
91
93
  fectchAssociatedProjectsAndVersions: flow,
92
94
  updateProjectConfiguration: flow,
93
95
  updateToLatestStructure: flow,
@@ -118,6 +120,10 @@ export class ProjectConfigurationEditorState extends EditorState {
118
120
  this.selectedTab = tab;
119
121
  }
120
122
 
123
+ setManualOverwrite(value: boolean): void {
124
+ this.manualOverwrite = value;
125
+ }
126
+
121
127
  get label(): string {
122
128
  return 'config';
123
129
  }
@@ -47,6 +47,7 @@ import {
47
47
  generateFunctionPrettyName,
48
48
  getElementRootPackage,
49
49
  extractDependencyGACoordinateFromRootPackageName,
50
+ generateDependencyRootPackageName,
50
51
  } from '@finos/legend-graph';
51
52
  import { ExplorerTreeRootPackageLabel } from '../ExplorerTreeState.js';
52
53
 
@@ -229,8 +230,12 @@ export const getDependenciesPackableElementTreeData = (
229
230
  const dependencyGACoordinates =
230
231
  extractDependencyGACoordinateFromRootPackageName(_package.name) ??
231
232
  _package.name;
232
- childRootNode.label = dependencyGACoordinates;
233
- childRootNode.id = dependencyGACoordinates;
233
+ childRootNode.label = generateDependencyRootPackageName(
234
+ dependencyGACoordinates,
235
+ );
236
+ childRootNode.id = generateDependencyRootPackageName(
237
+ dependencyGACoordinates,
238
+ );
234
239
  addUniqueEntry(rootIds, childRootNode.id);
235
240
  nodes.set(childRootNode.id, childRootNode);
236
241
  root.children.push(_package);