@finos/legend-application-studio 28.21.12 → 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 (40) 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 +36 -15
  4. package/lib/components/editor/ActivityBar.js.map +1 -1
  5. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts +2 -0
  6. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
  7. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +81 -19
  8. package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
  9. package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
  10. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +4 -1
  11. package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
  12. package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
  13. package/lib/components/workspace-setup/WorkspaceSetup.js +20 -3
  14. package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
  15. package/lib/index.css +2 -2
  16. package/lib/index.css.map +1 -1
  17. package/lib/index.d.ts +1 -0
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +1 -0
  20. package/lib/index.js.map +1 -1
  21. package/lib/package.json +1 -1
  22. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.d.ts +61 -0
  23. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -0
  24. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.js +17 -0
  25. package/lib/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.js.map +1 -0
  26. package/lib/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.d.ts +2 -2
  27. package/lib/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  28. package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
  29. package/lib/stores/workspace-setup/WorkspaceSetupStore.js +6 -2
  30. package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
  31. package/package.json +12 -12
  32. package/src/components/editor/ActivityBar.tsx +61 -38
  33. package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +207 -29
  34. package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +5 -1
  35. package/src/components/workspace-setup/WorkspaceSetup.tsx +27 -2
  36. package/src/index.ts +1 -0
  37. package/src/stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.ts +77 -0
  38. package/src/stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.ts +1 -2
  39. package/src/stores/workspace-setup/WorkspaceSetupStore.ts +5 -0
  40. package/tsconfig.json +1 -0
@@ -49,7 +49,7 @@ import { useApplicationNavigationContext } from '@finos/legend-application';
49
49
  import { useParams } from '@finos/legend-application/browser';
50
50
  import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../__lib__/LegendStudioDocumentation.js';
51
51
  import { CreateProjectModal } from './CreateProjectModal.js';
52
- import { ActivityBarMenu } from '../editor/ActivityBar.js';
52
+ import { ActivityBarMenu, ColorThemeToggle } from '../editor/ActivityBar.js';
53
53
  import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../__lib__/LegendStudioApplicationNavigationContext.js';
54
54
  import { CreateWorkspaceModal } from './CreateWorkspaceModal.js';
55
55
  import { RecentWorkspacesPanel } from './RecentWorkspacesPanel.js';
@@ -369,14 +369,24 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
369
369
  // Build a unified option list: recent projects (that aren't already in the
370
370
  // loaded set) are prepended so users can instantly re-open common work
371
371
  // without waiting for the SDLC search to round-trip.
372
+ const sandboxProject =
373
+ setupStore.sandboxProject instanceof Project
374
+ ? setupStore.sandboxProject
375
+ : undefined;
376
+ const sandboxProjectId = sandboxProject?.projectId;
372
377
  const loadedProjectOptions = setupStore.projects
378
+ .filter((p) => p.projectId !== sandboxProjectId)
373
379
  .map(buildProjectOption)
374
380
  .sort(compareLabelFn);
375
381
  const loadedProjectIds = new Set(
376
382
  setupStore.projects.map((p) => p.projectId),
377
383
  );
378
384
  const recentProjectOptions: ProjectOption[] = setupStore.recentProjects
379
- .filter((r) => !loadedProjectIds.has(r.projectId))
385
+ .filter(
386
+ (r) =>
387
+ !loadedProjectIds.has(r.projectId) &&
388
+ r.projectId !== sandboxProjectId,
389
+ )
380
390
  .map((r) => {
381
391
  // Rebuild a real Project from the cached metadata; no synthetic
382
392
  // fields needed since we persist everything the schema requires.
@@ -390,6 +400,17 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
390
400
  return { label: stub.name, value: stub };
391
401
  });
392
402
  const projectOptions: ProjectOption[] = [
403
+ // The user's own sandbox project is fetched via a dedicated call
404
+ // (`loadSandboxProject`) and excluded from the main search results, so
405
+ // we surface it here as a labeled option pinned to the top of the list.
406
+ ...(sandboxProject
407
+ ? [
408
+ {
409
+ label: `${sandboxProject.name} (sandbox)`,
410
+ value: sandboxProject,
411
+ },
412
+ ]
413
+ : []),
393
414
  ...recentProjectOptions,
394
415
  ...loadedProjectOptions,
395
416
  ];
@@ -546,6 +567,10 @@ export const WorkspaceSetup = withWorkspaceSetupStore(
546
567
  <div className="workspace-setup__body">
547
568
  <div className="activity-bar">
548
569
  <ActivityBarMenu />
570
+ {/* Spacer so the theme toggle sits at the bottom of the strip,
571
+ mirroring how the editor's activity bar is laid out. */}
572
+ <div className="activity-bar__items" />
573
+ <ColorThemeToggle />
549
574
  </div>
550
575
  <div
551
576
  className="workspace-setup__content"
package/src/index.ts CHANGED
@@ -64,6 +64,7 @@ export * from './stores/graph-modifier/DSL_Service_GraphModifierHelper.js';
64
64
  export * from './stores/graph-modifier/RawValueSpecificationGraphModifierHelper.js';
65
65
  export * from './stores/extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
66
66
  export * from './stores/extensions/DSL_Service_LegendStudioApplicationPlugin_Extension.js';
67
+ export * from './stores/extensions/DSL_DataProduct_LegendStudioApplicationPlugin_Extension.js';
67
68
  export * from './stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
68
69
  export { DataProductEditorState } from './stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js';
69
70
 
@@ -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",