@finos/legend-extension-dsl-data-space-studio 0.1.152 → 0.1.154

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 (75) hide show
  1. package/lib/components/DSL_DataProduct_ElementDriver.d.ts +27 -0
  2. package/lib/components/DSL_DataProduct_ElementDriver.d.ts.map +1 -0
  3. package/lib/components/DSL_DataProduct_ElementDriver.js +60 -0
  4. package/lib/components/DSL_DataProduct_ElementDriver.js.map +1 -0
  5. package/lib/components/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts +3 -1
  6. package/lib/components/DSL_DataSpace_LegendStudioApplicationPlugin.d.ts.map +1 -1
  7. package/lib/components/DSL_DataSpace_LegendStudioApplicationPlugin.js +30 -15
  8. package/lib/components/DSL_DataSpace_LegendStudioApplicationPlugin.js.map +1 -1
  9. package/lib/components/DSL_NewDataProductEditor.d.ts +19 -0
  10. package/lib/components/DSL_NewDataProductEditor.d.ts.map +1 -0
  11. package/lib/components/DSL_NewDataProductEditor.js +32 -0
  12. package/lib/components/DSL_NewDataProductEditor.js.map +1 -0
  13. package/lib/components/DataSpaceEditor.d.ts +1 -1
  14. package/lib/components/DataSpaceEditor.d.ts.map +1 -1
  15. package/lib/components/DataSpaceEditor.js +18 -9
  16. package/lib/components/DataSpaceEditor.js.map +1 -1
  17. package/lib/components/DataSpaceExecutionContextEditor.d.ts +37 -0
  18. package/lib/components/DataSpaceExecutionContextEditor.d.ts.map +1 -0
  19. package/lib/components/DataSpaceExecutionContextEditor.js +170 -0
  20. package/lib/components/DataSpaceExecutionContextEditor.js.map +1 -0
  21. package/lib/components/DataSpaceGeneralEditor/DataSpaceDefaultExecutionContextSection.d.ts +19 -0
  22. package/lib/components/DataSpaceGeneralEditor/DataSpaceDefaultExecutionContextSection.d.ts.map +1 -0
  23. package/lib/components/DataSpaceGeneralEditor/DataSpaceDefaultExecutionContextSection.js +138 -0
  24. package/lib/components/DataSpaceGeneralEditor/DataSpaceDefaultExecutionContextSection.js.map +1 -0
  25. package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.d.ts +19 -0
  26. package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.d.ts.map +1 -0
  27. package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.js +63 -0
  28. package/lib/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.js.map +1 -0
  29. package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.d.ts +19 -0
  30. package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.d.ts.map +1 -0
  31. package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.js +58 -0
  32. package/lib/components/DataSpaceGeneralEditor/DataSpaceElementsSection.js.map +1 -0
  33. package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.d.ts +19 -0
  34. package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.d.ts.map +1 -0
  35. package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.js +56 -0
  36. package/lib/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.js.map +1 -0
  37. package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.d.ts +19 -0
  38. package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.d.ts.map +1 -0
  39. package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.js +40 -0
  40. package/lib/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.js.map +1 -0
  41. package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.d.ts +19 -0
  42. package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.d.ts.map +1 -0
  43. package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.js +120 -0
  44. package/lib/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.js.map +1 -0
  45. package/lib/index.css +2 -2
  46. package/lib/index.css.map +1 -1
  47. package/lib/package.json +3 -2
  48. package/lib/stores/DataSpaceEditorState.d.ts +18 -2
  49. package/lib/stores/DataSpaceEditorState.d.ts.map +1 -1
  50. package/lib/stores/DataSpaceEditorState.js +55 -3
  51. package/lib/stores/DataSpaceEditorState.js.map +1 -1
  52. package/lib/stores/DataSpaceExecutionContextState.d.ts +37 -0
  53. package/lib/stores/DataSpaceExecutionContextState.d.ts.map +1 -0
  54. package/lib/stores/DataSpaceExecutionContextState.js +87 -0
  55. package/lib/stores/DataSpaceExecutionContextState.js.map +1 -0
  56. package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.d.ts +34 -3
  57. package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.d.ts.map +1 -1
  58. package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.js +128 -2
  59. package/lib/stores/studio/DSL_DataSpace_GraphModifierHelper.js.map +1 -1
  60. package/package.json +10 -9
  61. package/src/components/DSL_DataProduct_ElementDriver.tsx +82 -0
  62. package/src/components/DSL_DataSpace_LegendStudioApplicationPlugin.tsx +35 -19
  63. package/src/components/DSL_NewDataProductEditor.tsx +57 -0
  64. package/src/components/DataSpaceEditor.tsx +54 -33
  65. package/src/components/DataSpaceExecutionContextEditor.tsx +692 -0
  66. package/src/components/DataSpaceGeneralEditor/DataSpaceDefaultExecutionContextSection.tsx +393 -0
  67. package/src/components/DataSpaceGeneralEditor/DataSpaceDiagramsSection.tsx +144 -0
  68. package/src/components/DataSpaceGeneralEditor/DataSpaceElementsSection.tsx +128 -0
  69. package/src/components/DataSpaceGeneralEditor/DataSpaceExecutablesSection.tsx +108 -0
  70. package/src/components/DataSpaceGeneralEditor/DataSpaceGeneralEditor.tsx +76 -0
  71. package/src/components/DataSpaceGeneralEditor/DataSpaceSupportInfoSection.tsx +276 -0
  72. package/src/stores/DataSpaceEditorState.ts +92 -4
  73. package/src/stores/DataSpaceExecutionContextState.ts +135 -0
  74. package/src/stores/studio/DSL_DataSpace_GraphModifierHelper.ts +278 -3
  75. package/tsconfig.json +11 -1
@@ -0,0 +1,27 @@
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
+ import { type EditorStore, NewElementDriver } from '@finos/legend-application-studio';
17
+ import { DataSpace } from '@finos/legend-extension-dsl-data-space/graph';
18
+ export declare class NewDataProductDriver extends NewElementDriver<DataSpace> {
19
+ title: string | undefined;
20
+ description: string | undefined;
21
+ constructor(editorStore: EditorStore);
22
+ setTitle(value: string | undefined): void;
23
+ setDescription(value: string | undefined): void;
24
+ get isValid(): boolean;
25
+ createElement(name: string): DataSpace;
26
+ }
27
+ //# sourceMappingURL=DSL_DataProduct_ElementDriver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_DataProduct_ElementDriver.d.ts","sourceRoot":"","sources":["../../src/components/DSL_DataProduct_ElementDriver.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,WAAW,EAChB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,SAAS,EAGV,MAAM,8CAA8C,CAAC;AAatD,qBAAa,oBAAqB,SAAQ,gBAAgB,CAAC,SAAS,CAAC;IACnE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEpB,WAAW,EAAE,WAAW;IAcpC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAIzC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAI/C,IAAa,OAAO,IAAI,OAAO,CAE9B;IACQ,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS;CAehD"}
@@ -0,0 +1,60 @@
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
+ import { NewElementDriver, } from '@finos/legend-application-studio';
17
+ import { DataSpace, DataSpaceExecutionContext, DataSpaceSupportCombinedInfo, } from '@finos/legend-extension-dsl-data-space/graph';
18
+ import { PackageableElementExplicitReference, stub_Mapping, stub_PackageableRuntime, } from '@finos/legend-graph';
19
+ import { action, makeObservable, observable } from 'mobx';
20
+ import { dataSpace_setDescription, dataSpace_setSupportInfo, dataSpace_setTitle, } from '../stores/studio/DSL_DataSpace_GraphModifierHelper.js';
21
+ export class NewDataProductDriver extends NewElementDriver {
22
+ title;
23
+ description;
24
+ constructor(editorStore) {
25
+ super(editorStore);
26
+ makeObservable(this, {
27
+ title: observable,
28
+ description: observable,
29
+ setTitle: action,
30
+ setDescription: action,
31
+ });
32
+ this.title = '';
33
+ this.description = '';
34
+ }
35
+ setTitle(value) {
36
+ this.title = value;
37
+ }
38
+ setDescription(value) {
39
+ this.description = value;
40
+ }
41
+ get isValid() {
42
+ return Boolean(this.title && this.description);
43
+ }
44
+ createElement(name) {
45
+ const dataSpace = new DataSpace(name);
46
+ const dataSpaceExecutionContext = new DataSpaceExecutionContext();
47
+ dataSpaceExecutionContext.name = 'defaultContext';
48
+ dataSpaceExecutionContext.mapping =
49
+ PackageableElementExplicitReference.create(stub_Mapping());
50
+ dataSpaceExecutionContext.defaultRuntime =
51
+ PackageableElementExplicitReference.create(stub_PackageableRuntime());
52
+ dataSpace.executionContexts = [dataSpaceExecutionContext];
53
+ dataSpace.defaultExecutionContext = dataSpaceExecutionContext;
54
+ dataSpace_setTitle(dataSpace, this.title);
55
+ dataSpace_setDescription(dataSpace, this.description);
56
+ dataSpace_setSupportInfo(dataSpace, new DataSpaceSupportCombinedInfo());
57
+ return dataSpace;
58
+ }
59
+ }
60
+ //# sourceMappingURL=DSL_DataProduct_ElementDriver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_DataProduct_ElementDriver.js","sourceRoot":"","sources":["../../src/components/DSL_DataProduct_ElementDriver.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,gBAAgB,GACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,mCAAmC,EACnC,YAAY,EACZ,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1D,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,uDAAuD,CAAC;AAE/D,MAAM,OAAO,oBAAqB,SAAQ,gBAA2B;IACnE,KAAK,CAAqB;IAC1B,WAAW,CAAqB;IAEhC,YAAY,WAAwB;QAClC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEnB,cAAc,CAAC,IAAI,EAAE;YACnB,KAAK,EAAE,UAAU;YACjB,WAAW,EAAE,UAAU;YACvB,QAAQ,EAAE,MAAM;YAChB,cAAc,EAAE,MAAM;SACvB,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,QAAQ,CAAC,KAAyB;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,cAAc,CAAC,KAAyB;QACtC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAa,OAAO;QAClB,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;IACjD,CAAC;IACQ,aAAa,CAAC,IAAY;QACjC,MAAM,SAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,EAAE,CAAC;QAClE,yBAAyB,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAClD,yBAAyB,CAAC,OAAO;YAC/B,mCAAmC,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;QAC7D,yBAAyB,CAAC,cAAc;YACtC,mCAAmC,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,CAAC;QACxE,SAAS,CAAC,iBAAiB,GAAG,CAAC,yBAAyB,CAAC,CAAC;QAC1D,SAAS,CAAC,uBAAuB,GAAG,yBAAyB,CAAC;QAC9D,kBAAkB,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1C,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACtD,wBAAwB,CAAC,SAAS,EAAE,IAAI,4BAA4B,EAAE,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { type NewElementFromStateCreator, type ElementClassifier, type DragElementClassifier, type ElementIconGetter, type DSL_LegendStudioApplicationPlugin_Extension, type ElementEditorStateCreator, type ElementEditorState, type PureGrammarParserElementDocumentationGetter, type PureGrammarParserDocumentationGetter, type PureGrammarParserKeywordSuggestionGetter, type PureGrammarParserElementSnippetSuggestionsGetter, LegendStudioApplicationPlugin, type ExplorerContextMenuItemRendererConfiguration, type EditorExtensionStateBuilder, type EditorExtensionComponentRendererConfiguration } from '@finos/legend-application-studio';
16
+ import { type NewElementFromStateCreator, type ElementClassifier, type DragElementClassifier, type ElementIconGetter, type DSL_LegendStudioApplicationPlugin_Extension, type ElementEditorStateCreator, type ElementEditorState, type PureGrammarParserElementDocumentationGetter, type PureGrammarParserDocumentationGetter, type PureGrammarParserKeywordSuggestionGetter, type PureGrammarParserElementSnippetSuggestionsGetter, LegendStudioApplicationPlugin, type ExplorerContextMenuItemRendererConfiguration, type EditorExtensionStateBuilder, type EditorExtensionComponentRendererConfiguration, type NewElementDriverEditorRenderer, type NewElementDriverCreator } from '@finos/legend-application-studio';
17
17
  import { type ElementObserver } from '@finos/legend-graph';
18
18
  import type { ApplicationPageEntry } from '@finos/legend-application';
19
19
  export declare class DSL_DataSpace_LegendStudioApplicationPlugin extends LegendStudioApplicationPlugin implements DSL_LegendStudioApplicationPlugin_Extension {
@@ -29,6 +29,8 @@ export declare class DSL_DataSpace_LegendStudioApplicationPlugin extends LegendS
29
29
  getExtraElementClassifiers(): ElementClassifier[];
30
30
  getExtraElementIconGetters(): ElementIconGetter[];
31
31
  getExtraNewElementFromStateCreators(): NewElementFromStateCreator[];
32
+ getExtraNewElementDriverEditorRenderers(): NewElementDriverEditorRenderer[];
33
+ getExtraNewElementDriverCreators(): NewElementDriverCreator[];
32
34
  getExtraElementEditorRenderers(): ((editorState: ElementEditorState) => React.ReactNode)[];
33
35
  getExtraElementEditorStateCreators(): ElementEditorStateCreator[];
34
36
  getExtraElementObservers(): ElementObserver[];
@@ -1 +1 @@
1
- {"version":3,"file":"DSL_DataSpace_LegendStudioApplicationPlugin.d.ts","sourceRoot":"","sources":["../../src/components/DSL_DataSpace_LegendStudioApplicationPlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,KAAK,0BAA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AAI,wCAAwC,EAAE;IAgB/F,yDAAyD,IAAI,gDAAgD,EAAE;CAgBhH"}
1
+ {"version":3,"file":"DSL_DataSpace_LegendStudioApplicationPlugin.d.ts","sourceRoot":"","sources":["../../src/components/DSL_DataSpace_LegendStudioApplicationPlugin.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,2CAA2C,EAEhD,KAAK,yBAAyB,EAE9B,KAAK,kBAAkB,EACvB,KAAK,2CAA2C,EAChD,KAAK,oCAAoC,EACzC,KAAK,wCAAwC,EAC7C,KAAK,gDAAgD,EACrD,6BAA6B,EAC7B,KAAK,4CAA4C,EACjD,KAAK,2BAA2B,EAChC,KAAK,6CAA6C,EAElD,KAAK,8BAA8B,EACnC,KAAK,uBAAuB,EAE7B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAiCtE,qBAAa,2CACX,SAAQ,6BACR,YAAW,2CAA2C;;IAM7C,iCAAiC,IAAI,MAAM,EAAE;IAO7C,8BAA8B,IAAI,oBAAoB,EAAE;IAYxD,qDAAqD,IAAI,4CAA4C,EAAE;IAuBvG,oCAAoC,IAAI,2BAA2B,EAAE;IAIrE,sDAAsD,IAAI,6CAA6C,EAAE;IASlH,2BAA2B,IAAI,MAAM,EAAE;IAIvC,6BAA6B,IAAI,MAAM,EAAE;IAIzC,yCAAyC,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IASnE,0BAA0B,IAAI,iBAAiB,EAAE;IAWjD,0BAA0B,IAAI,iBAAiB,EAAE;IAWjD,mCAAmC,IAAI,0BAA0B,EAAE;IAiBnE,uCAAuC,IAAI,8BAA8B,EAAE;IAW3E,gCAAgC,IAAI,uBAAuB,EAAE;IAc7D,8BAA8B,IAAI,CAAC,CACjC,WAAW,EAAE,kBAAkB,KAC5B,KAAK,CAAC,SAAS,CAAC,EAAE;IAWvB,kCAAkC,IAAI,yBAAyB,EAAE;IAejE,wBAAwB,IAAI,eAAe,EAAE;IAW7C,8BAA8B,IAAI,qBAAqB,EAAE;IAWzD,6CAA6C,IAAI,MAAM,EAAE;IAIzD,oDAAoD,IAAI,2CAA2C,EAAE;IAmBrG,6CAA6C,IAAI,oCAAoC,EAAE;IAgBvF,iDAAiD,IAAI,wCAAwC,EAAE;IAgB/F,yDAAyD,IAAI,gDAAgD,EAAE;CAgBhH"}
@@ -15,9 +15,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  * limitations under the License.
16
16
  */
17
17
  import packageJson from '../../package.json' with { type: 'json' };
18
- import { LegendStudioApplicationPlugin, PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, UnsupportedElementEditorState, } from '@finos/legend-application-studio';
19
- import { PackageableElementExplicitReference, stub_Mapping, stub_PackageableRuntime, } from '@finos/legend-graph';
20
- import { DataSpace, DataSpaceExecutionContext, observe_DataSpace, } from '@finos/legend-extension-dsl-data-space/graph';
18
+ import { LegendStudioApplicationPlugin, PACKAGEABLE_ELEMENT_GROUP_BY_CATEGORY, } from '@finos/legend-application-studio';
19
+ import {} from '@finos/legend-graph';
20
+ import { DataSpace, observe_DataSpace, } from '@finos/legend-extension-dsl-data-space/graph';
21
21
  import { DSL_DATA_SPACE_LEGEND_STUDIO_DOCUMENTATION_KEY } from '../__lib__/DSL_DataSpace_LegendStudioDocumentation.js';
22
22
  import { DataSpacePreviewState } from '../stores/DataSpacePreviewState.js';
23
23
  import { SIMPLE_DATA_SPACE_SNIPPET } from '../__lib__/DSL_DataSpace_LegendStudioCodeSnippet.js';
@@ -27,6 +27,8 @@ import { DataSpaceQueryAction } from './DataSpaceQueryAction.js';
27
27
  import { DataSpacePreviewAction, DataSpacePreviewDialog, } from './DataSpacePreviewAction.js';
28
28
  import { DataSpaceEditorState } from '../stores/DataSpaceEditorState.js';
29
29
  import { DataSpaceEditor } from './DataSpaceEditor.js';
30
+ import { NewDataProductDriverEditor } from './DSL_NewDataProductEditor.js';
31
+ import { NewDataProductDriver } from './DSL_DataProduct_ElementDriver.js';
30
32
  const DATA_SPACE_ELEMENT_TYPE = 'DATA PRODUCT';
31
33
  const DATA_SPACE_ELEMENT_PROJECT_EXPLORER_DND_TYPE = 'PROJECT_EXPLORER_DATA_SPACE';
32
34
  const PURE_GRAMMAR_DATA_SPACE_PARSER_NAME = 'DataSpace';
@@ -120,16 +122,29 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin extends LegendStudioApp
120
122
  return [
121
123
  (type, name, state) => {
122
124
  if (type === DATA_SPACE_ELEMENT_TYPE) {
123
- const dataSpace = new DataSpace(name);
124
- const dataSpaceExecutionContext = new DataSpaceExecutionContext();
125
- dataSpaceExecutionContext.name = 'dummyContext';
126
- dataSpaceExecutionContext.mapping =
127
- PackageableElementExplicitReference.create(stub_Mapping());
128
- dataSpaceExecutionContext.defaultRuntime =
129
- PackageableElementExplicitReference.create(stub_PackageableRuntime());
130
- dataSpace.executionContexts = [dataSpaceExecutionContext];
131
- dataSpace.defaultExecutionContext = dataSpaceExecutionContext;
132
- return dataSpace;
125
+ return state
126
+ .getNewElementDriver(NewDataProductDriver)
127
+ .createElement(name);
128
+ }
129
+ return undefined;
130
+ },
131
+ ];
132
+ }
133
+ getExtraNewElementDriverEditorRenderers() {
134
+ return [
135
+ (type) => {
136
+ if (type === DATA_SPACE_ELEMENT_TYPE) {
137
+ return _jsx(NewDataProductDriverEditor, {});
138
+ }
139
+ return undefined;
140
+ },
141
+ ];
142
+ }
143
+ getExtraNewElementDriverCreators() {
144
+ return [
145
+ (editorStore, type) => {
146
+ if (type === DATA_SPACE_ELEMENT_TYPE) {
147
+ return new NewDataProductDriver(editorStore);
133
148
  }
134
149
  return undefined;
135
150
  },
@@ -149,8 +164,8 @@ export class DSL_DataSpace_LegendStudioApplicationPlugin extends LegendStudioApp
149
164
  return [
150
165
  (editorStore, element) => {
151
166
  if (element instanceof DataSpace) {
152
- return new UnsupportedElementEditorState(editorStore, element);
153
- // return new DataSpaceEditorState(editorStore, element);
167
+ // return new UnsupportedElementEditorState(editorStore, element);
168
+ return new DataSpaceEditorState(editorStore, element);
154
169
  }
155
170
  return undefined;
156
171
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DSL_DataSpace_LegendStudioApplicationPlugin.js","sourceRoot":"","sources":["../../src/components/DSL_DataSpace_LegendStudioApplicationPlugin.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAcL,6BAA6B,EAI7B,qCAAqC,EACrC,6BAA6B,GAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,mCAAmC,EACnC,YAAY,EACZ,uBAAuB,GAGxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,SAAS,EACT,yBAAyB,EACzB,iBAAiB,GAClB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,8CAA8C,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EACL,+BAA+B,EAC/B,aAAa,GACd,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,uCAAuC,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,M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AE,0CAA0C;wBAChD,UAAU,EAAE,yBAAyB;qBACtC;iBACF;gBACH,CAAC,CAAC,SAAS;SAChB,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"DSL_DataSpace_LegendStudioApplicationPlugin.js","sourceRoot":"","sources":["../../src/components/DSL_DataSpace_LegendStudioApplicationPlugin.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACnE,OAAO,EAcL,6BAA6B,EAI7B,qCAAqC,GAItC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAGN,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,SAAS,EACT,iBAAiB,GAClB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,8CAA8C,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAChG,OAAO,EACL,+BAA+B,EAC/B,aAAa,GACd,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,uCAAuC,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAC/C,MAAM,4CAA4C,GAChD,6BAA6B,CAAC;AAEhC,MAAM,mCAAmC,GAAG,WAAW,CAA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SAAS;SAChB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,19 @@
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
+ export declare const NewDataProductDriverEditor: (() => import("react/jsx-runtime").JSX.Element) & {
17
+ displayName: string;
18
+ };
19
+ //# sourceMappingURL=DSL_NewDataProductEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_NewDataProductEditor.d.ts","sourceRoot":"","sources":["../../src/components/DSL_NewDataProductEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,eAAO,MAAM,0BAA0B;;CAmCrC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2020-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { useEditorStore } from '@finos/legend-application-studio';
18
+ import { PanelFormTextField } from '@finos/legend-art';
19
+ import { observer } from 'mobx-react-lite';
20
+ import { NewDataProductDriver } from './DSL_DataProduct_ElementDriver.js';
21
+ export const NewDataProductDriverEditor = observer(() => {
22
+ const editorStore = useEditorStore();
23
+ const dataProductDriver = editorStore.newElementState.getNewElementDriver(NewDataProductDriver);
24
+ const handleTitleChange = (value) => {
25
+ dataProductDriver.setTitle(value);
26
+ };
27
+ const handleDescriptionChange = (value) => {
28
+ dataProductDriver.setDescription(value);
29
+ };
30
+ return (_jsxs("div", { children: [_jsx(PanelFormTextField, { name: "Title", value: dataProductDriver.title ?? '', prompt: "Provide a title for this Data Product.", update: handleTitleChange, placeholder: "Enter title", className: "explorer__new-element-modal__driver__dropdown" }), _jsx(PanelFormTextField, { name: "Description", value: dataProductDriver.description ?? '', prompt: "Provide a description for this Data Product.", update: handleDescriptionChange, placeholder: "Enter description", className: "explorer__new-element-modal__driver__dropdown" })] }));
31
+ });
32
+ //# sourceMappingURL=DSL_NewDataProductEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSL_NewDataProductEditor.js","sourceRoot":"","sources":["../../src/components/DSL_NewDataProductEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,QAAQ,CAAC,GAAG,EAAE;IACtD,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAAM,iBAAiB,GACrB,WAAW,CAAC,eAAe,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,CAAC;IAExE,MAAM,iBAAiB,GAAG,CAAC,KAAyB,EAAQ,EAAE;QAC5D,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,MAAM,uBAAuB,GAAG,CAAC,KAAyB,EAAQ,EAAE;QAClE,iBAAiB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,OAAO,CACL,0BACE,KAAC,kBAAkB,IACjB,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,iBAAiB,CAAC,KAAK,IAAI,EAAE,EACpC,MAAM,EAAC,wCAAwC,EAC/C,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAC,aAAa,EACzB,SAAS,EAAC,+CAA+C,GACzD,EAEF,KAAC,kBAAkB,IACjB,IAAI,EAAC,aAAa,EAClB,KAAK,EAAE,iBAAiB,CAAC,WAAW,IAAI,EAAE,EAC1C,MAAM,EAAC,8CAA8C,EACrD,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAC,mBAAmB,EAC/B,SAAS,EAAC,+CAA+C,GACzD,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const DataSpaceEditor: (() => import("react/jsx-runtime").JSX.Element) & {
16
+ export declare const DataSpaceEditor: (() => import("react/jsx-runtime").JSX.Element | null) & {
17
17
  displayName: string;
18
18
  };
19
19
  //# sourceMappingURL=DataSpaceEditor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceEditor.d.ts","sourceRoot":"","sources":["../../src/components/DataSpaceEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,eAAO,MAAM,eAAe;;CAyC1B,CAAC"}
1
+ {"version":3,"file":"DataSpaceEditor.d.ts","sourceRoot":"","sources":["../../src/components/DataSpaceEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAWH,eAAO,MAAM,eAAe;;CA8D1B,CAAC"}
@@ -16,19 +16,28 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
16
  */
17
17
  import { observer } from 'mobx-react-lite';
18
18
  import { useEditorStore } from '@finos/legend-application-studio';
19
- import { PanelFormTextField } from '@finos/legend-art';
19
+ import { EyeIcon, Panel, PanelContent, PanelHeader } from '@finos/legend-art';
20
20
  import { DataSpaceEditorState } from '../stores/DataSpaceEditorState.js';
21
- import { set_description, set_title, } from '../stores/studio/DSL_DataSpace_GraphModifierHelper.js';
21
+ import { DataSpaceGeneralEditor } from './DataSpaceGeneralEditor/DataSpaceGeneralEditor.js';
22
+ import { DataSpacePreviewState } from '../stores/DataSpacePreviewState.js';
23
+ import { flowResult } from 'mobx';
24
+ import { isStubbed_PackageableElement } from '@finos/legend-graph';
22
25
  export const DataSpaceEditor = observer(() => {
23
26
  const editorStore = useEditorStore();
24
- const formEditorState = editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
25
- const formElement = formEditorState.dataSpace;
26
- const handleTitleChange = (value) => {
27
- set_title(formElement, value);
27
+ const dataSpaceState = editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
28
+ const dataSpace = dataSpaceState.dataSpace;
29
+ const dataSpacePreviewState = DataSpacePreviewState.retrieveNullableState(editorStore);
30
+ if (!dataSpacePreviewState) {
31
+ return null;
32
+ }
33
+ const validPreviewState = () => {
34
+ const stubDefault = Boolean(isStubbed_PackageableElement(dataSpace.defaultExecutionContext.defaultRuntime.value) &&
35
+ isStubbed_PackageableElement(dataSpace.defaultExecutionContext.mapping.value));
36
+ return Boolean(!stubDefault);
28
37
  };
29
- const handleDescriptionChange = (value) => {
30
- set_description(formElement, value);
38
+ const previewDataSpace = () => {
39
+ flowResult(dataSpacePreviewState.previewDataSpace(dataSpaceState.dataSpace)).catch(editorStore.applicationStore.alertUnhandledError);
31
40
  };
32
- return (_jsxs("div", { className: "dataSpace-editor panel dataSpace-editor--dark", children: [_jsx("div", { className: "panel__content__form", children: _jsx("div", { className: "panel__content__form__section", children: _jsx(PanelFormTextField, { name: "Data Product Title", value: formElement.title ?? '', prompt: "Data Product title is the user facing name for the Data Product. It used in downstream applications as the default identifier for this Data Product. When not provided, the DataProduct name property is used", update: handleTitleChange, placeholder: "Enter title" }) }) }), _jsx("div", { className: "panel__content__form", children: _jsx("div", { className: "panel__content__form__section", children: _jsx(PanelFormTextField, { name: "Data Product Description", value: formElement.description ?? '', update: handleDescriptionChange, placeholder: "Enter Description" }) }) })] }));
41
+ return (_jsxs(Panel, { className: "dataSpace-editor", children: [_jsx(PanelHeader, { title: "Data Product", titleContent: dataSpaceState.dataSpace.name, darkMode: true, isReadOnly: dataSpaceState.isReadOnly }), _jsx(PanelHeader, { title: "General", darkMode: true, children: _jsx("div", { className: "panel__header__actions", children: _jsx("div", { className: "btn__dropdown-combo btn__dropdown-combo--primary", children: _jsxs("button", { className: "btn__dropdown-combo__label", onClick: previewDataSpace, title: "Preview Data Product", tabIndex: -1, disabled: !validPreviewState(), children: [_jsx(EyeIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Preview" })] }) }) }) }), _jsx(PanelContent, { children: _jsx(DataSpaceGeneralEditor, {}) })] }));
33
42
  });
34
43
  //# sourceMappingURL=DataSpaceEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataSpaceEditor.js","sourceRoot":"","sources":["../../src/components/DataSpaceEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EACL,eAAe,EACf,SAAS,GACV,MAAM,uDAAuD,CAAC;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,EAAE;IAC3C,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IAErC,MAA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EAAC,cAAc,EACpB,YAAY,EAAE,cAAc,CAAC,SAAS,CAAC,IAAI,EAC3C,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,cAAc,CAAC,UAAU,GACrC,EACF,KAAC,WAAW,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,IAAI,YACzC,cAAK,SAAS,EAAC,wBAAwB,YACrC,cAAK,SAAS,EAAC,kDAAkD,YAC/D,kBACE,SAAS,EAAC,4BAA4B,EACtC,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAC,sBAAsB,EAC5B,QAAQ,EAAE,CAAC,CAAC,EACZ,QAAQ,EAAE,CAAC,iBAAiB,EAAE,aAE9B,KAAC,OAAO,IAAC,SAAS,EAAC,kCAAkC,GAAG,EACxD,cAAK,SAAS,EAAC,mCAAmC,wBAAc,IACzD,GACL,GACF,GACM,EAEd,KAAC,YAAY,cACX,KAAC,sBAAsB,KAAG,GACb,IACT,CACT,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,37 @@
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
+ import type { DataSpaceExecutionContextState } from '../stores/DataSpaceExecutionContextState.js';
17
+ import type { DataSpaceExecutionContext } from '@finos/legend-extension-dsl-data-space/graph';
18
+ export declare const NewExecutionContextModal: ((props: {
19
+ executionState: DataSpaceExecutionContextState;
20
+ isReadOnly: boolean;
21
+ }) => import("react/jsx-runtime").JSX.Element) & {
22
+ displayName: string;
23
+ };
24
+ export declare const RenameModal: ((props: {
25
+ val: string;
26
+ isReadOnly: boolean;
27
+ setValue: (val: string) => void;
28
+ showModal: boolean;
29
+ closeModal: () => void;
30
+ executionContext: DataSpaceExecutionContext;
31
+ }) => import("react/jsx-runtime").JSX.Element) & {
32
+ displayName: string;
33
+ };
34
+ export declare const DataSpaceExecutionContextEditor: (() => import("react/jsx-runtime").JSX.Element) & {
35
+ displayName: string;
36
+ };
37
+ //# sourceMappingURL=DataSpaceExecutionContextEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataSpaceExecutionContextEditor.d.ts","sourceRoot":"","sources":["../../src/components/DataSpaceExecutionContextEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAmDH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAClG,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAgR9F,eAAO,MAAM,wBAAwB,WAC3B;IACN,cAAc,EAAE,8BAA8B,CAAC;IAC/C,UAAU,EAAE,OAAO,CAAC;CACrB;;CAsDF,CAAC;AAEF,eAAO,MAAM,WAAW,WACd;IACN,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB,EAAE,yBAAyB,CAAC;CAC7C;;CAgGF,CAAC;AA4FF,eAAO,MAAM,+BAA+B;;CAiG1C,CAAC"}
@@ -0,0 +1,170 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2020-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { CORE_DND_TYPE, useEditorStore, } from '@finos/legend-application-studio';
18
+ import { observer } from 'mobx-react-lite';
19
+ import { useDrop } from 'react-dnd';
20
+ import { DataSpaceEditorState } from '../stores/DataSpaceEditorState.js';
21
+ import { BlankPanelPlaceholder, clsx, ContextMenu, CustomSelectorInput, Dialog, ErrorIcon, ExclamationTriangleIcon, InputWithInlineValidation, LongArrowRightIcon, MenuContent, MenuContentItem, ModalTitle, PanelContent, PanelDropZone, PanelHeader, PanelHeaderActionItem, PanelHeaderActions, PlusIcon, PURE_MappingIcon, PURE_RuntimeIcon, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, ResizablePanelSplitterLine, } from '@finos/legend-art';
22
+ import { Mapping, PackageableElementExplicitReference, PackageableRuntime, validate_PureExecutionMapping, } from '@finos/legend-graph';
23
+ import { dataSpace_setExecutionContextDefaultRuntime, dataSpace_setExecutionContextMapping, dataSpace_setExecutionContextTitle, dataSpace_setExecutionContextDescription, } from '../stores/studio/DSL_DataSpace_GraphModifierHelper.js';
24
+ import { guaranteeNonNullable } from '@finos/legend-shared';
25
+ import { forwardRef, useCallback, useState } from 'react';
26
+ import { buildElementOption, } from '@finos/legend-lego/graph-editor';
27
+ const DataSpaceExecutionContextConfigurationEditor = observer((props) => {
28
+ const { executionContextState, executionContext } = props;
29
+ const isReadOnly = executionContextState.dataSpaceEditorState.isReadOnly;
30
+ const editorStore = executionContextState.editorStore;
31
+ const applicationStore = editorStore.applicationStore;
32
+ // Mapping
33
+ // TODO: this is not generic error handling, as there could be other problems
34
+ // with mapping, we need to genericize this
35
+ const isMappingEmpty = validate_PureExecutionMapping(executionContext.mapping.value);
36
+ const mapping = executionContext.mapping.value;
37
+ const mappingOptions = editorStore.graphManagerState.usableMappings.map(buildElementOption);
38
+ const noMappingLabel = (_jsxs("div", { className: "service-execution-editor__configuration__mapping-option--empty", title: isMappingEmpty?.messages.join('\n') ?? '', children: [_jsx("div", { className: "service-execution-editor__configuration__mapping-option--empty__label", children: "(none)" }), _jsx(ErrorIcon, {})] }));
39
+ const selectedMappingOption = {
40
+ value: mapping,
41
+ label: isMappingEmpty ? noMappingLabel : mapping.path,
42
+ };
43
+ const onMappingSelectionChange = (val) => {
44
+ if (val.value !== mapping) {
45
+ dataSpace_setExecutionContextMapping(executionContext, PackageableElementExplicitReference.create(val.value));
46
+ executionContextState.autoSelectRuntimeOnMappingChange(val.value);
47
+ }
48
+ };
49
+ const visitMapping = () => editorStore.graphEditorMode.openElement(mapping);
50
+ // Runtime
51
+ const defaultRuntime = executionContext.defaultRuntime;
52
+ // NOTE: for now, only include runtime associated with the mapping
53
+ // TODO?: Should we bring the runtime compatibility check from query to here?
54
+ const runtimes = editorStore.graphManagerState.graph.runtimes.filter((rt) => rt.runtimeValue.mappings.map((m) => m.value).includes(mapping));
55
+ const runtimeOptions = runtimes.map((rt) => ({
56
+ label: rt.path,
57
+ value: PackageableElementExplicitReference.create(rt),
58
+ }));
59
+ const runtimePointerWarning = !runtimes.includes(defaultRuntime.value) // if the runtime does not belong to the chosen mapping
60
+ ? `runtime is not associated with specified mapping '${mapping.path}'`
61
+ : undefined;
62
+ const selectedRuntimeOption = {
63
+ value: defaultRuntime,
64
+ label: (_jsxs("div", { className: "service-execution-editor__configuration__runtime-option__pointer", title: undefined, children: [_jsx("div", { className: clsx('service-execution-editor__configuration__runtime-option__pointer__label', {
65
+ 'service-execution-editor__configuration__runtime-option__pointer__label--with-warning': Boolean(runtimePointerWarning),
66
+ }), children: defaultRuntime.value.path }), runtimePointerWarning && (_jsx("div", { className: "service-execution-editor__configuration__runtime-option__pointer__warning", title: runtimePointerWarning, children: _jsx(ExclamationTriangleIcon, {}) }))] })),
67
+ };
68
+ const onRuntimeSelectionChange = (val) => {
69
+ if (val.value?.value !== defaultRuntime.value &&
70
+ val.value !== undefined) {
71
+ dataSpace_setExecutionContextDefaultRuntime(executionContext, val.value);
72
+ }
73
+ };
74
+ const visitRuntime = () => {
75
+ editorStore.graphEditorMode.openElement(defaultRuntime.value);
76
+ };
77
+ // DnD
78
+ const handleMappingOrRuntimeDrop = useCallback((item) => {
79
+ const element = item.data.packageableElement;
80
+ if (!isReadOnly) {
81
+ if (element instanceof Mapping) {
82
+ dataSpace_setExecutionContextMapping(executionContext, PackageableElementExplicitReference.create(element));
83
+ executionContextState.autoSelectRuntimeOnMappingChange(element);
84
+ }
85
+ else if (element instanceof PackageableRuntime &&
86
+ element.runtimeValue.mappings.map((m) => m.value).includes(mapping)) {
87
+ dataSpace_setExecutionContextDefaultRuntime(executionContext, PackageableElementExplicitReference.create(element));
88
+ }
89
+ }
90
+ }, [isReadOnly, mapping, executionContextState, executionContext]);
91
+ const [{ isMappingOrRuntimeDragOver }, dropConnector] = useDrop(() => ({
92
+ accept: [
93
+ CORE_DND_TYPE.PROJECT_EXPLORER_MAPPING,
94
+ CORE_DND_TYPE.PROJECT_EXPLORER_RUNTIME,
95
+ ],
96
+ drop: (item) => handleMappingOrRuntimeDrop(item),
97
+ collect: (monitor) => ({
98
+ isMappingOrRuntimeDragOver: monitor.isOver({ shallow: true }),
99
+ }),
100
+ }), [handleMappingOrRuntimeDrop]);
101
+ return (_jsx(PanelContent, { children: _jsx(PanelDropZone, { dropTargetConnector: dropConnector, isDragOver: isMappingOrRuntimeDragOver && !isReadOnly, children: _jsxs("div", { className: "service-execution-editor__configuration__items", children: [_jsxs("div", { className: "service-execution-editor__configuration__item", children: [_jsx("div", { className: "btn--sm service-execution-editor__configuration__item__label", children: _jsx(PURE_MappingIcon, {}) }), _jsx(CustomSelectorInput, { className: "panel__content__form__section__dropdown service-execution-editor__configuration__item__dropdown", disabled: isReadOnly, options: mappingOptions, onChange: onMappingSelectionChange, value: selectedMappingOption, darkMode: !applicationStore.layoutService
102
+ .TEMPORARY__isLightColorThemeEnabled, hasError: Boolean(isMappingEmpty) }), _jsx("button", { className: "btn--dark btn--sm service-execution-editor__configuration__item__btn", onClick: visitMapping, tabIndex: -1, title: "See mapping", disabled: Boolean(isMappingEmpty), children: _jsx(LongArrowRightIcon, {}) })] }), _jsxs("div", { className: "service-execution-editor__configuration__item", children: [_jsx("div", { className: "btn--sm service-execution-editor__configuration__item__label", children: _jsx(PURE_RuntimeIcon, {}) }), _jsx(CustomSelectorInput, { className: "panel__content__form__section__dropdown service-execution-editor__configuration__item__dropdown", disabled: isReadOnly, options: runtimeOptions, onChange: onRuntimeSelectionChange, value: selectedRuntimeOption, darkMode: !applicationStore.layoutService
103
+ .TEMPORARY__isLightColorThemeEnabled }), _jsx("button", { className: "btn--sm btn--dark service-execution-editor__configuration__item__btn", onClick: visitRuntime, tabIndex: -1, title: "See runtime", children: _jsx(LongArrowRightIcon, {}) })] }), _jsxs("div", { className: "execution-context-editor__form-section", children: [_jsx("div", { className: "execution-context-editor__form-section__label", children: "Title" }), _jsx("div", { className: "execution-context-editor__form-section__content", children: _jsx("input", { className: "execution-context-editor__form-section__content__input panel__content__form__section__input", spellCheck: false, disabled: isReadOnly, value: executionContext.title ?? '', onChange: (event) => dataSpace_setExecutionContextTitle(executionContext, event.target.value) }) })] }), _jsxs("div", { className: "execution-context-editor__form-section", children: [_jsx("div", { className: "execution-context-editor__form-section__label", children: "Description" }), _jsx("div", { className: "execution-context-editor__form-section__content", children: _jsx("textarea", { className: "execution-context-editor__form-section__content__textarea panel__content__form__section__input", spellCheck: false, disabled: isReadOnly, value: executionContext.description ?? '', onChange: (event) => dataSpace_setExecutionContextDescription(executionContext, event.target.value), rows: 4 }) })] })] }) }) }));
104
+ });
105
+ export const NewExecutionContextModal = observer((props) => {
106
+ const { executionState, isReadOnly } = props;
107
+ const [name, setName] = useState('');
108
+ const validationMessage = name === ''
109
+ ? `Execution context name can't be empty`
110
+ : executionState.executionContexts.find((e) => e.name === name)
111
+ ? 'Execution context name already exists'
112
+ : undefined;
113
+ const closeModal = () => executionState.setNewExecutionContextModal(false);
114
+ const onChange = (event) => {
115
+ setName(event.target.value);
116
+ };
117
+ return (_jsx(Dialog, { open: executionState.newExecutionContextModal, onClose: closeModal, classes: { container: 'search-modal__container' }, PaperProps: { classes: { root: 'search-modal__inner-container' } }, children: _jsxs("form", { onSubmit: (event) => {
118
+ event.preventDefault();
119
+ executionState.addExecutionContext(name);
120
+ setName('');
121
+ closeModal();
122
+ }, className: "modal modal--dark search-modal", children: [_jsx(ModalTitle, { title: "New Execution Context" }), _jsx("div", { className: "service-execution-editor__change__modal", children: _jsx(InputWithInlineValidation, { className: "service-execution-editor__input input-group__input", spellCheck: false, value: name, onChange: onChange, placeholder: "Key execution name", error: validationMessage }) }), _jsx("div", { className: "search-modal__actions", children: _jsx("button", { className: "btn btn--dark", disabled: isReadOnly || Boolean(validationMessage), children: "Add" }) })] }) }));
123
+ });
124
+ export const RenameModal = observer((props) => {
125
+ const { val, isReadOnly, showModal, closeModal, setValue, executionContext, } = props;
126
+ const [inputValue, setInputValue] = useState(val);
127
+ const changeValue = (event) => {
128
+ setInputValue(event.target.value);
129
+ };
130
+ return (_jsx(Dialog, { open: showModal, onClose: closeModal, classes: { container: 'search-modal__container' }, PaperProps: { classes: { root: 'search-modal__inner-container' } }, children: _jsxs("form", { onSubmit: (event) => {
131
+ event.preventDefault();
132
+ setValue(inputValue);
133
+ closeModal();
134
+ }, className: "modal modal--dark search-modal", children: [_jsx(ModalTitle, { title: "Edit Execution Context" }), _jsxs("div", { className: "execution-context-editor__form-section", children: [_jsx("div", { className: "execution-context-editor__form-section__label", children: "Key" }), _jsx("div", { className: "execution-context-editor__form-section__content", children: _jsx("input", { className: "execution-context-editor__form-section__content__input panel__content__form__section__input", spellCheck: false, disabled: isReadOnly, value: inputValue, onChange: changeValue }) })] }), _jsxs("div", { className: "execution-context-editor__form-section", children: [_jsx("div", { className: "execution-context-editor__form-section__label", children: "Title" }), _jsx("div", { className: "execution-context-editor__form-section__content", children: _jsx("input", { className: "execution-context-editor__form-section__content__input panel__content__form__section__input", spellCheck: false, disabled: isReadOnly, value: executionContext.title ?? '', onChange: (event) => dataSpace_setExecutionContextTitle(executionContext, event.target.value) }) })] }), _jsxs("div", { className: "execution-context-editor__form-section", children: [_jsx("div", { className: "execution-context-editor__form-section__label", children: "Description" }), _jsx("div", { className: "execution-context-editor__form-section__content", children: _jsx("textarea", { className: "execution-context-editor__form-section__content__textarea panel__content__form__section__input", spellCheck: false, disabled: isReadOnly, value: executionContext.description ?? '', onChange: (event) => dataSpace_setExecutionContextDescription(executionContext, event.target.value), rows: 4 }) })] }), _jsx("div", { className: "search-modal__actions", children: _jsx("button", { className: "btn btn--dark", disabled: isReadOnly, children: "Done" }) })] }) }));
135
+ });
136
+ const ExecutionContextMenu = observer(forwardRef(function TestContainerContextMenu(props, ref) {
137
+ const { dataSpaceExecutionContextState, dataSpaceExecutionContext } = props;
138
+ const rename = () => {
139
+ dataSpaceExecutionContextState.setExecutionContextToRename(dataSpaceExecutionContext);
140
+ };
141
+ const remove = () => {
142
+ dataSpaceExecutionContextState.removeExecutionContext(dataSpaceExecutionContext);
143
+ };
144
+ const add = () => {
145
+ dataSpaceExecutionContextState.setNewExecutionContextModal(true);
146
+ };
147
+ return (_jsxs(MenuContent, { ref: ref, children: [_jsx(MenuContentItem, { onClick: rename, children: "Rename" }), _jsx(MenuContentItem, { onClick: remove, children: "Delete" }), _jsx(MenuContentItem, { onClick: add, children: "Create a new key" })] }));
148
+ }));
149
+ const ExecutionContextItem = observer((props) => {
150
+ const { dataSpaceExecutionContextState, dataSpaceExecutionContext, isReadOnly, } = props;
151
+ const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] = useState(false);
152
+ const isActive = dataSpaceExecutionContextState.selectedExecutionContext ===
153
+ dataSpaceExecutionContext;
154
+ const openKeyedExecution = () => dataSpaceExecutionContextState.setSelectedExecutionContext(dataSpaceExecutionContext);
155
+ const onContextMenuOpen = () => setIsSelectedFromContextMenu(true);
156
+ const onContextMenuClose = () => setIsSelectedFromContextMenu(false);
157
+ return (_jsx(ContextMenu, { className: clsx('service-multi-execution-editor__item', {
158
+ 'service-multi-execution-editor__item--selected-from-context-menu': !isActive && isSelectedFromContextMenu,
159
+ }, { 'service-multi-execution-editor__item--active': isActive }), disabled: isReadOnly, content: _jsx(ExecutionContextMenu, { dataSpaceExecutionContextState: dataSpaceExecutionContextState, dataSpaceExecutionContext: dataSpaceExecutionContext, isReadOnly: isReadOnly }), menuProps: { elevation: 7 }, onOpen: onContextMenuOpen, onClose: onContextMenuClose, children: _jsx("button", { className: clsx('service-multi-execution-editor__item__label'), onClick: openKeyedExecution, tabIndex: -1, children: dataSpaceExecutionContext.name }) }));
160
+ });
161
+ export const DataSpaceExecutionContextEditor = observer(() => {
162
+ const editorStore = useEditorStore();
163
+ const dataSpaceState = editorStore.tabManagerState.getCurrentEditorState(DataSpaceEditorState);
164
+ const executionContextState = dataSpaceState.executionContextState;
165
+ const addExecutionKey = () => {
166
+ executionContextState.setNewExecutionContextModal(true);
167
+ };
168
+ return (_jsx("div", { className: "service-execution-editor__execution", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsxs(ResizablePanel, { size: 300, minSize: 200, children: [_jsxs("div", { className: "service-multi-execution-editor__panel", children: [_jsxs(PanelHeader, { children: [_jsx("div", { className: "panel__header__title", children: _jsx("div", { className: "panel__header__title__content", children: "Execution Contexts" }) }), _jsx(PanelHeaderActions, { children: _jsx(PanelHeaderActionItem, { disabled: dataSpaceState.isReadOnly, onClick: addExecutionKey, title: "Add an execution context", children: _jsx(PlusIcon, {}) }) })] }), executionContextState.executionContexts.map((executionContext) => (_jsx(ExecutionContextItem, { dataSpaceExecutionContextState: executionContextState, dataSpaceExecutionContext: executionContext, isReadOnly: dataSpaceState.isReadOnly }, executionContext.name))), !executionContextState.executionContexts.length && (_jsx(BlankPanelPlaceholder, { text: "Add an execution context", onClick: addExecutionKey, clickActionType: "add", tooltipText: "Click to add an execution context" }))] }), executionContextState.newExecutionContextModal && (_jsx(NewExecutionContextModal, { executionState: executionContextState, isReadOnly: dataSpaceState.isReadOnly })), executionContextState.executionContextToRename && (_jsx(RenameModal, { val: executionContextState.executionContextToRename.name, isReadOnly: dataSpaceState.isReadOnly, showModal: true, closeModal: () => executionContextState.setExecutionContextToRename(undefined), setValue: (val) => executionContextState.renameExecutionContext(guaranteeNonNullable(executionContextState.executionContextToRename), val), executionContext: executionContextState.executionContextToRename }))] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 56, children: executionContextState.selectedExecutionContext ? (_jsx(DataSpaceExecutionContextConfigurationEditor, { executionContextState: executionContextState, executionContext: executionContextState.selectedExecutionContext })) : (_jsx(BlankPanelPlaceholder, { text: "Add an execution context", onClick: addExecutionKey, clickActionType: "add", tooltipText: "Click to add an execution context" })) })] }) }));
169
+ });
170
+ //# sourceMappingURL=DataSpaceExecutionContextEditor.js.map