@finos/legend-application-studio 28.18.124 → 28.18.126

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 (115) hide show
  1. package/lib/__lib__/LegendStudioNavigation.d.ts +7 -0
  2. package/lib/__lib__/LegendStudioNavigation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioNavigation.js +5 -0
  4. package/lib/__lib__/LegendStudioNavigation.js.map +1 -1
  5. package/lib/application/LegendIngestionConfiguration.d.ts +40 -0
  6. package/lib/application/LegendIngestionConfiguration.d.ts.map +1 -0
  7. package/lib/application/LegendIngestionConfiguration.js +57 -0
  8. package/lib/application/LegendIngestionConfiguration.js.map +1 -0
  9. package/lib/application/LegendStudioApplicationConfig.d.ts +2 -0
  10. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  11. package/lib/application/LegendStudioApplicationConfig.js +6 -0
  12. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  13. package/lib/components/ElementIconUtils.d.ts.map +1 -1
  14. package/lib/components/ElementIconUtils.js +3 -1
  15. package/lib/components/ElementIconUtils.js.map +1 -1
  16. package/lib/components/LegendStudioWebApplication.d.ts.map +1 -1
  17. package/lib/components/LegendStudioWebApplication.js +16 -0
  18. package/lib/components/LegendStudioWebApplication.js.map +1 -1
  19. package/lib/components/editor/Editor.d.ts.map +1 -1
  20. package/lib/components/editor/Editor.js +3 -2
  21. package/lib/components/editor/Editor.js.map +1 -1
  22. package/lib/components/editor/editor-group/EditorGroup.d.ts.map +1 -1
  23. package/lib/components/editor/editor-group/EditorGroup.js +5 -0
  24. package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
  25. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.d.ts.map +1 -1
  26. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js +1 -1
  27. package/lib/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.js.map +1 -1
  28. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts +19 -0
  29. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.d.ts.map +1 -0
  30. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js +85 -0
  31. package/lib/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.js.map +1 -0
  32. package/lib/components/lazy-text-editor/LazyTextEditor.js +1 -1
  33. package/lib/components/lazy-text-editor/LazyTextEditor.js.map +1 -1
  34. package/lib/index.css +1 -1
  35. package/lib/package.json +3 -1
  36. package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
  37. package/lib/stores/editor/EditorGraphState.js +4 -1
  38. package/lib/stores/editor/EditorGraphState.js.map +1 -1
  39. package/lib/stores/editor/EditorStore.d.ts +6 -2
  40. package/lib/stores/editor/EditorStore.d.ts.map +1 -1
  41. package/lib/stores/editor/EditorStore.js +21 -4
  42. package/lib/stores/editor/EditorStore.js.map +1 -1
  43. package/lib/stores/editor/EditorTabManagerState.d.ts +2 -1
  44. package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
  45. package/lib/stores/editor/EditorTabManagerState.js +6 -2
  46. package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
  47. package/lib/stores/editor/GraphEditFormModeState.d.ts +2 -1
  48. package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
  49. package/lib/stores/editor/GraphEditFormModeState.js +2 -2
  50. package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
  51. package/lib/stores/editor/GraphEditorMode.d.ts +2 -1
  52. package/lib/stores/editor/GraphEditorMode.d.ts.map +1 -1
  53. package/lib/stores/editor/GraphEditorMode.js.map +1 -1
  54. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.d.ts +30 -0
  55. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.d.ts.map +1 -0
  56. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.js +50 -0
  57. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.js.map +1 -0
  58. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.d.ts +2 -1
  59. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.d.ts.map +1 -1
  60. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js +1 -1
  61. package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
  62. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts +1 -0
  63. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.d.ts.map +1 -1
  64. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js +4 -0
  65. package/lib/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.js.map +1 -1
  66. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts +40 -0
  67. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.d.ts.map +1 -0
  68. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js +119 -0
  69. package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js.map +1 -0
  70. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts +2 -1
  71. package/lib/stores/editor/utils/ModelClassifierUtils.d.ts.map +1 -1
  72. package/lib/stores/editor/utils/ModelClassifierUtils.js +1 -0
  73. package/lib/stores/editor/utils/ModelClassifierUtils.js.map +1 -1
  74. package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts +29 -0
  75. package/lib/stores/ingestion/IngestDeploymentServerClient.d.ts.map +1 -0
  76. package/lib/stores/ingestion/IngestDeploymentServerClient.js +49 -0
  77. package/lib/stores/ingestion/IngestDeploymentServerClient.js.map +1 -0
  78. package/lib/stores/ingestion/IngestDiscoveryServerClient.d.ts +26 -0
  79. package/lib/stores/ingestion/IngestDiscoveryServerClient.d.ts.map +1 -0
  80. package/lib/stores/ingestion/IngestDiscoveryServerClient.js +35 -0
  81. package/lib/stores/ingestion/IngestDiscoveryServerClient.js.map +1 -0
  82. package/lib/stores/ingestion/IngestionDeploymentResponse.d.ts +40 -0
  83. package/lib/stores/ingestion/IngestionDeploymentResponse.d.ts.map +1 -0
  84. package/lib/stores/ingestion/IngestionDeploymentResponse.js +55 -0
  85. package/lib/stores/ingestion/IngestionDeploymentResponse.js.map +1 -0
  86. package/lib/stores/ingestion/IngestionManager.d.ts +35 -0
  87. package/lib/stores/ingestion/IngestionManager.d.ts.map +1 -0
  88. package/lib/stores/ingestion/IngestionManager.js +83 -0
  89. package/lib/stores/ingestion/IngestionManager.js.map +1 -0
  90. package/package.json +10 -8
  91. package/src/__lib__/LegendStudioNavigation.ts +14 -0
  92. package/src/application/LegendIngestionConfiguration.ts +94 -0
  93. package/src/application/LegendStudioApplicationConfig.ts +15 -0
  94. package/src/components/ElementIconUtils.tsx +3 -0
  95. package/src/components/LegendStudioWebApplication.tsx +29 -0
  96. package/src/components/editor/Editor.tsx +8 -3
  97. package/src/components/editor/editor-group/EditorGroup.tsx +4 -1
  98. package/src/components/editor/editor-group/function-activator/SnowflakeAppFunctionActivatorEditor.tsx +11 -0
  99. package/src/components/editor/editor-group/ingest-editor/IngestDefinitionEditor.tsx +214 -0
  100. package/src/components/lazy-text-editor/LazyTextEditor.tsx +1 -1
  101. package/src/stores/editor/EditorGraphState.ts +3 -0
  102. package/src/stores/editor/EditorStore.ts +39 -1
  103. package/src/stores/editor/EditorTabManagerState.ts +6 -0
  104. package/src/stores/editor/GraphEditFormModeState.ts +9 -2
  105. package/src/stores/editor/GraphEditorMode.ts +5 -1
  106. package/src/stores/editor/editor-state/element-editor-state/ElementEditorInitialConfiguration.ts +97 -0
  107. package/src/stores/editor/editor-state/element-editor-state/ElementEditorState.ts +6 -1
  108. package/src/stores/editor/editor-state/element-editor-state/function-activator/SnowflakeAppFunctionActivatorEditorState.ts +5 -0
  109. package/src/stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.ts +184 -0
  110. package/src/stores/editor/utils/ModelClassifierUtils.ts +1 -0
  111. package/src/stores/ingestion/IngestDeploymentServerClient.ts +83 -0
  112. package/src/stores/ingestion/IngestDiscoveryServerClient.ts +52 -0
  113. package/src/stores/ingestion/IngestionDeploymentResponse.ts +73 -0
  114. package/src/stores/ingestion/IngestionManager.ts +163 -0
  115. package/tsconfig.json +8 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IngestionManager.js","sourceRoot":"","sources":["../../../src/stores/ingestion/IngestionManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAsC,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAEL,kCAAkC,EAClC,wCAAwC,EACxC,6BAA6B,EAC7B,wCAAwC,GACzC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,4BAA4B,GAE7B,MAAM,mDAAmD,CAAC;AAE3D,MAAM,OAAO,gBAAgB;IACnB,2BAA2B,CAA8B;IACzD,4BAA4B,CAA+B;IAC3D,aAAa,CAAqB;IAClC,aAAa,CAAqB;IACzB,gBAAgB,CAAgC;IAEjE,YACE,MAAoC,EACpC,gBAA+C;QAE/C,IAAI,CAAC,2BAA2B,GAAG,IAAI,2BAA2B,CAChE,MAAM,CAAC,YAAY,CACpB,CAAC;QACF,IAAI,CAAC,2BAA2B,CAAC,gBAAgB,CAC/C,gBAAgB,CAAC,aAAa,CAC/B,CAAC;QACF,IAAI,CAAC,4BAA4B,GAAG,IAAI,4BAA4B,CAClE,MAAM,CAAC,UAAU,CAAC,aAAa,CAChC,CAAC;QACF,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,CAChD,gBAA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,CAAC,CAAC;QAC7D,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.18.124",
3
+ "version": "28.18.126",
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": "16.0.42",
49
- "@finos/legend-art": "7.1.96",
50
- "@finos/legend-code-editor": "2.0.69",
51
- "@finos/legend-data-cube": "0.2.1",
52
- "@finos/legend-graph": "32.1.27",
53
- "@finos/legend-lego": "2.0.74",
54
- "@finos/legend-query-builder": "4.16.35",
48
+ "@finos/legend-application": "16.0.44",
49
+ "@finos/legend-art": "7.1.98",
50
+ "@finos/legend-code-editor": "2.0.71",
51
+ "@finos/legend-data-cube": "0.2.3",
52
+ "@finos/legend-graph": "32.1.29",
53
+ "@finos/legend-lego": "2.0.76",
54
+ "@finos/legend-query-builder": "4.16.37",
55
55
  "@finos/legend-server-depot": "6.0.90",
56
56
  "@finos/legend-server-sdlc": "5.3.56",
57
57
  "@finos/legend-server-showcase": "0.2.52",
@@ -67,9 +67,11 @@
67
67
  "mobx-utils": "6.1.0",
68
68
  "monaco-editor": "0.52.2",
69
69
  "node-diff3": "3.1.2",
70
+ "oidc-client-ts": "^3.2.0",
70
71
  "react": "19.0.0",
71
72
  "react-dnd": "16.0.1",
72
73
  "react-dom": "19.0.0",
74
+ "react-oidc-context": "^3.3.0",
73
75
  "serializr": "3.0.3",
74
76
  "yaml": "2.7.0"
75
77
  },
@@ -19,6 +19,10 @@ import { WorkspaceType } from '@finos/legend-server-sdlc';
19
19
  import { guaranteeNonNullable } from '@finos/legend-shared';
20
20
  import { generatePath } from '@finos/legend-application/browser';
21
21
 
22
+ export enum LEGEND_STUDIO_QUERY_PARAMS {
23
+ EDITOR_CONFIG = 'editorConfig',
24
+ }
25
+
22
26
  export enum LEGEND_STUDIO_ROUTE_PATTERN_TOKEN {
23
27
  SHOWCASE_PATH = 'showcasePath',
24
28
  PROJECT_ID = 'projectId',
@@ -82,6 +86,10 @@ export type ShowcaseViewerPathParams = {
82
86
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.SHOWCASE_PATH]?: string;
83
87
  };
84
88
 
89
+ export type StudioQueryParams = {
90
+ [LEGEND_STUDIO_QUERY_PARAMS.EDITOR_CONFIG]?: string;
91
+ };
92
+
85
93
  export type WorkspaceEditorPathParams = {
86
94
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PROJECT_ID]: string;
87
95
  [LEGEND_STUDIO_ROUTE_PATTERN_TOKEN.PATCH_RELEASE_VERSION_ID]?: string;
@@ -349,3 +357,9 @@ export const generateShowcasePath = (showcasePath: string): string =>
349
357
  generatePath(LEGEND_STUDIO_SDLC_BYPASSED_ROUTE_PATTERN.SHOWCASE, {
350
358
  showcasePath: encodeURIComponent(showcasePath),
351
359
  });
360
+
361
+ export const EXTERNAL_APPLICATION_NAVIGATION__generateUrlWithEditorConfig = (
362
+ base: string,
363
+ editorConfig: string,
364
+ ): string =>
365
+ `${base}?${LEGEND_STUDIO_QUERY_PARAMS.EDITOR_CONFIG}=${encodeURIComponent(editorConfig)}`;
@@ -0,0 +1,94 @@
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 {
18
+ assertNonEmptyString,
19
+ SerializationFactory,
20
+ usingModelSchema,
21
+ } from '@finos/legend-shared';
22
+ import type { AuthProviderProps } from 'react-oidc-context';
23
+ import { createModelSchema, primitive, raw } from 'serializr';
24
+
25
+ export class IngestDeploymentOIDC {
26
+ redirectPath!: string;
27
+ silentRedirectPath!: string;
28
+ authProviderProps!: AuthProviderProps;
29
+
30
+ static readonly serialization = new SerializationFactory(
31
+ createModelSchema(IngestDeploymentOIDC, {
32
+ redirectPath: primitive(),
33
+ silentRedirectPath: primitive(),
34
+ authProviderProps: raw(),
35
+ }),
36
+ );
37
+ }
38
+
39
+ export class IngestDeploymentServerConfig {
40
+ environmentClassification!: string;
41
+ ingestServerUrl!: string;
42
+
43
+ static readonly serialization = new SerializationFactory(
44
+ createModelSchema(IngestDeploymentServerConfig, {
45
+ environmentClassification: primitive(),
46
+ ingestServerUrl: primitive(),
47
+ }),
48
+ );
49
+ }
50
+
51
+ export class IngestionDeploymentConfiguration {
52
+ oidcConfig!: IngestDeploymentOIDC;
53
+ defaultServer!: IngestDeploymentServerConfig;
54
+
55
+ static readonly serialization = new SerializationFactory(
56
+ createModelSchema(IngestionDeploymentConfiguration, {
57
+ oidcConfig: usingModelSchema(IngestDeploymentOIDC.serialization.schema),
58
+ defaultServer: usingModelSchema(
59
+ IngestDeploymentServerConfig.serialization.schema,
60
+ ),
61
+ }),
62
+ );
63
+ }
64
+
65
+ export class LegendIngestionConfiguration {
66
+ discoveryUrl!: string;
67
+ deployment!: IngestionDeploymentConfiguration;
68
+
69
+ static readonly serialization = new SerializationFactory(
70
+ createModelSchema(LegendIngestionConfiguration, {
71
+ discoveryUrl: primitive(),
72
+ deployment: usingModelSchema(
73
+ IngestionDeploymentConfiguration.serialization.schema,
74
+ ),
75
+ }),
76
+ );
77
+ }
78
+
79
+ export const validateIngestionDeploymentConfiguration = (
80
+ config: LegendIngestionConfiguration,
81
+ ): void => {
82
+ assertNonEmptyString(
83
+ config.deployment.defaultServer.environmentClassification,
84
+ 'Ingestion deployment server environment classification is missing',
85
+ );
86
+ assertNonEmptyString(
87
+ config.deployment.defaultServer.ingestServerUrl,
88
+ 'Ingestion deployment server URL is missing',
89
+ );
90
+ assertNonEmptyString(
91
+ config.discoveryUrl,
92
+ 'Ingestion discovery URL is missing',
93
+ );
94
+ };
@@ -35,6 +35,10 @@ import {
35
35
  type LegendApplicationConfigurationData,
36
36
  } from '@finos/legend-application';
37
37
  import { QueryBuilderConfig } from '@finos/legend-query-builder';
38
+ import {
39
+ LegendIngestionConfiguration,
40
+ validateIngestionDeploymentConfiguration,
41
+ } from './LegendIngestionConfiguration.js';
38
42
 
39
43
  export class ServiceRegistrationEnvironmentConfig {
40
44
  env!: string;
@@ -106,6 +110,8 @@ class LegendStudioApplicationCoreOptions {
106
110
  */
107
111
  queryBuilderConfig: QueryBuilderConfig | undefined;
108
112
 
113
+ ingestDeploymentConfig: LegendIngestionConfiguration | undefined;
114
+
109
115
  private static readonly serialization = new SerializationFactory(
110
116
  createModelSchema(LegendStudioApplicationCoreOptions, {
111
117
  enableGraphBuilderStrictMode: optional(primitive()),
@@ -120,6 +126,9 @@ class LegendStudioApplicationCoreOptions {
120
126
  queryBuilderConfig: optional(
121
127
  usingModelSchema(QueryBuilderConfig.serialization.schema),
122
128
  ),
129
+ ingestDeploymentConfig: optional(
130
+ usingModelSchema(LegendIngestionConfiguration.serialization.schema),
131
+ ),
123
132
  }),
124
133
  );
125
134
 
@@ -229,6 +238,12 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
229
238
  this.options = LegendStudioApplicationCoreOptions.create(
230
239
  input.configData.extensions?.core ?? {},
231
240
  );
241
+
242
+ if (this.options.ingestDeploymentConfig) {
243
+ validateIngestionDeploymentConfiguration(
244
+ this.options.ingestDeploymentConfig,
245
+ );
246
+ }
232
247
  }
233
248
 
234
249
  override getDefaultApplicationStorageKey(): string {
@@ -45,6 +45,7 @@ import {
45
45
  LaunchIcon,
46
46
  LinkIcon,
47
47
  PURE_DataProductIcon,
48
+ PURE_IngestIcon,
48
49
  } from '@finos/legend-art';
49
50
  import { PACKAGEABLE_ELEMENT_TYPE } from '../stores/editor/utils/ModelClassifierUtils.js';
50
51
 
@@ -105,6 +106,8 @@ export const getElementTypeIcon = (
105
106
  return <PURE_GenerationSpecificationIcon />;
106
107
  case PACKAGEABLE_ELEMENT_TYPE.SNOWFLAKE_APP:
107
108
  return <PURE_SnowflakeAppIcon />;
109
+ case PACKAGEABLE_ELEMENT_TYPE.INGEST_DEFINITION:
110
+ return <PURE_IngestIcon />;
108
111
  default: {
109
112
  if (type) {
110
113
  const extraElementIconGetters = editorStore.pluginManager
@@ -42,6 +42,8 @@ import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../__lib__/LegendStudioDocument
42
42
  import { LazyTextEditor } from './lazy-text-editor/LazyTextEditor.js';
43
43
  import { PureCompatibilityTestManager } from './pct/PureCompatibilityTest.js';
44
44
  import { ShowcaseViewer } from './showcase/ShowcaseViewer.js';
45
+ import { AuthProvider, type AuthProviderProps } from 'react-oidc-context';
46
+ import type { User } from 'oidc-client-ts';
45
47
 
46
48
  const NotFoundPage = observer(() => {
47
49
  const applicationStore = useApplicationStore();
@@ -287,6 +289,33 @@ export const LegendStudioWebApplication = observer(
287
289
  (props: { baseUrl: string }) => {
288
290
  const { baseUrl } = props;
289
291
 
292
+ const applicationStore = useLegendStudioApplicationStore();
293
+ const oidcConfig =
294
+ applicationStore.config.options.ingestDeploymentConfig?.deployment
295
+ .oidcConfig;
296
+ if (oidcConfig) {
297
+ const onSigninCallback = (_user: User | undefined) => {
298
+ window.location.href = (_user?.state as string | undefined) ?? '/';
299
+ };
300
+
301
+ const mergedOIDCConfig: AuthProviderProps = {
302
+ ...oidcConfig.authProviderProps,
303
+ redirect_uri: `${window.location.origin}${oidcConfig.redirectPath}`,
304
+ silent_redirect_uri: `${window.location.origin}${oidcConfig.silentRedirectPath}`,
305
+ onSigninCallback,
306
+ };
307
+
308
+ return (
309
+ <AuthProvider {...mergedOIDCConfig}>
310
+ <BrowserEnvironmentProvider baseUrl={baseUrl}>
311
+ <LegendStudioFrameworkProvider>
312
+ <LegendStudioWebApplicationRouter />
313
+ </LegendStudioFrameworkProvider>
314
+ </BrowserEnvironmentProvider>
315
+ </AuthProvider>
316
+ );
317
+ }
318
+
290
319
  return (
291
320
  <BrowserEnvironmentProvider baseUrl={baseUrl}>
292
321
  <LegendStudioFrameworkProvider>
@@ -35,7 +35,10 @@ import { GrammarTextEditor } from './editor-group/GrammarTextEditor.js';
35
35
  import { StatusBar } from './StatusBar.js';
36
36
  import { ActivityBar } from './ActivityBar.js';
37
37
  import { ShowcaseSideBar } from './ShowcaseSideBar.js';
38
- import type { WorkspaceEditorPathParams } from '../../__lib__/LegendStudioNavigation.js';
38
+ import type {
39
+ StudioQueryParams,
40
+ WorkspaceEditorPathParams,
41
+ } from '../../__lib__/LegendStudioNavigation.js';
39
42
  import { ProjectSearchCommand } from '../editor/command-center/ProjectSearchCommand.js';
40
43
  import { guaranteeNonNullable, isNonNullable } from '@finos/legend-shared';
41
44
  import { flowResult } from 'mobx';
@@ -70,6 +73,8 @@ export const Editor = withEditorStore(
70
73
  `Workspace/group workspace ID is not provided`,
71
74
  );
72
75
  const editorStore = useEditorStore();
76
+ const studioParams =
77
+ editorStore.applicationStore.navigationService.navigator.getCurrentLocationParameters<StudioQueryParams>();
73
78
  const applicationStore = useApplicationStore();
74
79
  const editable =
75
80
  editorStore.graphManagerState.graphBuildState.hasCompleted &&
@@ -146,8 +151,8 @@ export const Editor = withEditorStore(
146
151
 
147
152
  // initialize
148
153
  useEffect(() => {
149
- editorStore.internalizeEntityPath(params);
150
- }, [editorStore, params]);
154
+ editorStore.internalizeEntityPath(params, studioParams);
155
+ }, [editorStore, params, studioParams]);
151
156
 
152
157
  useEffect(() => {
153
158
  flowResult(
@@ -90,6 +90,8 @@ import { HostedServiceFunctionActivatorEditorState } from '../../../stores/edito
90
90
  import { HostedServiceFunctionActivatorEditor } from './function-activator/HostedServiceFunctionActivatorEditor.js';
91
91
  import { DataProductEditorState } from '../../../stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js';
92
92
  import { DataProductEditor } from './dataProduct/DataPoductEditor.js';
93
+ import { IngestDefinitionEditorState } from '../../../stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js';
94
+ import { IngestDefinitionEditor } from './ingest-editor/IngestDefinitionEditor.js';
93
95
 
94
96
  export const ViewerEditorGroupSplashScreen: React.FC = () => {
95
97
  const commandListWidth = 300;
@@ -238,7 +240,6 @@ export const EditorGroup = observer(() => {
238
240
  .map((e) => e.name.toLowerCase())
239
241
  .includes(file.key.toLowerCase()),
240
242
  );
241
-
242
243
  const renderActiveElementTab = (): React.ReactNode => {
243
244
  if (currentTabState instanceof ElementEditorState) {
244
245
  const generationViewState = currentTabState.generationModeState;
@@ -274,6 +275,8 @@ export const EditorGroup = observer(() => {
274
275
  return <FunctionEditor key={currentTabState.uuid} />;
275
276
  } else if (currentTabState instanceof MappingEditorState) {
276
277
  return <MappingEditor key={currentTabState.uuid} />;
278
+ } else if (currentTabState instanceof IngestDefinitionEditorState) {
279
+ return <IngestDefinitionEditor key={currentTabState.uuid} />;
277
280
  } else if (currentTabState instanceof ServiceEditorState) {
278
281
  return <ServiceEditor key={currentTabState.uuid} />;
279
282
  } else if (currentTabState instanceof DataProductEditorState) {
@@ -302,6 +302,17 @@ export const SnowflakeAppFunctionActivatorEditor = observer(() => {
302
302
  }
303
303
  />
304
304
  </PanelForm>
305
+ <PanelForm>
306
+ <PanelFormTextField
307
+ value={activator.deploymentSchema}
308
+ isReadOnly={isReadOnly}
309
+ name="Deployment Schema"
310
+ placeholder="Specify the deployment schema (optional)"
311
+ update={(value: string | undefined): void =>
312
+ editorState.updateDeploymentSchema(value)
313
+ }
314
+ />
315
+ </PanelForm>
305
316
  <PanelForm>
306
317
  <div className="panel__content__form__section">
307
318
  <div className="panel__content__form__section__header__label">
@@ -0,0 +1,214 @@
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 { useEditorStore } from '../../EditorStoreProvider.js';
19
+ import {
20
+ Dialog,
21
+ Modal,
22
+ ModalBody,
23
+ ModalFooter,
24
+ ModalFooterButton,
25
+ ModalHeader,
26
+ ModalTitle,
27
+ PanelContent,
28
+ PanelHeader,
29
+ PanelHeaderActions,
30
+ RocketIcon,
31
+ } from '@finos/legend-art';
32
+ import {
33
+ generateUrlToDeployOnOpen,
34
+ IngestDefinitionEditorState,
35
+ } from '../../../../stores/editor/editor-state/element-editor-state/ingest/IngestDefinitionEditorState.js';
36
+ import { CodeEditor } from '@finos/legend-lego/code-editor';
37
+ import { useEffect } from 'react';
38
+ import { CODE_EDITOR_LANGUAGE } from '@finos/legend-code-editor';
39
+ import { flowResult } from 'mobx';
40
+ import { useAuth } from 'react-oidc-context';
41
+
42
+ const IngestDepoymentModal = observer(
43
+ (props: { state: IngestDefinitionEditorState }) => {
44
+ const { state } = props;
45
+ const applicationStore = state.editorStore.applicationStore;
46
+ return (
47
+ <Dialog
48
+ open={state.deploymentState.isInProgress}
49
+ classes={{ container: 'search-modal__container' }}
50
+ >
51
+ <Modal
52
+ darkMode={
53
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
54
+ }
55
+ className="database-builder"
56
+ >
57
+ <ModalHeader>
58
+ <ModalTitle title="Deploy Ingestion" />
59
+ </ModalHeader>
60
+ <ModalBody>
61
+ <div>{state.deploymentState.message}</div>
62
+ </ModalBody>
63
+ </Modal>
64
+ </Dialog>
65
+ );
66
+ },
67
+ );
68
+
69
+ const IngestValidationError = observer(
70
+ (props: { state: IngestDefinitionEditorState }) => {
71
+ const { state } = props;
72
+ const applicationStore = state.editorStore.applicationStore;
73
+ const validationError = state.validationError;
74
+ if (!validationError) {
75
+ return null;
76
+ }
77
+ const closeModal = (): void => state.setValError(undefined);
78
+ return (
79
+ <Dialog
80
+ open={Boolean(state.validationError)}
81
+ classes={{
82
+ root: 'editor-modal__root-container',
83
+ container: 'editor-modal__container',
84
+ paper: 'editor-modal__content',
85
+ }}
86
+ onClose={closeModal}
87
+ >
88
+ <Modal
89
+ darkMode={
90
+ !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled
91
+ }
92
+ className="editor-modal"
93
+ >
94
+ <ModalHeader>
95
+ <ModalTitle title="Validation Error" />
96
+ </ModalHeader>
97
+ <ModalBody>
98
+ <PanelContent>
99
+ <CodeEditor
100
+ inputValue={JSON.stringify(
101
+ state.validationError ?? {},
102
+ null,
103
+ 2,
104
+ )}
105
+ isReadOnly={true}
106
+ language={CODE_EDITOR_LANGUAGE.JSON}
107
+ />
108
+ </PanelContent>
109
+ </ModalBody>
110
+ <ModalFooter>
111
+ <ModalFooterButton
112
+ onClick={closeModal}
113
+ text="Close"
114
+ type="secondary"
115
+ />
116
+ </ModalFooter>
117
+ </Modal>
118
+ </Dialog>
119
+ );
120
+ },
121
+ );
122
+
123
+ export const IngestDefinitionEditor = observer(() => {
124
+ const editorStore = useEditorStore();
125
+ const ingestDefinitionEditorState =
126
+ editorStore.tabManagerState.getCurrentEditorState(
127
+ IngestDefinitionEditorState,
128
+ );
129
+ const ingestDef = ingestDefinitionEditorState.ingest;
130
+ const auth = useAuth();
131
+
132
+ const deployIngest = (): void => {
133
+ // Trigger OAuth flow if not authenticated
134
+ if (!auth.isAuthenticated) {
135
+ // remove this redirect if we move to do oauth at the beginning of opening studio
136
+ auth
137
+ .signinRedirect({
138
+ state: generateUrlToDeployOnOpen(ingestDefinitionEditorState),
139
+ })
140
+ .catch(editorStore.applicationStore.alertUnhandledError);
141
+ return;
142
+ }
143
+ // Use the token for deployment
144
+ const token = auth.user?.access_token;
145
+ if (token) {
146
+ flowResult(ingestDefinitionEditorState.deploy(token)).catch(
147
+ editorStore.applicationStore.alertUnhandledError,
148
+ );
149
+ } else {
150
+ editorStore.applicationStore.notificationService.notifyError(
151
+ 'Authentication failed. No token available.',
152
+ );
153
+ }
154
+ };
155
+
156
+ const isValid = ingestDefinitionEditorState.validForDeployment;
157
+ useEffect(() => {
158
+ ingestDefinitionEditorState.generateElementGrammar();
159
+ }, [ingestDefinitionEditorState]);
160
+
161
+ useEffect(() => {
162
+ if (ingestDefinitionEditorState.deployOnOpen) {
163
+ flowResult(ingestDefinitionEditorState.init_with_deploy(auth)).catch(
164
+ editorStore.applicationStore.alertUnhandledError,
165
+ );
166
+ }
167
+ }, [
168
+ auth,
169
+ editorStore.applicationStore.alertUnhandledError,
170
+ ingestDefinitionEditorState,
171
+ ]);
172
+
173
+ return (
174
+ <div className="data-product-editor">
175
+ <PanelHeader
176
+ title="Ingest"
177
+ titleContent={ingestDef.name}
178
+ darkMode={true}
179
+ isReadOnly={true}
180
+ ></PanelHeader>
181
+ <PanelContent>
182
+ <PanelHeader title="deployment" darkMode={true}>
183
+ <PanelHeaderActions>
184
+ <div className="btn__dropdown-combo btn__dropdown-combo--primary">
185
+ <button
186
+ className="btn__dropdown-combo__label"
187
+ onClick={deployIngest}
188
+ title={ingestDefinitionEditorState.validationMessage}
189
+ tabIndex={-1}
190
+ disabled={!isValid}
191
+ >
192
+ <RocketIcon className="btn__dropdown-combo__label__icon" />
193
+ <div className="btn__dropdown-combo__label__title">Deploy</div>
194
+ </button>
195
+ </div>
196
+ </PanelHeaderActions>
197
+ </PanelHeader>
198
+ <PanelContent>
199
+ <CodeEditor
200
+ inputValue={ingestDefinitionEditorState.textContent}
201
+ isReadOnly={true}
202
+ language={CODE_EDITOR_LANGUAGE.PURE}
203
+ />
204
+ </PanelContent>
205
+ {ingestDefinitionEditorState.deploymentState.isInProgress && (
206
+ <IngestDepoymentModal state={ingestDefinitionEditorState} />
207
+ )}
208
+ {ingestDefinitionEditorState.validationError && (
209
+ <IngestValidationError state={ingestDefinitionEditorState} />
210
+ )}
211
+ </PanelContent>
212
+ </div>
213
+ );
214
+ });
@@ -365,7 +365,7 @@ export const LazyTextEditor = withEditorStore(
365
365
 
366
366
  // initialize
367
367
  useEffect(() => {
368
- editorStore.internalizeEntityPath(params);
368
+ editorStore.internalizeEntityPath(params, undefined);
369
369
  }, [editorStore, params]);
370
370
 
371
371
  useEffect(() => {
@@ -91,6 +91,7 @@ import {
91
91
  GraphEntities,
92
92
  HostedService,
93
93
  DataProduct,
94
+ IngestDefinition,
94
95
  } from '@finos/legend-graph';
95
96
  import { CONFIGURATION_EDITOR_TAB } from './editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js';
96
97
  import { PACKAGEABLE_ELEMENT_TYPE } from './utils/ModelClassifierUtils.js';
@@ -857,6 +858,8 @@ export class EditorGraphState {
857
858
  return PACKAGEABLE_ELEMENT_TYPE.HOSTED_SERVICE;
858
859
  } else if (element instanceof DataProduct) {
859
860
  return PACKAGEABLE_ELEMENT_TYPE._DATA_PRODUCT;
861
+ } else if (element instanceof IngestDefinition) {
862
+ return PACKAGEABLE_ELEMENT_TYPE.INGEST_DEFINITION;
860
863
  }
861
864
  const extraElementTypeLabelGetters = this.editorStore.pluginManager
862
865
  .getApplicationPlugins()