@finos/legend-application-studio 26.1.8 → 26.1.10
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.
- package/lib/components/editor/StatusBar.d.ts.map +1 -1
- package/lib/components/editor/StatusBar.js +1 -4
- package/lib/components/editor/StatusBar.js.map +1 -1
- package/lib/components/editor/editor-group/{FileGenerationViewer.d.ts → ArtifactGenerationViewer.d.ts} +2 -2
- package/lib/components/editor/editor-group/ArtifactGenerationViewer.d.ts.map +1 -0
- package/lib/components/editor/editor-group/ArtifactGenerationViewer.js +32 -0
- package/lib/components/editor/editor-group/ArtifactGenerationViewer.js.map +1 -0
- package/lib/components/editor/editor-group/EditorGroup.js +6 -6
- package/lib/components/editor/editor-group/EditorGroup.js.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
- package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/DataElementEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/DataElementEditor.js +1 -1
- package/lib/components/editor/editor-group/data-editor/DataElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts +15 -2
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js +47 -6
- package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +18 -3
- package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileGenerationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileSystemViewer.d.ts.map +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileSystemViewer.js +1 -1
- package/lib/components/editor/editor-group/element-generation-editor/FileSystemViewer.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.d.ts.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js +2 -2
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js.map +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js +1 -1
- package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +0 -3
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +36 -72
- package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts +5 -0
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +53 -8
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +3 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +7 -3
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
- package/lib/components/editor/panel-group/DevToolPanel.d.ts.map +1 -1
- package/lib/components/editor/panel-group/DevToolPanel.js +4 -1
- package/lib/components/editor/panel-group/DevToolPanel.js.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.d.ts.map +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js +1 -1
- package/lib/components/editor/side-bar/CreateNewElementModal.js.map +1 -1
- package/lib/components/editor/side-bar/Explorer.js +1 -1
- package/lib/components/editor/side-bar/Explorer.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +4 -4
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +7 -6
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.js +2 -2
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.d.ts +3 -3
- package/lib/stores/editor/ExplorerTreeState.d.ts.map +1 -1
- package/lib/stores/editor/ExplorerTreeState.js +10 -10
- package/lib/stores/editor/ExplorerTreeState.js.map +1 -1
- package/lib/stores/editor/NewElementState.d.ts +3 -3
- package/lib/stores/editor/NewElementState.d.ts.map +1 -1
- package/lib/stores/editor/NewElementState.js +2 -2
- package/lib/stores/editor/NewElementState.js.map +1 -1
- package/lib/stores/editor/editor-state/{FileGenerationViewerState.d.ts → ArtifactGenerationViewerState.d.ts} +4 -4
- package/lib/stores/editor/editor-state/ArtifactGenerationViewerState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/{FileGenerationViewerState.js → ArtifactGenerationViewerState.js} +10 -9
- package/lib/stores/editor/editor-state/ArtifactGenerationViewerState.js.map +1 -0
- package/lib/stores/editor/editor-state/FileGenerationState.js +1 -1
- package/lib/stores/editor/editor-state/FileGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts +32 -19
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.js +173 -113
- package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts +22 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js +56 -5
- package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +12 -12
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +113 -61
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts +4 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +23 -9
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +5 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +23 -16
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +11 -7
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +3 -2
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +29 -8
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts +2 -2
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js +8 -6
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +14 -2
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +75 -5
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.d.ts +4 -1
- package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.js +70 -2
- package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts +1 -2
- package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.js +4 -13
- package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts +6 -2
- package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js +23 -4
- package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js +1 -1
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts +1 -0
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js +3 -0
- package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js.map +1 -1
- package/lib/stores/project-view/ProjectViewerStore.js +1 -1
- package/lib/stores/project-view/ProjectViewerStore.js.map +1 -1
- package/package.json +14 -14
- package/src/components/editor/StatusBar.tsx +1 -4
- package/src/components/editor/editor-group/{FileGenerationViewer.tsx → ArtifactGenerationViewer.tsx} +28 -25
- package/src/components/editor/editor-group/EditorGroup.tsx +6 -6
- package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +13 -0
- package/src/components/editor/editor-group/data-editor/DataElementEditor.tsx +1 -1
- package/src/components/editor/editor-group/data-editor/EmbeddedDataEditor.tsx +130 -4
- package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +65 -0
- package/src/components/editor/editor-group/element-generation-editor/FileGenerationEditor.tsx +1 -1
- package/src/components/editor/editor-group/element-generation-editor/FileSystemViewer.tsx +4 -4
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.tsx +6 -3
- package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_SchemaSetElementEditor.tsx +1 -1
- package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +0 -6
- package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +159 -366
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +187 -61
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +26 -18
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +85 -83
- package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +2 -2
- package/src/components/editor/panel-group/DevToolPanel.tsx +14 -0
- package/src/components/editor/side-bar/CreateNewElementModal.tsx +3 -5
- package/src/components/editor/side-bar/Explorer.tsx +1 -1
- package/src/stores/editor/EditorGraphState.ts +7 -6
- package/src/stores/editor/EditorStore.ts +2 -2
- package/src/stores/editor/ExplorerTreeState.ts +10 -10
- package/src/stores/editor/NewElementState.ts +5 -5
- package/src/stores/editor/editor-state/{FileGenerationViewerState.ts → ArtifactGenerationViewerState.ts} +12 -9
- package/src/stores/editor/editor-state/FileGenerationState.ts +1 -1
- package/src/stores/editor/editor-state/GraphGenerationState.ts +258 -170
- package/src/stores/editor/editor-state/element-editor-state/ElementEditorState.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts +75 -4
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +157 -69
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +45 -10
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +37 -15
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +15 -8
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +57 -6
- package/src/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.ts +10 -6
- package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +92 -3
- package/src/stores/editor/utils/MockDataUtils.ts +109 -1
- package/src/stores/editor/utils/TestableUtils.ts +4 -19
- package/src/stores/graph-modifier/DSL_Data_GraphModifierHelper.ts +45 -6
- package/src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts +1 -1
- package/src/stores/graph-modifier/STO_Relational_GraphModifierHelper.ts +6 -0
- package/src/stores/project-view/ProjectViewerStore.ts +1 -1
- package/tsconfig.json +2 -2
- package/lib/components/editor/editor-group/FileGenerationViewer.d.ts.map +0 -1
- package/lib/components/editor/editor-group/FileGenerationViewer.js +0 -32
- package/lib/components/editor/editor-group/FileGenerationViewer.js.map +0 -1
- package/lib/stores/editor/editor-state/FileGenerationViewerState.d.ts.map +0 -1
- package/lib/stores/editor/editor-state/FileGenerationViewerState.js.map +0 -1
@@ -13,11 +13,12 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { DataElementReference, ExternalFormatData, ModelStoreData, RelationalCSVData, RelationalCSVDataTable, } from '@finos/legend-graph';
|
17
|
-
import { ContentType, guaranteeNonEmptyString, tryToFormatLosslessJSONString, UnsupportedOperationError, } from '@finos/legend-shared';
|
16
|
+
import { DataElementReference, ExternalFormatData, ModelStoreData, RelationalCSVData, RelationalCSVDataTable, ModelEmbeddedData, } from '@finos/legend-graph';
|
17
|
+
import { ContentType, guaranteeNonEmptyString, tryToFormatLosslessJSONString, UnsupportedOperationError, uuid, } from '@finos/legend-shared';
|
18
18
|
import { action, makeObservable, observable } from 'mobx';
|
19
|
-
import { dataElementReference_setDataElement, externalFormatData_setContentType, externalFormatData_setData,
|
19
|
+
import { dataElementReference_setDataElement, externalFormatData_setContentType, externalFormatData_setData, relationalData_addTable, relationalData_deleteData, relationalData_setTableName, relationalData_setTableSchemaName, relationalData_setTableValues, } from '../../../../graph-modifier/DSL_Data_GraphModifierHelper.js';
|
20
20
|
import { EmbeddedDataType } from '../../ExternalFormatState.js';
|
21
|
+
import { TEMPORARY__createRelationalDataFromCSV } from '../../../utils/TestableUtils.js';
|
21
22
|
export const createEmbeddedData = (type, editorStore) => {
|
22
23
|
if (type === EmbeddedDataType.EXTERNAL_FORMAT_DATA) {
|
23
24
|
const externalFormatData = new ExternalFormatData();
|
@@ -32,7 +33,6 @@ export const createEmbeddedData = (type, editorStore) => {
|
|
32
33
|
}
|
33
34
|
else if (type === EmbeddedDataType.MODEL_STORE_DATA) {
|
34
35
|
const modelStoreData = new ModelStoreData();
|
35
|
-
modelStoreData_setInstance(modelStoreData, new Map());
|
36
36
|
return modelStoreData;
|
37
37
|
}
|
38
38
|
else {
|
@@ -58,15 +58,20 @@ export class EmbeddedDataState {
|
|
58
58
|
}
|
59
59
|
export class ExternalFormatDataState extends EmbeddedDataState {
|
60
60
|
embeddedData;
|
61
|
+
canEditContentType = true;
|
61
62
|
constructor(editorStore, embeddedData) {
|
62
63
|
super(editorStore, embeddedData);
|
63
64
|
makeObservable(this, {
|
64
65
|
format: action,
|
66
|
+
canEditContentType: observable,
|
65
67
|
});
|
66
68
|
this.embeddedData = embeddedData;
|
67
69
|
}
|
68
70
|
label() {
|
69
|
-
return '
|
71
|
+
return 'External Format Data';
|
72
|
+
}
|
73
|
+
setCanEditoContentType(val) {
|
74
|
+
this.canEditContentType = val;
|
70
75
|
}
|
71
76
|
get supportsFormatting() {
|
72
77
|
return this.embeddedData.contentType === ContentType.APPLICATION_JSON;
|
@@ -75,15 +80,45 @@ export class ExternalFormatDataState extends EmbeddedDataState {
|
|
75
80
|
externalFormatData_setData(this.embeddedData, tryToFormatLosslessJSONString(this.embeddedData.data));
|
76
81
|
}
|
77
82
|
}
|
83
|
+
export class ModelDataState {
|
84
|
+
uuid = uuid();
|
85
|
+
modelStoreDataState;
|
86
|
+
modelData;
|
87
|
+
constructor(modelData, modelStoreDataState) {
|
88
|
+
this.modelStoreDataState = modelStoreDataState;
|
89
|
+
this.modelData = modelData;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
export class ModelEmbeddedDataState extends ModelDataState {
|
93
|
+
modelData;
|
94
|
+
embeddedDataState;
|
95
|
+
constructor(modelData, modelStoreDataState) {
|
96
|
+
super(modelData, modelStoreDataState);
|
97
|
+
this.modelData = modelData;
|
98
|
+
this.embeddedDataState = buildEmbeddedDataEditorState(this.modelData.data, this.modelStoreDataState.editorStore);
|
99
|
+
}
|
100
|
+
}
|
101
|
+
export class UnsupportedModelDataState extends ModelDataState {
|
102
|
+
}
|
78
103
|
export class ModelStoreDataState extends EmbeddedDataState {
|
79
104
|
embeddedData;
|
105
|
+
modelDataStates = [];
|
80
106
|
constructor(editorStore, embeddedData) {
|
81
107
|
super(editorStore, embeddedData);
|
82
108
|
this.embeddedData = embeddedData;
|
109
|
+
this.modelDataStates = this.buildStates();
|
83
110
|
}
|
84
111
|
label() {
|
85
112
|
return 'ModelStore Data';
|
86
113
|
}
|
114
|
+
buildStates() {
|
115
|
+
return (this.embeddedData.modelData?.map((modelData) => {
|
116
|
+
if (modelData instanceof ModelEmbeddedData) {
|
117
|
+
return new ModelEmbeddedDataState(modelData, this);
|
118
|
+
}
|
119
|
+
return new UnsupportedModelDataState(modelData, this);
|
120
|
+
}) ?? []);
|
121
|
+
}
|
87
122
|
}
|
88
123
|
export class RelationalCSVDataTableState {
|
89
124
|
editorStore;
|
@@ -153,6 +188,7 @@ export class RelationalCSVDataState extends EmbeddedDataState {
|
|
153
188
|
showTableIdentifierModal = false;
|
154
189
|
tableIdentifierState;
|
155
190
|
selectedTable;
|
191
|
+
showImportCSVModal = false;
|
156
192
|
constructor(editorStore, embeddedData) {
|
157
193
|
super(editorStore, embeddedData);
|
158
194
|
makeObservable(this, {
|
@@ -160,24 +196,39 @@ export class RelationalCSVDataState extends EmbeddedDataState {
|
|
160
196
|
showTableIdentifierModal: observable,
|
161
197
|
deleteTable: observable,
|
162
198
|
tableIdentifierState: observable,
|
199
|
+
showImportCSVModal: observable,
|
163
200
|
resetSelectedTable: action,
|
164
201
|
changeSelectedTable: action,
|
165
202
|
closeModal: action,
|
166
203
|
openIdentifierModal: action,
|
204
|
+
setShowImportCsvModal: action,
|
205
|
+
closeCSVModal: action,
|
206
|
+
importCSV: action,
|
167
207
|
});
|
168
208
|
this.embeddedData = embeddedData;
|
169
209
|
this.tableIdentifierState = new IdentifierTableState(this);
|
170
210
|
this.resetSelectedTable();
|
171
211
|
}
|
212
|
+
setShowImportCsvModal(val) {
|
213
|
+
this.showImportCSVModal = val;
|
214
|
+
}
|
172
215
|
openIdentifierModal(renameTable) {
|
173
216
|
this.showTableIdentifierModal = true;
|
174
217
|
this.tableIdentifierState.setTable(renameTable);
|
175
218
|
}
|
219
|
+
closeCSVModal() {
|
220
|
+
this.showImportCSVModal = false;
|
221
|
+
}
|
176
222
|
closeModal() {
|
177
223
|
this.tableIdentifierState.setSchemaName('');
|
178
224
|
this.tableIdentifierState.setTableName('');
|
179
225
|
this.showTableIdentifierModal = false;
|
180
226
|
}
|
227
|
+
importCSV(val) {
|
228
|
+
const generated = TEMPORARY__createRelationalDataFromCSV(val);
|
229
|
+
generated.tables.forEach((t) => relationalData_addTable(this.embeddedData, t));
|
230
|
+
this.resetSelectedTable();
|
231
|
+
}
|
181
232
|
resetSelectedTable() {
|
182
233
|
const table = this.embeddedData.tables[0];
|
183
234
|
if (table) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"EmbeddedDataState.js","sourceRoot":"","sources":["../../../../../../src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAIL,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,
|
1
|
+
{"version":3,"file":"EmbeddedDataState.js","sourceRoot":"","sources":["../../../../../../src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAIL,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,6BA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;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACzD,KAAK;QACH,OAAO,2BAA2B,CAAC;IACrC,CAAC;CACF;AAED,MAAM,UAAU,4BAA4B,CAC1C,aAA2B,EAC3B,WAAwB;IAExB,MAAM,YAAY,GAAG,aAAa,CAAC;IACnC,IAAI,YAAY,YAAY,kBAAkB,EAAE;QAC9C,OAAO,IAAI,uBAAuB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAC/D;SAAM,IAAI,YAAY,YAAY,cAAc,EAAE;QACjD,OAAO,IAAI,mBAAmB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAC3D;SAAM,IAAI,YAAY,YAAY,iBAAiB,EAAE;QACpD,OAAO,IAAI,sBAAsB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAC9D;SAAM,IAAI,YAAY,YAAY,oBAAoB,EAAE;QACvD,OAAO,IAAI,yBAAyB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KACjE;SAAM;QACL,MAAM,oCAAoC,GAAG,WAAW,CAAC,aAAa;aACnE,qBAAqB,EAAE;aACvB,OAAO,CACN,CAAC,MAAM,EAAE,EAAE,CAEP,MACD,CAAC,uCAAuC,EAAE,EAAE,IAAI,EAAE,CACtD,CAAC;QACJ,KAAK,MAAM,YAAY,IAAI,oCAAoC,EAAE;YAC/D,MAAM,KAAK,GAAG,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YACtD,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,oBAAoB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;KAC5D;AACH,CAAC"}
|
@@ -16,10 +16,10 @@
|
|
16
16
|
import { type Mapping, type MappingTestSuite, type Class, type MappingModelCoverageAnalysisResult, type RawLambda, type MappingTest, type SetImplementation, type TestAssertion, type AtomicTest, type Store, type DataElement, MappingDataTestSuite, MappingQueryTestSuite, MappingDataTest, MappingQueryTest, StoreTestData } from '@finos/legend-graph';
|
17
17
|
import { ActionState, type GeneratorFn } from '@finos/legend-shared';
|
18
18
|
import { LambdaEditorState } from '@finos/legend-query-builder';
|
19
|
-
import type { EditorStore } from '../../../../EditorStore.js';
|
20
19
|
import { type MappingEditorState } from '../MappingEditorState.js';
|
21
|
-
import { TESTABLE_TEST_TAB, TestableTestEditorState } from '../../testable/TestableEditorState.js';
|
20
|
+
import { TESTABLE_TEST_TAB, TestableTestEditorState, TestableTestSuiteEditorState } from '../../testable/TestableEditorState.js';
|
22
21
|
import { EmbeddedDataEditorState } from '../../data/DataEditorState.js';
|
22
|
+
import type { EditorStore } from '../../../../EditorStore.js';
|
23
23
|
export declare enum MAPPING_TEST_SUITE_TYPE {
|
24
24
|
DATA = "DATA",
|
25
25
|
QUERY = "QUERY"
|
@@ -77,22 +77,19 @@ export declare class MappingDataTestState extends MappingTestState {
|
|
77
77
|
constructor(editorStore: EditorStore, mappingTestableState: MappingTestableState, test: MappingDataTest);
|
78
78
|
defaultTab(): TESTABLE_TEST_TAB;
|
79
79
|
}
|
80
|
-
export declare abstract class MappingTestSuiteState {
|
81
|
-
readonly editorStore: EditorStore;
|
80
|
+
export declare abstract class MappingTestSuiteState extends TestableTestSuiteEditorState {
|
82
81
|
readonly mappingTestableState: MappingTestableState;
|
83
|
-
readonly uuid: string;
|
84
82
|
suite: MappingTestSuite;
|
85
|
-
|
83
|
+
testStates: MappingTestState[];
|
86
84
|
selectTestState: MappingTestState | undefined;
|
87
85
|
showCreateModal: boolean;
|
88
86
|
constructor(editorStore: EditorStore, mappingTestableState: MappingTestableState, suite: MappingTestSuite);
|
89
87
|
buildTestStates(): MappingTestState[];
|
88
|
+
abstract getDefaultClass(): Class | undefined;
|
90
89
|
abstract buildTestState(val: MappingTest): MappingTestState | undefined;
|
91
90
|
addNewTest(id: string, _class: Class | undefined): void;
|
92
91
|
abstract createNewTest(id: string, _class: Class | undefined): MappingTest;
|
93
92
|
setShowModal(val: boolean): void;
|
94
|
-
runTests(): void;
|
95
|
-
runFailingTests(): void;
|
96
93
|
changeTest(val: MappingTest): void;
|
97
94
|
deleteTest(val: MappingTest): void;
|
98
95
|
removeTestState(val: MappingTest): void;
|
@@ -100,31 +97,34 @@ export declare abstract class MappingTestSuiteState {
|
|
100
97
|
export declare class MappingDataTestSuiteState extends MappingTestSuiteState {
|
101
98
|
suite: MappingDataTestSuite;
|
102
99
|
dataState: MappingTestableDataState;
|
103
|
-
|
100
|
+
testStates: MappingQueryTestState[];
|
104
101
|
selectTestState: MappingQueryTestState | undefined;
|
105
102
|
constructor(editorStore: EditorStore, mappingTestableState: MappingTestableState, suite: MappingDataTestSuite);
|
106
103
|
buildTestState(val: MappingTest): MappingTestState | undefined;
|
107
104
|
createNewTest(id: string, _class: Class | undefined): MappingTest;
|
105
|
+
getDefaultClass(): Class | undefined;
|
108
106
|
}
|
109
107
|
export declare class MappingQueryTestSuiteState extends MappingTestSuiteState {
|
110
108
|
suite: MappingQueryTestSuite;
|
111
|
-
|
109
|
+
testStates: MappingDataTestState[];
|
112
110
|
selectTestState: MappingDataTestState | undefined;
|
113
111
|
queryState: MappingTestableQueryState;
|
114
112
|
constructor(editorStore: EditorStore, mappingTestableState: MappingTestableState, suite: MappingQueryTestSuite);
|
115
113
|
buildTestState(val: MappingTest): MappingTestState | undefined;
|
116
114
|
createNewTest(id: string, _class: Class | undefined): MappingTest;
|
117
115
|
buildQueryState(): MappingTestableQueryState;
|
116
|
+
getDefaultClass(): Class | undefined;
|
118
117
|
}
|
119
118
|
export declare class CreateSuiteState {
|
120
119
|
readonly editorStore: EditorStore;
|
121
120
|
readonly mappingTestableState: MappingTestableState;
|
122
121
|
showModal: boolean;
|
122
|
+
isCreatingSuiteState: ActionState;
|
123
123
|
constructor(editorStore: EditorStore, mappingTestableState: MappingTestableState);
|
124
124
|
setShowModal(val: boolean): void;
|
125
|
-
createAndAddTestSuite(_class: Class, type: MAPPING_TEST_SUITE_TYPE, name: string): GeneratorFn<void>;
|
125
|
+
createAndAddTestSuite(_class: Class, type: MAPPING_TEST_SUITE_TYPE, name: string, testName: string): GeneratorFn<void>;
|
126
126
|
createDefaultQuery(_class: Class): RawLambda;
|
127
|
-
attemptToGenerateTestData(setImpl: SetImplementation): StoreTestData | undefined;
|
127
|
+
attemptToGenerateTestData(setImpl: SetImplementation, editorStore: EditorStore): StoreTestData | undefined;
|
128
128
|
}
|
129
129
|
export declare class MappingTestableState {
|
130
130
|
readonly editorStore: EditorStore;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"MappingTestableState.d.ts","sourceRoot":"","sources":["../../../../../../../src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,kCAAkC,EAEvC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,KAAK,EACV,KAAK,WAAW,EAKhB,oBAAoB,EACpB,qBAAqB,EAWrB,eAAe,EACf,gBAAgB,EAEhB,aAAa,
|
1
|
+
{"version":3,"file":"MappingTestableState.d.ts","sourceRoot":"","sources":["../../../../../../../src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,KAAK,EACV,KAAK,kCAAkC,EAEvC,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,KAAK,EACV,KAAK,WAAW,EAKhB,oBAAoB,EACpB,qBAAqB,EAWrB,eAAe,EACf,gBAAgB,EAEhB,aAAa,EAgBd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,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AAW,GACvB,aAAa,GAAG,SAAS;CAsC7B;AAED,qBAAa,oBAAoB;IAC/B,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAChD,iBAAiB,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACrD,yBAAyB,EACrB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,SAAS,CAAC;IAEd,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,iCAAiC,cAAwB;IACzD,kCAAkC,EAC9B,kCAAkC,GAClC,SAAS,CAAC;gBAGZ,WAAW,EAAE,WAAW,EACxB,kBAAkB,EAAE,kBAAkB;IAqBxC,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAOtD,IAAI,IAAI,IAAI;IAQZ,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAM1C,kBAAkB,CAChB,SAAS,EAAE,gBAAgB,GAAG,UAAU,GAAG,SAAS,GACnD,IAAI;IAIP,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI;IAOlD,oBAAoB,IAAI,qBAAqB,EAAE;IAM/C,mBAAmB,CACjB,GAAG,EAAE,gBAAgB,GACpB,qBAAqB,GAAG,SAAS;IAUnC,2BAA2B,IAAI,WAAW,CAAC,IAAI,CAAC;IAoBjD,YAAY,IAAI,IAAI;IAIpB,mBAAmB,IAAI,IAAI;CAG5B"}
|
package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js
CHANGED
@@ -13,17 +13,18 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { LAMBDA_PIPE, buildSourceInformationSourceId, isStubbed_RawLambda, GRAPH_MANAGER_EVENT, MappingDataTestSuite, MappingQueryTestSuite, RootGraphFetchTree, PackageableElementExplicitReference, EntityMappedProperty, PropertyGraphFetchTree, PropertyExplicitReference, LambdaFunction, FunctionType, Multiplicity, CORE_PURE_PATH, buildRawLambdaFromLambdaFunction, MappingDataTest, MappingQueryTest, PureInstanceSetImplementation, StoreTestData, ModelStore, getRootSetImplementation, stub_RawLambda, DataElementReference, RelationalCSVData, getAllClassProperties, getAllClassDerivedProperties, RelationalInstanceSetImplementation, EmbeddedRelationalInstanceSetImplementation,
|
16
|
+
import { LAMBDA_PIPE, buildSourceInformationSourceId, isStubbed_RawLambda, GRAPH_MANAGER_EVENT, MappingDataTestSuite, MappingQueryTestSuite, RootGraphFetchTree, PackageableElementExplicitReference, EntityMappedProperty, PropertyGraphFetchTree, PropertyExplicitReference, LambdaFunction, FunctionType, Multiplicity, CORE_PURE_PATH, buildRawLambdaFromLambdaFunction, MappingDataTest, MappingQueryTest, PureInstanceSetImplementation, StoreTestData, ModelStore, getRootSetImplementation, stub_RawLambda, DataElementReference, RelationalCSVData, getAllClassProperties, getAllClassDerivedProperties, RelationalInstanceSetImplementation, EmbeddedRelationalInstanceSetImplementation, TableAlias, Table, RelationalCSVDataTable, ModelStoreData, ModelEmbeddedData, getMappingCompatibleClasses, } from '@finos/legend-graph';
|
17
17
|
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
18
|
-
import { ActionState, assertErrorThrown, guaranteeNonNullable, assertTrue, isNonNullable, UnsupportedOperationError, LogEvent, uuid, } from '@finos/legend-shared';
|
18
|
+
import { ActionState, assertErrorThrown, guaranteeNonNullable, assertTrue, isNonNullable, UnsupportedOperationError, LogEvent, uuid, filterByType, } from '@finos/legend-shared';
|
19
19
|
import { LambdaEditorState, buildGetAllFunction, buildSerialzieFunctionWithGraphFetch, } from '@finos/legend-query-builder';
|
20
|
-
import {
|
20
|
+
import { getMappingElementSource, } from '../MappingEditorState.js';
|
21
21
|
import { mappingTestable_addStoreTestData, mappingTestable_deleteStoreTestData, mappingTestable_setQuery, mapping_addTestSuite, mapping_deleteTestSuite, } from '../../../../../graph-modifier/DSL_Mapping_GraphModifierHelper.js';
|
22
22
|
import { DEFAULT_TEST_ASSERTION_ID, createBareExternalFormat, createDefaultEqualToJSONTestAssertion, createEmbeddedDataFromClass, } from '../../../../utils/TestableUtils.js';
|
23
|
-
import { TESTABLE_TEST_TAB, TestableTestEditorState, } from '../../testable/TestableEditorState.js';
|
23
|
+
import { TESTABLE_TEST_TAB, TestableTestEditorState, TestableTestSuiteEditorState, } from '../../testable/TestableEditorState.js';
|
24
24
|
import { EmbeddedDataEditorState } from '../../data/DataEditorState.js';
|
25
25
|
import { testSuite_addTest, testSuite_deleteTest, testable_setId, } from '../../../../../graph-modifier/Testable_GraphModifierHelper.js';
|
26
26
|
import { EmbeddedDataType } from '../../../ExternalFormatState.js';
|
27
|
+
import { createMockDataForTable } from '../../../../utils/MockDataUtils.js';
|
27
28
|
export var MAPPING_TEST_SUITE_TYPE;
|
28
29
|
(function (MAPPING_TEST_SUITE_TYPE) {
|
29
30
|
MAPPING_TEST_SUITE_TYPE["DATA"] = "DATA";
|
@@ -36,22 +37,42 @@ const createGraphFetchLambda = (mainClass, graphManagerState, root) => {
|
|
36
37
|
lambdaFunction.expressionSequence = [serialize];
|
37
38
|
return buildRawLambdaFromLambdaFunction(lambdaFunction, graphManagerState);
|
38
39
|
};
|
39
|
-
const
|
40
|
+
const createBareModelStoreData = (_class, editorStore) => {
|
41
|
+
const embeddedData = createEmbeddedDataFromClass(_class, editorStore);
|
42
|
+
const testData = new StoreTestData();
|
43
|
+
const modelStoreData = new ModelStoreData();
|
44
|
+
const modelData = new ModelEmbeddedData();
|
45
|
+
modelData.data = embeddedData;
|
46
|
+
modelData.model = PackageableElementExplicitReference.create(_class);
|
47
|
+
modelStoreData.modelData = [modelData];
|
48
|
+
testData.data = modelStoreData;
|
49
|
+
testData.store = PackageableElementExplicitReference.create(ModelStore.INSTANCE);
|
50
|
+
return testData;
|
51
|
+
};
|
52
|
+
const createBareMappingDataTest = (id, storeTestData, suite) => {
|
40
53
|
const dataTest = new MappingDataTest();
|
41
54
|
dataTest.id = id;
|
42
55
|
dataTest.storeTestData = storeTestData ? [storeTestData] : [];
|
43
56
|
dataTest.assertions = [
|
44
57
|
createDefaultEqualToJSONTestAssertion(DEFAULT_TEST_ASSERTION_ID),
|
45
58
|
];
|
59
|
+
if (suite) {
|
60
|
+
dataTest.__parent = suite;
|
61
|
+
suite.tests.push(dataTest);
|
62
|
+
}
|
46
63
|
return dataTest;
|
47
64
|
};
|
48
|
-
const createBareMappingQueryTest = (id, query) => {
|
65
|
+
const createBareMappingQueryTest = (id, query, suite) => {
|
49
66
|
const dataTest = new MappingQueryTest();
|
50
67
|
dataTest.id = id;
|
51
|
-
dataTest.
|
68
|
+
dataTest.func = query;
|
52
69
|
dataTest.assertions = [
|
53
70
|
createDefaultEqualToJSONTestAssertion(DEFAULT_TEST_ASSERTION_ID),
|
54
71
|
];
|
72
|
+
if (suite) {
|
73
|
+
dataTest.__parent = suite;
|
74
|
+
suite.tests.push(dataTest);
|
75
|
+
}
|
55
76
|
return dataTest;
|
56
77
|
};
|
57
78
|
export class MappingTestableQueryState extends LambdaEditorState {
|
@@ -224,8 +245,8 @@ export class MappingQueryTestState extends MappingTestState {
|
|
224
245
|
return TESTABLE_TEST_TAB.SETUP;
|
225
246
|
}
|
226
247
|
buildQueryState() {
|
227
|
-
const queryState = new MappingTestableQueryState(this.editorStore, this.test, this.test.
|
228
|
-
flowResult(queryState.updateLamba(this.test.
|
248
|
+
const queryState = new MappingTestableQueryState(this.editorStore, this.test, this.test.func);
|
249
|
+
flowResult(queryState.updateLamba(this.test.func)).catch(this.editorStore.applicationStore.alertUnhandledError);
|
229
250
|
return queryState;
|
230
251
|
}
|
231
252
|
}
|
@@ -253,26 +274,21 @@ export class MappingDataTestState extends MappingTestState {
|
|
253
274
|
this.dataState = new MappingTestableDataState(this.editorStore, mappingTestableState, test);
|
254
275
|
}
|
255
276
|
defaultTab() {
|
256
|
-
// return this.test.storeTestData.length
|
257
|
-
// ? TESTABLE_TEST_TAB.ASSERTIONS
|
258
|
-
// : TESTABLE_TEST_TAB.SETUP;
|
259
277
|
return TESTABLE_TEST_TAB.SETUP;
|
260
278
|
}
|
261
279
|
}
|
262
|
-
export class MappingTestSuiteState {
|
263
|
-
editorStore;
|
280
|
+
export class MappingTestSuiteState extends TestableTestSuiteEditorState {
|
264
281
|
mappingTestableState;
|
265
|
-
uuid = uuid();
|
266
282
|
suite;
|
267
|
-
|
283
|
+
testStates = [];
|
268
284
|
selectTestState;
|
269
285
|
showCreateModal = false;
|
270
286
|
constructor(editorStore, mappingTestableState, suite) {
|
271
|
-
|
287
|
+
super(mappingTestableState.mapping, suite, mappingTestableState.mappingEditorState.isReadOnly, editorStore);
|
272
288
|
this.mappingTestableState = mappingTestableState;
|
273
289
|
this.suite = suite;
|
274
|
-
this.
|
275
|
-
this.selectTestState = this.
|
290
|
+
this.testStates = this.buildTestStates();
|
291
|
+
this.selectTestState = this.testStates[0];
|
276
292
|
}
|
277
293
|
buildTestStates() {
|
278
294
|
return this.suite.tests
|
@@ -285,33 +301,27 @@ export class MappingTestSuiteState {
|
|
285
301
|
.observerContext);
|
286
302
|
const testState = this.buildTestState(test);
|
287
303
|
if (testState) {
|
288
|
-
this.
|
304
|
+
this.testStates.push(testState);
|
289
305
|
}
|
290
306
|
this.selectTestState = testState;
|
291
307
|
}
|
292
308
|
setShowModal(val) {
|
293
309
|
this.showCreateModal = val;
|
294
310
|
}
|
295
|
-
runTests() {
|
296
|
-
// TODO
|
297
|
-
}
|
298
|
-
runFailingTests() {
|
299
|
-
// console
|
300
|
-
}
|
301
311
|
changeTest(val) {
|
302
312
|
if (this.selectTestState?.test !== val) {
|
303
|
-
this.selectTestState = this.
|
313
|
+
this.selectTestState = this.testStates.find((testState) => testState.test === val);
|
304
314
|
}
|
305
315
|
}
|
306
316
|
deleteTest(val) {
|
307
317
|
testSuite_deleteTest(this.suite, val);
|
308
318
|
this.removeTestState(val);
|
309
319
|
if (this.selectTestState?.test === val) {
|
310
|
-
this.selectTestState = this.
|
320
|
+
this.selectTestState = this.testStates[0];
|
311
321
|
}
|
312
322
|
}
|
313
323
|
removeTestState(val) {
|
314
|
-
this.
|
324
|
+
this.testStates = this.testStates.filter((e) => e.test !== val);
|
315
325
|
}
|
316
326
|
}
|
317
327
|
export class MappingDataTestSuiteState extends MappingTestSuiteState {
|
@@ -320,7 +330,7 @@ export class MappingDataTestSuiteState extends MappingTestSuiteState {
|
|
320
330
|
constructor(editorStore, mappingTestableState, suite) {
|
321
331
|
super(editorStore, mappingTestableState, suite);
|
322
332
|
makeObservable(this, {
|
323
|
-
|
333
|
+
testStates: observable,
|
324
334
|
selectTestState: observable,
|
325
335
|
showCreateModal: observable,
|
326
336
|
buildTestStates: action,
|
@@ -329,6 +339,8 @@ export class MappingDataTestSuiteState extends MappingTestSuiteState {
|
|
329
339
|
removeTestState: action,
|
330
340
|
addNewTest: action,
|
331
341
|
setShowModal: action,
|
342
|
+
runFailingTests: flow,
|
343
|
+
runSuite: flow,
|
332
344
|
});
|
333
345
|
this.suite = suite;
|
334
346
|
this.dataState = new MappingTestableDataState(this.editorStore, mappingTestableState, suite);
|
@@ -343,7 +355,11 @@ export class MappingDataTestSuiteState extends MappingTestSuiteState {
|
|
343
355
|
const query = _class
|
344
356
|
? this.mappingTestableState.createSuiteState.createDefaultQuery(_class)
|
345
357
|
: stub_RawLambda();
|
346
|
-
return createBareMappingQueryTest(id, query);
|
358
|
+
return createBareMappingQueryTest(id, query, this.suite);
|
359
|
+
}
|
360
|
+
getDefaultClass() {
|
361
|
+
return getMappingCompatibleClasses(this.dataState.mappingTestableState.mapping, this.dataState.mappingTestableState.editorStore.graphManagerState
|
362
|
+
.usableClasses)[0];
|
347
363
|
}
|
348
364
|
}
|
349
365
|
export class MappingQueryTestSuiteState extends MappingTestSuiteState {
|
@@ -353,7 +369,7 @@ export class MappingQueryTestSuiteState extends MappingTestSuiteState {
|
|
353
369
|
super(editorStore, mappingTestableState, suite);
|
354
370
|
makeObservable(this, {
|
355
371
|
queryState: observable,
|
356
|
-
|
372
|
+
testStates: observable,
|
357
373
|
selectTestState: observable,
|
358
374
|
showCreateModal: observable,
|
359
375
|
deleteTest: action,
|
@@ -362,6 +378,8 @@ export class MappingQueryTestSuiteState extends MappingTestSuiteState {
|
|
362
378
|
addNewTest: action,
|
363
379
|
changeTest: action,
|
364
380
|
setShowModal: action,
|
381
|
+
runFailingTests: flow,
|
382
|
+
runSuite: flow,
|
365
383
|
});
|
366
384
|
this.suite = suite;
|
367
385
|
this.queryState = this.buildQueryState();
|
@@ -373,18 +391,32 @@ export class MappingQueryTestSuiteState extends MappingTestSuiteState {
|
|
373
391
|
return undefined;
|
374
392
|
}
|
375
393
|
createNewTest(id, _class) {
|
376
|
-
|
394
|
+
const data = _class
|
395
|
+
? createBareModelStoreData(_class, this.mappingTestableState.editorStore)
|
396
|
+
: undefined;
|
397
|
+
return createBareMappingDataTest(id, data, this.suite);
|
377
398
|
}
|
378
399
|
buildQueryState() {
|
379
|
-
const queryState = new MappingTestableQueryState(this.editorStore, this.suite, this.suite.
|
380
|
-
flowResult(queryState.updateLamba(this.suite.
|
400
|
+
const queryState = new MappingTestableQueryState(this.editorStore, this.suite, this.suite.func);
|
401
|
+
flowResult(queryState.updateLamba(this.suite.func)).catch(this.editorStore.applicationStore.alertUnhandledError);
|
381
402
|
return queryState;
|
382
403
|
}
|
404
|
+
getDefaultClass() {
|
405
|
+
const dataTest = this.suite.tests.filter(filterByType(MappingDataTest))[0];
|
406
|
+
if (dataTest) {
|
407
|
+
const storeTestData = dataTest.storeTestData[0]?.data;
|
408
|
+
if (storeTestData instanceof ModelStoreData) {
|
409
|
+
return storeTestData.modelData?.[0]?.model.value;
|
410
|
+
}
|
411
|
+
}
|
412
|
+
return undefined;
|
413
|
+
}
|
383
414
|
}
|
384
415
|
export class CreateSuiteState {
|
385
416
|
editorStore;
|
386
417
|
mappingTestableState;
|
387
418
|
showModal = false;
|
419
|
+
isCreatingSuiteState = ActionState.create();
|
388
420
|
constructor(editorStore, mappingTestableState) {
|
389
421
|
this.editorStore = editorStore;
|
390
422
|
this.mappingTestableState = mappingTestableState;
|
@@ -392,54 +424,67 @@ export class CreateSuiteState {
|
|
392
424
|
showModal: observable,
|
393
425
|
setShowModal: action,
|
394
426
|
createAndAddTestSuite: flow,
|
427
|
+
isCreatingSuiteState: observable,
|
395
428
|
});
|
396
429
|
}
|
397
430
|
setShowModal(val) {
|
398
431
|
this.showModal = val;
|
399
432
|
}
|
400
|
-
*createAndAddTestSuite(_class, type, name) {
|
433
|
+
*createAndAddTestSuite(_class, type, name, testName) {
|
401
434
|
// type
|
402
435
|
try {
|
436
|
+
this.isCreatingSuiteState.inProgress();
|
403
437
|
const mappingTestableState = this.mappingTestableState;
|
404
438
|
if (!mappingTestableState.mappingModelCoverageAnalysisResult) {
|
439
|
+
this.isCreatingSuiteState.setMessage('Analyzing mapping to generate test query...');
|
405
440
|
yield flowResult(mappingTestableState.analyzeMappingModelCoverage());
|
406
441
|
}
|
442
|
+
this.isCreatingSuiteState.setMessage('Creating test query...');
|
407
443
|
const rootSetImpl = getRootSetImplementation(this.mappingTestableState.mapping, _class);
|
408
444
|
const query = this.createDefaultQuery(_class);
|
409
445
|
const storeTestData = rootSetImpl
|
410
|
-
? this.attemptToGenerateTestData(rootSetImpl)
|
446
|
+
? this.attemptToGenerateTestData(rootSetImpl, this.editorStore)
|
411
447
|
: undefined;
|
412
448
|
let testSuite;
|
413
|
-
const test1 = `test_1`;
|
414
|
-
const assertionId = 'assertion_1';
|
415
449
|
if (type === MAPPING_TEST_SUITE_TYPE.DATA) {
|
416
450
|
const dataSuite = new MappingDataTestSuite();
|
417
451
|
dataSuite.storeTestData = storeTestData ? [storeTestData] : [];
|
418
|
-
const test =
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
452
|
+
const test = createBareMappingQueryTest(testName, query, dataSuite);
|
453
|
+
test.__parent = dataSuite;
|
454
|
+
dataSuite.tests = [test];
|
455
|
+
const _assertion = createDefaultEqualToJSONTestAssertion(`${testName}_assertion1`);
|
456
|
+
test.assertions = [_assertion];
|
457
|
+
_assertion.parentTest = test;
|
424
458
|
testSuite = dataSuite;
|
425
459
|
}
|
426
460
|
else {
|
427
461
|
const querySuite = new MappingQueryTestSuite();
|
428
|
-
querySuite.
|
429
|
-
testSuite = querySuite;
|
462
|
+
querySuite.func = query;
|
430
463
|
// add test
|
431
|
-
|
464
|
+
const _test = createBareMappingDataTest(testName, storeTestData, querySuite);
|
465
|
+
const _assertion = createDefaultEqualToJSONTestAssertion(`${testName}_assertion1`);
|
466
|
+
_test.assertions = [_assertion];
|
467
|
+
_assertion.parentTest = _test;
|
468
|
+
testSuite = querySuite;
|
432
469
|
}
|
433
470
|
testSuite.id = name;
|
434
471
|
mapping_addTestSuite(this.mappingTestableState.mapping, testSuite, this.editorStore.changeDetectionState.observerContext);
|
435
472
|
this.mappingTestableState.changeSuite(testSuite);
|
473
|
+
const selectTestState = this.mappingTestableState.selectedTestSuite?.selectTestState;
|
474
|
+
const selectedAsertionState = selectTestState?.selectedAsertionState;
|
475
|
+
if (selectTestState && selectedAsertionState) {
|
476
|
+
this.isCreatingSuiteState.setMessage('Attempting to generate expected result...');
|
477
|
+
yield flowResult(selectedAsertionState.generateExpected());
|
478
|
+
}
|
479
|
+
this.setShowModal(false);
|
436
480
|
}
|
437
481
|
catch (error) {
|
438
482
|
assertErrorThrown(error);
|
439
483
|
this.editorStore.applicationStore.notificationService.notifyError(`Unable to create to test suite: ${error.message}`);
|
440
484
|
}
|
441
485
|
finally {
|
442
|
-
this.
|
486
|
+
this.isCreatingSuiteState.complete();
|
487
|
+
this.isCreatingSuiteState.setMessage(undefined);
|
443
488
|
}
|
444
489
|
}
|
445
490
|
createDefaultQuery(_class) {
|
@@ -476,26 +521,33 @@ export class CreateSuiteState {
|
|
476
521
|
}
|
477
522
|
}
|
478
523
|
// change to use api call for relational
|
479
|
-
attemptToGenerateTestData(setImpl) {
|
524
|
+
attemptToGenerateTestData(setImpl, editorStore) {
|
480
525
|
if (setImpl instanceof RelationalInstanceSetImplementation ||
|
481
526
|
setImpl instanceof EmbeddedRelationalInstanceSetImplementation ||
|
482
527
|
setImpl instanceof EmbeddedRelationalInstanceSetImplementation) {
|
483
|
-
const
|
484
|
-
if (
|
485
|
-
const
|
486
|
-
|
487
|
-
|
488
|
-
|
528
|
+
const _table = getMappingElementSource(setImpl, editorStore.pluginManager.getApplicationPlugins());
|
529
|
+
if (_table instanceof TableAlias) {
|
530
|
+
const relation = _table.relation.value;
|
531
|
+
const owner = relation.schema._OWNER;
|
532
|
+
const val = new RelationalCSVData();
|
533
|
+
if (relation instanceof Table) {
|
534
|
+
const mockTable = new RelationalCSVDataTable();
|
535
|
+
const values = createMockDataForTable(relation);
|
536
|
+
mockTable.table = relation.name;
|
537
|
+
mockTable.schema = relation.schema.name;
|
538
|
+
mockTable.values = values;
|
539
|
+
val.tables.push(mockTable);
|
540
|
+
}
|
541
|
+
const testData = new StoreTestData();
|
542
|
+
testData.data = val;
|
543
|
+
testData.store = PackageableElementExplicitReference.create(owner);
|
544
|
+
return testData;
|
489
545
|
}
|
490
546
|
}
|
491
547
|
else if (setImpl instanceof PureInstanceSetImplementation) {
|
492
548
|
const srcClass = setImpl.srcClass;
|
493
549
|
if (srcClass) {
|
494
|
-
|
495
|
-
const testData = new StoreTestData();
|
496
|
-
testData.data = embeddedData;
|
497
|
-
testData.store = PackageableElementExplicitReference.create(ModelStore.INSTANCE);
|
498
|
-
return testData;
|
550
|
+
return createBareModelStoreData(srcClass.value, this.mappingTestableState.editorStore);
|
499
551
|
}
|
500
552
|
}
|
501
553
|
return undefined;
|