@finos/legend-application-studio 27.1.5 → 27.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/lib/__lib__/LegendStudioDocumentation.d.ts +1 -0
  2. package/lib/__lib__/LegendStudioDocumentation.d.ts.map +1 -1
  3. package/lib/__lib__/LegendStudioDocumentation.js +1 -0
  4. package/lib/__lib__/LegendStudioDocumentation.js.map +1 -1
  5. package/lib/application/LegendStudioApplicationConfig.d.ts +0 -5
  6. package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
  7. package/lib/application/LegendStudioApplicationConfig.js +0 -6
  8. package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
  9. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.d.ts.map +1 -1
  10. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js +1 -3
  11. package/lib/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.js.map +1 -1
  12. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.d.ts.map +1 -1
  13. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js +1 -3
  14. package/lib/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.js.map +1 -1
  15. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts +0 -3
  16. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
  17. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +7 -17
  18. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  19. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.d.ts.map +1 -1
  20. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js +2 -4
  21. package/lib/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.js.map +1 -1
  22. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  23. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +1 -1
  24. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  25. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.d.ts.map +1 -1
  26. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js +5 -7
  27. package/lib/components/editor/editor-group/mapping-editor/NewMappingElementModal.js.map +1 -1
  28. package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.d.ts +1 -7
  29. package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.d.ts.map +1 -1
  30. package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js +2 -72
  31. package/lib/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js.map +1 -1
  32. package/lib/index.css +1 -1
  33. package/lib/package.json +1 -1
  34. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +1 -1
  35. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +10 -1
  38. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -1
  39. package/lib/stores/editor/utils/TestableUtils.d.ts +2 -0
  40. package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
  41. package/lib/stores/editor/utils/TestableUtils.js +25 -3
  42. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  43. package/lib/stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.d.ts +16 -1
  44. package/lib/stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.d.ts.map +1 -1
  45. package/package.json +11 -11
  46. package/src/__lib__/LegendStudioDocumentation.ts +1 -0
  47. package/src/application/LegendStudioApplicationConfig.ts +0 -7
  48. package/src/components/editor/editor-group/mapping-editor/EnumerationMappingEditor.tsx +2 -5
  49. package/src/components/editor/editor-group/mapping-editor/InstanceSetImplementationSourceSelectorModal.tsx +2 -5
  50. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +13 -21
  51. package/src/components/editor/editor-group/mapping-editor/MappingExecutionBuilder.tsx +2 -5
  52. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +3 -1
  53. package/src/components/editor/editor-group/mapping-editor/NewMappingElementModal.tsx +5 -9
  54. package/src/components/extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.tsx +1 -119
  55. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +1 -1
  56. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +16 -1
  57. package/src/stores/editor/utils/TestableUtils.ts +38 -3
  58. package/src/stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.ts +33 -1
  59. package/tsconfig.json +0 -1
  60. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.d.ts +0 -22
  61. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.d.ts.map +0 -1
  62. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.js +0 -61
  63. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.js.map +0 -1
  64. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.tsx +0 -103
@@ -62,6 +62,7 @@ import {
62
62
  assertTrue,
63
63
  guaranteeNonNullable,
64
64
  } from '@finos/legend-shared';
65
+ import type { DSL_Data_LegendStudioApplicationPlugin_Extension } from '../../../../../extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
65
66
 
66
67
  export const createGraphFetchRawLambda = (
67
68
  mainClass: Class,
@@ -116,7 +117,7 @@ export const generateStoreTestDataFromSetImpl = (
116
117
  );
117
118
  if (_table instanceof TableAlias) {
118
119
  const relation = _table.relation.value;
119
- const owner = relation.schema._OWNER;
120
+ const owner = _table.relation.ownerReference.value;
120
121
  const val = new RelationalCSVData();
121
122
  if (tryAndMockTable && relation instanceof Table) {
122
123
  const mockTable = new RelationalCSVDataTable();
@@ -137,6 +138,20 @@ export const generateStoreTestDataFromSetImpl = (
137
138
  return createStoreBareModelStoreData(srcClass.value, editorStore);
138
139
  }
139
140
  }
141
+ const extraStoreDataCreators = editorStore.pluginManager
142
+ .getApplicationPlugins()
143
+ .flatMap(
144
+ (plugin) =>
145
+ (
146
+ plugin as DSL_Data_LegendStudioApplicationPlugin_Extension
147
+ ).getExtraStoreTestDataCreators?.() ?? [],
148
+ );
149
+ for (const creator of extraStoreDataCreators) {
150
+ const embeddedData = creator(setImpl);
151
+ if (embeddedData) {
152
+ return embeddedData;
153
+ }
154
+ }
140
155
  return undefined;
141
156
  };
142
157
 
@@ -59,6 +59,7 @@ import {
59
59
  import { EmbeddedDataType } from '../editor-state/ExternalFormatState.js';
60
60
  import type { EditorStore } from '../EditorStore.js';
61
61
  import { createMockDataForMappingElementSource } from './MockDataUtils.js';
62
+ import type { DSL_Data_LegendStudioApplicationPlugin_Extension } from '../../extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
62
63
 
63
64
  export const DEFAULT_TEST_ASSERTION_ID = 'assertion_1';
64
65
  export const DEFAULT_TEST_ID = 'test_1';
@@ -127,8 +128,28 @@ export const createBareModelStoreData = (
127
128
  export class EmbeddedDataCreatorFromEmbeddedData
128
129
  implements EmbeddedDataVisitor<EmbeddedData>
129
130
  {
131
+ editorStore: EditorStore;
132
+ constructor(editorStore: EditorStore) {
133
+ this.editorStore = editorStore;
134
+ }
130
135
  visit_EmbeddedData(data: EmbeddedData): EmbeddedData {
131
- throw new Error('Method not implemented.');
136
+ const extraEmbeddedDataCloners = this.editorStore.pluginManager
137
+ .getApplicationPlugins()
138
+ .flatMap(
139
+ (plugin) =>
140
+ (
141
+ plugin as DSL_Data_LegendStudioApplicationPlugin_Extension
142
+ ).getExtraEmbeddedDataCloners?.() ?? [],
143
+ );
144
+ for (const creator of extraEmbeddedDataCloners) {
145
+ const embeddedData = creator(data);
146
+ if (embeddedData) {
147
+ return embeddedData;
148
+ }
149
+ }
150
+ throw new UnsupportedOperationError(
151
+ `Unsupported embedded data${data.toString()}`,
152
+ );
132
153
  }
133
154
  visit_INTERNAL__UnknownEmbeddedData(
134
155
  data: INTERNAL__UnknownEmbeddedData,
@@ -149,7 +170,7 @@ export class EmbeddedDataCreatorFromEmbeddedData
149
170
  const v = new ModelEmbeddedData();
150
171
  v.model = PackageableElementExplicitReference.create(e.model.value);
151
172
  v.data = e.data.accept_EmbeddedDataVisitor(
152
- new EmbeddedDataCreatorFromEmbeddedData(),
173
+ new EmbeddedDataCreatorFromEmbeddedData(this.editorStore),
153
174
  );
154
175
  return v;
155
176
  }
@@ -160,7 +181,7 @@ export class EmbeddedDataCreatorFromEmbeddedData
160
181
  }
161
182
  visit_DataElementReference(data: DataElementReference): EmbeddedData {
162
183
  return data.dataElement.value.data.accept_EmbeddedDataVisitor(
163
- new EmbeddedDataCreatorFromEmbeddedData(),
184
+ new EmbeddedDataCreatorFromEmbeddedData(this.editorStore),
164
185
  );
165
186
  }
166
187
  visit_RelationalCSVData(data: RelationalCSVData): EmbeddedData {
@@ -224,6 +245,20 @@ export class EmbeddedDataConnectionTypeVisitor
224
245
  }
225
246
 
226
247
  visit_Connection(connection: Connection): string {
248
+ const extraEmbeddedDataCreator = this.editorStore.pluginManager
249
+ .getApplicationPlugins()
250
+ .flatMap(
251
+ (plugin) =>
252
+ (
253
+ plugin as DSL_Data_LegendStudioApplicationPlugin_Extension
254
+ ).getExtraEmbeddedDataTypeFromConnectionMatchers?.() ?? [],
255
+ );
256
+ for (const creator of extraEmbeddedDataCreator) {
257
+ const embeddedData = creator(connection);
258
+ if (embeddedData) {
259
+ return embeddedData;
260
+ }
261
+ }
227
262
  return EmbeddedDataType.EXTERNAL_FORMAT_DATA;
228
263
  }
229
264
  visit_INTERNAL__UnknownConnection(
@@ -14,7 +14,12 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import type { EmbeddedData } from '@finos/legend-graph';
17
+ import type {
18
+ Connection,
19
+ EmbeddedData,
20
+ SetImplementation,
21
+ StoreTestData,
22
+ } from '@finos/legend-graph';
18
23
  import type { EmbeddedDataTypeOption } from '../editor/editor-state/element-editor-state/data/DataEditorState.js';
19
24
  import type { EmbeddedDataState } from '../editor/editor-state/element-editor-state/data/EmbeddedDataState.js';
20
25
  import type { EditorStore } from '../editor/EditorStore.js';
@@ -35,6 +40,18 @@ export type EmbeddedDataCreator = (
35
40
  embeddedDataType: string,
36
41
  ) => EmbeddedData | undefined;
37
42
 
43
+ export type EmbeddedDataCloner = (
44
+ embeddedData: EmbeddedData,
45
+ ) => EmbeddedData | undefined;
46
+
47
+ export type StoreTestDataCreators = (
48
+ setImp: SetImplementation,
49
+ ) => StoreTestData | undefined;
50
+
51
+ export type EmbeddedDataTypeFromConnectionMatcher = (
52
+ connection: Connection,
53
+ ) => string | undefined;
54
+
38
55
  /**
39
56
  * NOTE: The tab-stop index of the snippet must start from 2
40
57
  */
@@ -67,4 +84,19 @@ export interface DSL_Data_LegendStudioApplicationPlugin_Extension
67
84
  * Get the list of embedded data creators
68
85
  */
69
86
  getExtraEmbeddedDataCreators?(): EmbeddedDataCreator[];
87
+
88
+ /**
89
+ * Get the list of embedded data type from connection matchers
90
+ */
91
+ getExtraEmbeddedDataTypeFromConnectionMatchers?(): EmbeddedDataTypeFromConnectionMatcher[];
92
+
93
+ /**
94
+ * Get the list of store test data creators
95
+ */
96
+ getExtraStoreTestDataCreators?(): StoreTestDataCreators[];
97
+
98
+ /**
99
+ * Get the list of embedded data cloners
100
+ */
101
+ getExtraEmbeddedDataCloners?(): EmbeddedDataCloner[];
70
102
  }
package/tsconfig.json CHANGED
@@ -210,7 +210,6 @@
210
210
  "./src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx",
211
211
  "./src/components/editor/editor-group/element-generation-editor/FileSystemViewer.tsx",
212
212
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_BindingElementEditor.tsx",
213
- "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.tsx",
214
213
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.tsx",
215
214
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx",
216
215
  "./src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetModelGenerationEditor.tsx",
@@ -1,22 +0,0 @@
1
- import { ExternalFormatConnection, type Binding } from '@finos/legend-graph';
2
- import { ConnectionValueState } from '../../../../stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js';
3
- import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
4
- import { NewConnectionValueDriver } from '../../../../stores/editor/NewElementState.js';
5
- export declare class ExternalFormatConnectionValueState extends ConnectionValueState {
6
- connection: ExternalFormatConnection;
7
- constructor(editorStore: EditorStore, connection: ExternalFormatConnection);
8
- label(): string;
9
- }
10
- export declare const ExternalFormatConnectionEditor: ((props: {
11
- connectionValueState: ExternalFormatConnectionValueState;
12
- isReadOnly: boolean;
13
- }) => import("react/jsx-runtime").JSX.Element) & {
14
- displayName: string;
15
- };
16
- export declare class NewExternalFormatConnectionDriver extends NewConnectionValueDriver<ExternalFormatConnection> {
17
- constructor(editorStore: EditorStore);
18
- get isValid(): boolean;
19
- getConnectionType(): string;
20
- createConnection(store: Binding): ExternalFormatConnection;
21
- }
22
- //# sourceMappingURL=DSL_ExternalFormat_ExternalFormatConnectionEditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DSL_ExternalFormat_ExternalFormatConnectionEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.tsx"],"names":[],"mappings":"AAgBA,OAAO,EACL,wBAAwB,EAGxB,KAAK,OAAO,EACb,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,iGAAiG,CAAC;AACvI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAIxF,qBAAa,kCAAmC,SAAQ,oBAAoB;IACjE,UAAU,EAAE,wBAAwB,CAAC;gBAElC,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,wBAAwB;IAK1E,KAAK,IAAI,MAAM;CAGhB;AAED,eAAO,MAAM,8BAA8B,WACjC;IACN,oBAAoB,EAAE,kCAAkC,CAAC;IACzD,UAAU,EAAE,OAAO,CAAC;CACrB;;CA4BF,CAAC;AAEF,qBAAa,iCAAkC,SAAQ,wBAAwB,CAAC,wBAAwB,CAAC;gBAC3F,WAAW,EAAE,WAAW;IAQpC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,iBAAiB,IAAI,MAAM;IAI3B,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,wBAAwB;CAS3D"}
@@ -1,61 +0,0 @@
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 { observer } from 'mobx-react-lite';
18
- import { ExternalFormatConnection, PackageableElementExplicitReference, UrlStream, } from '@finos/legend-graph';
19
- import { computed, makeObservable } from 'mobx';
20
- import { ConnectionValueState } from '../../../../stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js';
21
- import { NewConnectionValueDriver } from '../../../../stores/editor/NewElementState.js';
22
- import { externalFormat_urlStream_setUrl } from '../../../../stores/graph-modifier/DSL_ExternalFormat_GraphModifierHelper.js';
23
- import { EXTERNAL_FORMAT_CONNECTION } from '../../../extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js';
24
- export class ExternalFormatConnectionValueState extends ConnectionValueState {
25
- connection;
26
- constructor(editorStore, connection) {
27
- super(editorStore, connection);
28
- this.connection = connection;
29
- }
30
- label() {
31
- return 'external format connection';
32
- }
33
- }
34
- export const ExternalFormatConnectionEditor = observer((props) => {
35
- const { connectionValueState, isReadOnly } = props;
36
- const connection = connectionValueState.connection;
37
- const changeUrl = (event) => externalFormat_urlStream_setUrl(connection.externalSource, event.target.value);
38
- return (_jsx("div", { className: "external-format-connection-editor", children: _jsxs("div", { className: "external-format-connection-editor__section", children: [_jsx("div", { className: "external-format-connection-editor__section__header__label", children: "URL" }), _jsx("div", { className: "external-format-connection-editor__section__header__prompt", children: "Specifies the connection URL" }), _jsx("textarea", { className: "external-format-connection-editor__section__textarea", spellCheck: false, value: connection.externalSource.url, onChange: changeUrl, disabled: isReadOnly })] }) }));
39
- });
40
- export class NewExternalFormatConnectionDriver extends NewConnectionValueDriver {
41
- constructor(editorStore) {
42
- super(editorStore);
43
- makeObservable(this, {
44
- isValid: computed,
45
- });
46
- }
47
- get isValid() {
48
- return true;
49
- }
50
- getConnectionType() {
51
- return EXTERNAL_FORMAT_CONNECTION;
52
- }
53
- createConnection(store) {
54
- const externalFormatConnection = new ExternalFormatConnection(PackageableElementExplicitReference.create(store));
55
- const urlStream = new UrlStream();
56
- externalFormat_urlStream_setUrl(urlStream, '');
57
- externalFormatConnection.externalSource = urlStream;
58
- return externalFormatConnection;
59
- }
60
- }
61
- //# sourceMappingURL=DSL_ExternalFormat_ExternalFormatConnectionEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DSL_ExternalFormat_ExternalFormatConnectionEditor.js","sourceRoot":"","sources":["../../../../../src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_ExternalFormatConnectionEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,wBAAwB,EACxB,mCAAmC,EACnC,SAAS,GAEV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iGAAiG,CAAC;AAEvI,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,+BAA+B,EAAE,MAAM,6EAA6E,CAAC;AAC9H,OAAO,EAAE,0BAA0B,EAAE,MAAM,yEAAyE,CAAC;AAErH,MAAM,OAAO,kCAAmC,SAAQ,oBAAoB;IACjE,UAAU,CAA2B;IAE9C,YAAY,WAAwB,EAAE,UAAoC;QACxE,KAAK,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK;QACH,OAAO,4BAA4B,CAAC;IACtC,CAAC;CACF;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,QAAQ,CACpD,CAAC,KAGA,EAAE,EAAE;IACH,MAAM,EAAE,oBAAoB,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IACnD,MAAM,UAAU,GAAG,oBAAoB,CAAC,UAAU,CAAC;IACnD,MAAM,SAAS,GAAkD,CAAC,KAAK,EAAE,EAAE,CACzE,+BAA+B,CAC7B,UAAU,CAAC,cAAc,EACzB,KAAK,CAAC,MAAM,CAAC,KAAK,CACnB,CAAC;IACJ,OAAO,CACL,cAAK,SAAS,EAAC,mCAAmC,YAChD,eAAK,SAAS,EAAC,4CAA4C,aACzD,cAAK,SAAS,EAAC,2DAA2D,oBAEpE,EACN,cAAK,SAAS,EAAC,4DAA4D,6CAErE,EACN,mBACE,SAAS,EAAC,sDAAsD,EAChE,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,GAAG,EACpC,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,UAAU,GACpB,IACE,GACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,OAAO,iCAAkC,SAAQ,wBAAkD;IACvG,YAAY,WAAwB;QAClC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEnB,cAAc,CAAC,IAAI,EAAE;YACnB,OAAO,EAAE,QAAQ;SAClB,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB;QACf,OAAO,0BAA0B,CAAC;IACpC,CAAC;IAED,gBAAgB,CAAC,KAAc;QAC7B,MAAM,wBAAwB,GAAG,IAAI,wBAAwB,CAC3D,mCAAmC,CAAC,MAAM,CAAC,KAAK,CAAC,CAClD,CAAC;QACF,MAAM,SAAS,GAAG,IAAI,SAAS,EAAE,CAAC;QAClC,+BAA+B,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;QAC/C,wBAAwB,CAAC,cAAc,GAAG,SAAS,CAAC;QACpD,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF"}
@@ -1,103 +0,0 @@
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 { observer } from 'mobx-react-lite';
17
- import {
18
- ExternalFormatConnection,
19
- PackageableElementExplicitReference,
20
- UrlStream,
21
- type Binding,
22
- } from '@finos/legend-graph';
23
- import { computed, makeObservable } from 'mobx';
24
- import { ConnectionValueState } from '../../../../stores/editor/editor-state/element-editor-state/connection/ConnectionEditorState.js';
25
- import type { EditorStore } from '../../../../stores/editor/EditorStore.js';
26
- import { NewConnectionValueDriver } from '../../../../stores/editor/NewElementState.js';
27
- import { externalFormat_urlStream_setUrl } from '../../../../stores/graph-modifier/DSL_ExternalFormat_GraphModifierHelper.js';
28
- import { EXTERNAL_FORMAT_CONNECTION } from '../../../extensions/DSL_ExternalFormat_LegendStudioApplicationPlugin.js';
29
-
30
- export class ExternalFormatConnectionValueState extends ConnectionValueState {
31
- override connection: ExternalFormatConnection;
32
-
33
- constructor(editorStore: EditorStore, connection: ExternalFormatConnection) {
34
- super(editorStore, connection);
35
- this.connection = connection;
36
- }
37
-
38
- label(): string {
39
- return 'external format connection';
40
- }
41
- }
42
-
43
- export const ExternalFormatConnectionEditor = observer(
44
- (props: {
45
- connectionValueState: ExternalFormatConnectionValueState;
46
- isReadOnly: boolean;
47
- }) => {
48
- const { connectionValueState, isReadOnly } = props;
49
- const connection = connectionValueState.connection;
50
- const changeUrl: React.ChangeEventHandler<HTMLTextAreaElement> = (event) =>
51
- externalFormat_urlStream_setUrl(
52
- connection.externalSource,
53
- event.target.value,
54
- );
55
- return (
56
- <div className="external-format-connection-editor">
57
- <div className="external-format-connection-editor__section">
58
- <div className="external-format-connection-editor__section__header__label">
59
- URL
60
- </div>
61
- <div className="external-format-connection-editor__section__header__prompt">
62
- Specifies the connection URL
63
- </div>
64
- <textarea
65
- className="external-format-connection-editor__section__textarea"
66
- spellCheck={false}
67
- value={connection.externalSource.url}
68
- onChange={changeUrl}
69
- disabled={isReadOnly}
70
- />
71
- </div>
72
- </div>
73
- );
74
- },
75
- );
76
-
77
- export class NewExternalFormatConnectionDriver extends NewConnectionValueDriver<ExternalFormatConnection> {
78
- constructor(editorStore: EditorStore) {
79
- super(editorStore);
80
-
81
- makeObservable(this, {
82
- isValid: computed,
83
- });
84
- }
85
-
86
- get isValid(): boolean {
87
- return true;
88
- }
89
-
90
- getConnectionType(): string {
91
- return EXTERNAL_FORMAT_CONNECTION;
92
- }
93
-
94
- createConnection(store: Binding): ExternalFormatConnection {
95
- const externalFormatConnection = new ExternalFormatConnection(
96
- PackageableElementExplicitReference.create(store),
97
- );
98
- const urlStream = new UrlStream();
99
- externalFormat_urlStream_setUrl(urlStream, '');
100
- externalFormatConnection.externalSource = urlStream;
101
- return externalFormatConnection;
102
- }
103
- }