@finos/legend-application-studio 28.21.11 → 28.21.13

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 (79) hide show
  1. package/lib/components/editor/ActivityBar.d.ts +13 -0
  2. package/lib/components/editor/ActivityBar.d.ts.map +1 -1
  3. package/lib/components/editor/ActivityBar.js +59 -4
  4. package/lib/components/editor/ActivityBar.js.map +1 -1
  5. package/lib/components/editor/command/project-search.css +1 -1
  6. package/lib/components/editor/command/project-search.css.map +1 -1
  7. package/lib/components/editor/editor-group/GrammarTextEditor.d.ts.map +1 -1
  8. package/lib/components/editor/editor-group/GrammarTextEditor.js +6 -2
  9. package/lib/components/editor/editor-group/GrammarTextEditor.js.map +1 -1
  10. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts +2 -0
  11. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +81 -19
  13. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  14. package/lib/components/editor/editor-group/database-editor/DatabaseDiagramCanvas.d.ts.map +1 -1
  15. package/lib/components/editor/editor-group/database-editor/DatabaseDiagramCanvas.js +10 -1
  16. package/lib/components/editor/editor-group/database-editor/DatabaseDiagramCanvas.js.map +1 -1
  17. package/lib/components/editor/editor-group/database-editor/DatabaseEditor.d.ts.map +1 -1
  18. package/lib/components/editor/editor-group/database-editor/DatabaseEditor.js +3 -10
  19. package/lib/components/editor/editor-group/database-editor/DatabaseEditor.js.map +1 -1
  20. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.d.ts.map +1 -1
  21. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js +8 -3
  22. package/lib/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.js.map +1 -1
  23. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js +1 -1
  24. package/lib/components/editor/editor-group/function-activator/FunctionEditor.js.map +1 -1
  25. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +1 -1
  26. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  27. package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
  28. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +4 -1
  29. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
  30. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.d.ts.map +1 -1
  31. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js +1 -3
  32. package/lib/components/editor/editor-group/uml-editor/StereotypeSelector.js.map +1 -1
  33. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.d.ts.map +1 -1
  34. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js +1 -3
  35. package/lib/components/editor/editor-group/uml-editor/TaggedValueEditor.js.map +1 -1
  36. package/lib/components/editor/ingest-definition-editor.css +1 -1
  37. package/lib/components/editor/ingest-definition-editor.css.map +1 -1
  38. package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
  39. package/lib/components/workspace-setup/WorkspaceSetup.js +20 -3
  40. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  41. package/lib/index.css +2 -2
  42. package/lib/index.css.map +1 -1
  43. package/lib/index.d.ts +1 -0
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +1 -0
  46. package/lib/index.js.map +1 -1
  47. package/lib/package.json +1 -1
  48. package/lib/stores/editor/editor-state/element-editor-state/DatabaseEditorState.d.ts +0 -9
  49. package/lib/stores/editor/editor-state/element-editor-state/DatabaseEditorState.d.ts.map +1 -1
  50. package/lib/stores/editor/editor-state/element-editor-state/DatabaseEditorState.js +0 -34
  51. package/lib/stores/editor/editor-state/element-editor-state/DatabaseEditorState.js.map +1 -1
  52. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.d.ts +61 -0
  53. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -0
  54. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.js +17 -0
  55. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.js.map +1 -0
  56. package/lib/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.d.ts +2 -2
  57. package/lib/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  58. package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
  59. package/lib/stores/workspace-setup/WorkspaceSetupStore.js +6 -2
  60. package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
  61. package/package.json +12 -12
  62. package/src/components/editor/ActivityBar.tsx +88 -0
  63. package/src/components/editor/editor-group/GrammarTextEditor.tsx +8 -2
  64. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +207 -29
  65. package/src/components/editor/editor-group/database-editor/DatabaseDiagramCanvas.tsx +11 -0
  66. package/src/components/editor/editor-group/database-editor/DatabaseEditor.tsx +1 -28
  67. package/src/components/editor/editor-group/diff-editor/EntityChangeConflictEditor.tsx +10 -3
  68. package/src/components/editor/editor-group/function-activator/FunctionEditor.tsx +1 -1
  69. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +1 -1
  70. package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +5 -1
  71. package/src/components/editor/editor-group/uml-editor/StereotypeSelector.tsx +1 -5
  72. package/src/components/editor/editor-group/uml-editor/TaggedValueEditor.tsx +1 -5
  73. package/src/components/workspace-setup/WorkspaceSetup.tsx +27 -2
  74. package/src/index.ts +1 -0
  75. package/src/stores/editor/editor-state/element-editor-state/DatabaseEditorState.ts +0 -42
  76. package/src/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.ts +77 -0
  77. package/src/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.ts +1 -2
  78. package/src/stores/workspace-setup/WorkspaceSetupStore.ts +5 -0
  79. package/tsconfig.json +1 -0
@@ -42,7 +42,6 @@ import {
42
42
  type View,
43
43
  } from '@finos/legend-graph';
44
44
  import type { EditorStore } from '../../EditorStore.js';
45
- import { LegendStudioUserDataHelper } from '../../../../__lib__/LegendStudioUserDataHelper.js';
46
45
 
47
46
  /**
48
47
  * Top-level tabs inside the Database form-mode editor. `VIEW` shows the ERD
@@ -397,19 +396,6 @@ export class DatabaseEditorState extends ElementEditorState {
397
396
  // by `react-reflex` and not tracked here — only the binary collapse flag.
398
397
  isSidePanelCollapsed = false;
399
398
 
400
- // ---- Theme --------------------------------------------------------------
401
- // The wider Studio app is dark-mode-only today. We allow this editor (and
402
- // only this editor) to opt into a light theme via a toolbar toggle. The
403
- // setting lives on the editor state so it survives tab switches and
404
- // recompiles within the same session, and is persisted per-user via
405
- // `UserDataService` (localStorage) so the choice survives reloads.
406
- // TODO: when Studio adopts app-wide theming via `LayoutService` (Query
407
- // already does this with `setColorTheme(..., { persist: true })`), drop
408
- // this local observable + persistence and react to
409
- // `applicationStore.layoutService.currentColorTheme` instead so this
410
- // editor stays in sync with the rest of the app.
411
- theme: 'dark' | 'light' = 'dark';
412
-
413
399
  constructor(editorStore: EditorStore, element: PackageableElement) {
414
400
  super(editorStore, element);
415
401
 
@@ -435,7 +421,6 @@ export class DatabaseEditorState extends ElementEditorState {
435
421
  viewGroupByFormulas: observable,
436
422
  isLoadingViewGroupByFormulas: observable,
437
423
  isSidePanelCollapsed: observable,
438
- theme: observable,
439
424
  database: computed,
440
425
  setSelectedTab: action,
441
426
  setSelectedRelation: action,
@@ -451,7 +436,6 @@ export class DatabaseEditorState extends ElementEditorState {
451
436
  collapseAll: action,
452
437
  setSidePanelCollapsed: action,
453
438
  toggleSidePanelCollapsed: action,
454
- toggleTheme: action,
455
439
  setSearchText: action,
456
440
  requestFitAll: action,
457
441
  requestResetLayout: action,
@@ -467,16 +451,6 @@ export class DatabaseEditorState extends ElementEditorState {
467
451
  this.expandedSchemaIds.add(getSchemaNodeId(schema.name));
468
452
  });
469
453
 
470
- // Hydrate the persisted theme preference (if any). Falls through to the
471
- // default 'dark' when the user has never set it. Done synchronously in
472
- // the constructor so the first render already reflects the stored choice.
473
- const persistedTheme = LegendStudioUserDataHelper.databaseEditor_getTheme(
474
- this.editorStore.applicationStore.userDataService,
475
- );
476
- if (persistedTheme) {
477
- this.theme = persistedTheme;
478
- }
479
-
480
454
  // Kick off the formula load eagerly. The flow is async and writes into
481
455
  // `viewColumnFormulas` when ready — components render with the placeholder
482
456
  // until then, so the UI is never blocked on this. Errors are logged and
@@ -876,21 +850,6 @@ export class DatabaseEditorState extends ElementEditorState {
876
850
  this.isSidePanelCollapsed = !this.isSidePanelCollapsed;
877
851
  }
878
852
 
879
- /**
880
- * Flip the editor's local theme between dark (the Studio default) and
881
- * light. Scoped to this editor only — the rest of Studio remains in its
882
- * configured theme. The toggle is exposed via a button in the editor's
883
- * tab header. The new value is persisted to `UserDataService` so the
884
- * choice survives reloads.
885
- */
886
- toggleTheme(): void {
887
- this.theme = this.theme === 'dark' ? 'light' : 'dark';
888
- LegendStudioUserDataHelper.databaseEditor_setTheme(
889
- this.editorStore.applicationStore.userDataService,
890
- this.theme,
891
- );
892
- }
893
-
894
853
  /**
895
854
  * Set the tree search/filter text. Empty string means \u201cno filter\u201d.
896
855
  * The schema-tree consumer derives a lowercase form per render rather
@@ -927,7 +886,6 @@ export class DatabaseEditorState extends ElementEditorState {
927
886
  next.expandedSchemaIds = new Set(this.expandedSchemaIds);
928
887
  next.expandedRelationIds = new Set(this.expandedRelationIds);
929
888
  next.isSidePanelCollapsed = this.isSidePanelCollapsed;
930
- next.theme = this.theme;
931
889
  // Note: `viewColumnFormulas` and `filterFormulas` deliberately do NOT
932
890
  // carry over. They're derived from operations on the new element and may
933
891
  // have changed; the constructor's `loadViewColumnFormulas()` and
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Copyright (c) 2020-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import type { DSL_LegendStudioApplicationPlugin_Extension } from '../LegendStudioApplicationPlugin.js';
18
+
19
+ // ── Response types ─────────────────────────────────────────────────────────────
20
+
21
+ export type DataProductMeta = {
22
+ title: string;
23
+ description: string;
24
+ confidence: number;
25
+ };
26
+
27
+ export type AccessPointGroupMeta = {
28
+ name: string;
29
+ title: string;
30
+ description: string;
31
+ confidence: number;
32
+ };
33
+
34
+ export type AccessPointMeta = {
35
+ group: string;
36
+ name: string;
37
+ title: string;
38
+ description: string;
39
+ confidence: number;
40
+ };
41
+
42
+ export type DataProductDocResponse = {
43
+ data_product: DataProductMeta;
44
+ access_point_groups: AccessPointGroupMeta[];
45
+ access_points: AccessPointMeta[];
46
+ };
47
+
48
+ // ── Request type ───────────────────────────────────────────────────────────────
49
+
50
+ export type DataProductDocRequest = {
51
+ /**
52
+ * Raw Pure grammar text containing the data product definitions.
53
+ */
54
+ definitions: string;
55
+ /**
56
+ * Fully-qualified name of the data product (e.g. dataProduct::MY_PRODUCT).
57
+ */
58
+ data_product_name: string;
59
+ /**
60
+ * LLM model override (uses server default if omitted).
61
+ */
62
+ model?: string;
63
+ };
64
+
65
+ // ── Plugin extension interface ─────────────────────────────────────────────────
66
+
67
+ export interface DSL_DataProduct_LegendStudioApplicationPlugin_Extension
68
+ extends DSL_LegendStudioApplicationPlugin_Extension {
69
+ /**
70
+ * Generate AI-suggested documentation for a data product
71
+ * (title, description, access point groups, access points).
72
+ */
73
+ getExtraDataProductDocumentationAISuggester?(
74
+ request: DataProductDocRequest,
75
+ legendAIUrl: string,
76
+ ): Promise<DataProductDocResponse>;
77
+ }
@@ -23,7 +23,6 @@ import type {
23
23
  ObserverContext,
24
24
  PostDeploymentProperties,
25
25
  HostedService,
26
- Service,
27
26
  } from '@finos/legend-graph';
28
27
 
29
28
  export type ServiceTestRuntimeConnectionBuilder = (
@@ -50,7 +49,7 @@ export type PostDeploymentActionTypeGetter = (
50
49
  ) => string | undefined;
51
50
 
52
51
  export type ServiceDocumentationAISuggester = (
53
- service: Service,
52
+ serviceGrammar: string,
54
53
  legendAIUrl: string,
55
54
  ) => Promise<string>;
56
55
 
@@ -444,6 +444,10 @@ export class WorkspaceSetupStore {
444
444
  // custom selector. This avoids losing some results with the additional filtering.
445
445
  isValidSearchString ? exactSearch(searchText) : undefined,
446
446
  undefined,
447
+ // Sandbox projects are loaded via a separate, dedicated call (see
448
+ // `loadSandboxProject`); exclude them here so they do not appear
449
+ // in the main workspace setup project picker.
450
+ [SANDBOX_SDLC_TAG],
447
451
  DEFAULT_TYPEAHEAD_SEARCH_LIMIT,
448
452
  )) as PlainObject<Project>[]
449
453
  ).map((v) => Project.serialization.fromJson(v));
@@ -518,6 +522,7 @@ export class WorkspaceSetupStore {
518
522
  undefined,
519
523
  userId,
520
524
  [SANDBOX_SDLC_TAG],
525
+ undefined,
521
526
  1,
522
527
  )) as PlainObject<Project>[]
523
528
  ).map((v) => Project.serialization.fromJson(v));
package/tsconfig.json CHANGED
@@ -197,6 +197,7 @@
197
197
  "./src/stores/editor/utils/PackageTreeUtils.ts",
198
198
  "./src/stores/editor/utils/TestableUtils.ts",
199
199
  "./src/stores/editor/utils/TreeUtils.ts",
200
+ "./src/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.ts",
200
201
  "./src/stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.ts",
201
202
  "./src/stores/extensions/DSL_Generation_LegendStudioApplicationPlugin_Extension.ts",
202
203
  "./src/stores/extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.ts",