@finos/legend-application-studio 24.1.0 → 24.1.1
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/__lib__/LegendStudioApplicationNavigationContext.d.ts +1 -0
- package/lib/__lib__/LegendStudioApplicationNavigationContext.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js +1 -0
- package/lib/__lib__/LegendStudioApplicationNavigationContext.js.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.d.ts +13 -0
- package/lib/application/LegendStudioApplicationConfig.d.ts.map +1 -1
- package/lib/application/LegendStudioApplicationConfig.js +11 -0
- package/lib/application/LegendStudioApplicationConfig.js.map +1 -1
- package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.d.ts +23 -0
- package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.js +387 -0
- package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.js.map +1 -0
- package/lib/components/editor/editor-group/mapping-editor/{MappingTestEditor.d.ts → DEPRECATED__MappingTestEditor.d.ts} +10 -10
- package/lib/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.d.ts.map +1 -0
- package/lib/components/editor/editor-group/mapping-editor/{MappingTestEditor.js → DEPRECATED__MappingTestEditor.js} +16 -16
- package/lib/components/editor/editor-group/mapping-editor/DEPRECATED__MappingTestEditor.js.map +1 -0
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts +3 -0
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +31 -7
- package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.d.ts +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.d.ts.map +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.js +1 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestsExplorer.js.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js +2 -2
- package/lib/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.js +3 -4
- package/lib/components/editor/editor-group/service-editor/NewServiceModal.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +18 -10
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.d.ts +20 -0
- package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.d.ts.map +1 -0
- package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.js +39 -0
- package/lib/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.js.map +1 -0
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts +0 -9
- 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 -14
- 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 +2 -28
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/testable/TestAssertionEditor.d.ts +21 -0
- package/lib/components/editor/editor-group/testable/TestAssertionEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/testable/TestAssertionEditor.js +40 -1
- package/lib/components/editor/editor-group/testable/TestAssertionEditor.js.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.d.ts.map +1 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js +3 -1
- package/lib/components/editor/side-bar/testable/GlobalTestRunner.js.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateProjectModal.js +2 -2
- package/lib/components/workspace-setup/CreateProjectModal.js.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.d.ts.map +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js +1 -1
- package/lib/components/workspace-setup/CreateWorkspaceModal.js.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.d.ts.map +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js +1 -1
- package/lib/components/workspace-setup/WorkspaceSetup.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +4 -4
- package/lib/stores/editor/editor-state/element-editor-state/mapping/{MappingTestState.d.ts → DEPRECATED__MappingTestState.d.ts} +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/{MappingTestState.js → DEPRECATED__MappingTestState.js} +3 -3
- package/lib/stores/editor/editor-state/element-editor-state/mapping/DEPRECATED__MappingTestState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts +9 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js +20 -4
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +157 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +540 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts +13 -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 +39 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts +2 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js +1 -0
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts +4 -2
- package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.js +17 -8
- package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.d.ts +7 -3
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js +16 -3
- package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts +4 -2
- package/lib/stores/graph-modifier/Testable_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js +7 -1
- package/lib/stores/graph-modifier/Testable_GraphModifierHelper.js.map +1 -1
- package/package.json +14 -14
- package/src/__lib__/LegendStudioApplicationNavigationContext.ts +1 -0
- package/src/application/LegendStudioApplicationConfig.ts +25 -1
- package/src/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.tsx +1431 -0
- package/src/components/editor/editor-group/mapping-editor/{MappingTestEditor.tsx → DEPRECATED__MappingTestEditor.tsx} +19 -16
- package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +80 -5
- package/src/components/editor/editor-group/mapping-editor/MappingTestsExplorer.tsx +1 -1
- package/src/components/editor/editor-group/project-configuration-editor/ProjectConfigurationEditor.tsx +0 -4
- package/src/components/editor/editor-group/service-editor/NewServiceModal.tsx +5 -6
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +29 -25
- package/src/components/editor/editor-group/service-editor/TEMPORARY__SnowflakeServiceDeployer.tsx +79 -0
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +2 -52
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +8 -89
- package/src/components/editor/editor-group/testable/TestAssertionEditor.tsx +141 -0
- package/src/components/editor/side-bar/testable/GlobalTestRunner.tsx +10 -0
- package/src/components/workspace-setup/CreateProjectModal.tsx +0 -2
- package/src/components/workspace-setup/CreateWorkspaceModal.tsx +0 -1
- package/src/components/workspace-setup/WorkspaceSetup.tsx +0 -1
- package/src/index.ts +1 -1
- package/src/stores/editor/editor-state/element-editor-state/mapping/{MappingTestState.ts → DEPRECATED__MappingTestState.ts} +2 -2
- package/src/stores/editor/editor-state/element-editor-state/mapping/MappingEditorState.ts +24 -4
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +843 -0
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +53 -0
- package/src/stores/editor/sidebar-state/testable/GlobalTestRunnerState.ts +1 -0
- package/src/stores/editor/utils/TestableUtils.ts +26 -7
- package/src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts +44 -2
- package/src/stores/graph-modifier/Testable_GraphModifierHelper.ts +15 -5
- package/tsconfig.json +5 -2
- package/lib/components/editor/editor-group/mapping-editor/MappingTestEditor.d.ts.map +0 -1
- package/lib/components/editor/editor-group/mapping-editor/MappingTestEditor.js.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.d.ts.map +0 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/MappingTestState.js.map +0 -1
@@ -36,6 +36,7 @@ export declare enum LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY {
|
|
36
36
|
OPERATION_CLASS_MAPPING_EDITOR = "studio.editor.mapping-editor.operation-class-mapping-editor",
|
37
37
|
ENUMERATION_MAPPING_EDITOR = "studio.editor.mapping-editor.enumeration-mapping-editor",
|
38
38
|
MAPPING_EXECUTION_EDITOR = "studio.editor.mapping-editor.execution-editor",
|
39
|
+
DEPRECATED_MAPPING_TEST_EDITOR = "studio.editor.mapping-editor.deprecated-test-editor",
|
39
40
|
MAPPING_TEST_EDITOR = "studio.editor.mapping-editor.test-editor",
|
40
41
|
RUNTIME_EDITOR = "studio.editor.runtime-editor",
|
41
42
|
CONNECTION_EDITOR = "studio.editor.connection-editor",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendStudioApplicationNavigationContext.d.ts","sourceRoot":"","sources":["../../src/__lib__/LegendStudioApplicationNavigationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,gDAAgD;IAE1D,KAAK,iBAAiB;IACtB,2BAA2B,uCAAuC;IAGlE,MAAM,kBAAkB;IAExB,YAAY,+BAA+B;IAC3C,gBAAgB,mCAAmC;IACnD,sBAAsB,yCAAyC;IAE/D,YAAY,+BAA+B;IAC3C,uBAAuB,0CAA0C;IACjE,+BAA+B,kDAAkD;IACjF,wBAAwB,2CAA2C;IACnE,uBAAuB,0CAA0C;IACjE,oCAAoC,gEAAgE;IACpG,6BAA6B,yDAAyD;IAEtF,cAAc,iCAAiC;IAC/C,kBAAkB,qCAAqC;IACvD,kBAAkB,qCAAqC;IACvD,eAAe,kCAAkC;IAEjD,cAAc,iCAAiC;IAC/C,oBAAoB,sDAAsD;IAC1E,8BAA8B,gEAAgE;IAC9F,0BAA0B,4DAA4D;IACtF,wBAAwB,kDAAkD;IAC1E,mBAAmB,6CAA6C;IAEhE,cAAc,iCAAiC;IAE/C,iBAAiB,oCAAoC;IACrD,gBAAgB,qDAAqD;IAErE,cAAc,iCAAiC;IAC/C,wBAAwB,2CAA2C;IACnE,mBAAmB,sCAAsC;IAEzD,mBAAmB,sCAAsC;CAC1D"}
|
1
|
+
{"version":3,"file":"LegendStudioApplicationNavigationContext.d.ts","sourceRoot":"","sources":["../../src/__lib__/LegendStudioApplicationNavigationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oBAAY,gDAAgD;IAE1D,KAAK,iBAAiB;IACtB,2BAA2B,uCAAuC;IAGlE,MAAM,kBAAkB;IAExB,YAAY,+BAA+B;IAC3C,gBAAgB,mCAAmC;IACnD,sBAAsB,yCAAyC;IAE/D,YAAY,+BAA+B;IAC3C,uBAAuB,0CAA0C;IACjE,+BAA+B,kDAAkD;IACjF,wBAAwB,2CAA2C;IACnE,uBAAuB,0CAA0C;IACjE,oCAAoC,gEAAgE;IACpG,6BAA6B,yDAAyD;IAEtF,cAAc,iCAAiC;IAC/C,kBAAkB,qCAAqC;IACvD,kBAAkB,qCAAqC;IACvD,eAAe,kCAAkC;IAEjD,cAAc,iCAAiC;IAC/C,oBAAoB,sDAAsD;IAC1E,8BAA8B,gEAAgE;IAC9F,0BAA0B,4DAA4D;IACtF,wBAAwB,kDAAkD;IAC1E,8BAA8B,wDAAwD;IACtF,mBAAmB,6CAA6C;IAEhE,cAAc,iCAAiC;IAE/C,iBAAiB,oCAAoC;IACrD,gBAAgB,qDAAqD;IAErE,cAAc,iCAAiC;IAC/C,wBAAwB,2CAA2C;IACnE,mBAAmB,sCAAsC;IAEzD,mBAAmB,sCAAsC;CAC1D"}
|
@@ -39,6 +39,7 @@ export var LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY;
|
|
39
39
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["OPERATION_CLASS_MAPPING_EDITOR"] = "studio.editor.mapping-editor.operation-class-mapping-editor";
|
40
40
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["ENUMERATION_MAPPING_EDITOR"] = "studio.editor.mapping-editor.enumeration-mapping-editor";
|
41
41
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["MAPPING_EXECUTION_EDITOR"] = "studio.editor.mapping-editor.execution-editor";
|
42
|
+
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["DEPRECATED_MAPPING_TEST_EDITOR"] = "studio.editor.mapping-editor.deprecated-test-editor";
|
42
43
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["MAPPING_TEST_EDITOR"] = "studio.editor.mapping-editor.test-editor";
|
43
44
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["RUNTIME_EDITOR"] = "studio.editor.runtime-editor";
|
44
45
|
LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY["CONNECTION_EDITOR"] = "studio.editor.connection-editor";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendStudioApplicationNavigationContext.js","sourceRoot":"","sources":["../../src/__lib__/LegendStudioApplicationNavigationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,
|
1
|
+
{"version":3,"file":"LegendStudioApplicationNavigationContext.js","sourceRoot":"","sources":["../../src/__lib__/LegendStudioApplicationNavigationContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAN,IAAY,gDA2CX;AA3CD,WAAY,gDAAgD;IAC1D,QAAQ;IACR,0EAAsB,CAAA;IACtB,sHAAkE,CAAA;IAElE,SAAS;IACT,4EAAwB,CAAA;IAExB,+FAA2C,CAAA;IAC3C,uGAAmD,CAAA;IACnD,mHAA+D,CAAA;IAE/D,+FAA2C,CAAA;IAC3C,qHAAiE,CAAA;IACjE,qIAAiF,CAAA;IACjF,uHAAmE,CAAA;IACnE,qHAAiE,CAAA;IACjE,wJAAoG,CAAA;IACpG,0IAAsF,CAAA;IAEtF,mGAA+C,CAAA;IAC/C,2GAAuD,CAAA;IACvD,2GAAuD,CAAA;IACvD,qGAAiD,CAAA;IAEjD,mGAA+C,CAAA;IAC/C,8HAA0E,CAAA;IAC1E,kJAA8F,CAAA;IAC9F,0IAAsF,CAAA;IACtF,8HAA0E,CAAA;IAC1E,0IAAsF,CAAA;IACtF,oHAAgE,CAAA;IAEhE,mGAA+C,CAAA;IAE/C,yGAAqD,CAAA;IACrD,yHAAqE,CAAA;IAErE,mGAA+C,CAAA;IAC/C,uHAAmE,CAAA;IACnE,6GAAyD,CAAA;IAEzD,6GAAyD,CAAA;AAC3D,CAAC,EA3CW,gDAAgD,GAAhD,gDAAgD,KAAhD,gDAAgD,QA2C3D"}
|
@@ -48,6 +48,11 @@ declare class LegendStudioApplicationCoreOptions {
|
|
48
48
|
* See https://github.com/finos/legend-studio/issues/65
|
49
49
|
*/
|
50
50
|
TEMPORARY__serviceRegistrationConfig: ServiceRegistrationEnvironmentConfig[];
|
51
|
+
/**
|
52
|
+
* Indicates whether we should render the new mapping testable editor or the deprecated legacy editor.
|
53
|
+
* This flag will be removed once the editor for testable editor is agreed on.
|
54
|
+
*/
|
55
|
+
TEMPORARY_enableMappingTestableEditor: boolean;
|
51
56
|
private static readonly serialization;
|
52
57
|
static create(configData: PlainObject<LegendStudioApplicationCoreOptions>): LegendStudioApplicationCoreOptions;
|
53
58
|
}
|
@@ -62,6 +67,13 @@ export interface LegendStudioApplicationConfigurationData extends LegendApplicat
|
|
62
67
|
engine: {
|
63
68
|
url: string;
|
64
69
|
queryUrl?: string;
|
70
|
+
/**
|
71
|
+
* Provides the URL to deploy a Snowflake service.
|
72
|
+
*
|
73
|
+
* TODO: to be removed when we're done with the POC and potentially have own packageable element
|
74
|
+
* to house Snowflake service specification
|
75
|
+
*/
|
76
|
+
TEMPORARY__snowflakeServiceDeploymentUrl?: string | undefined;
|
65
77
|
};
|
66
78
|
query?: {
|
67
79
|
url: string;
|
@@ -71,6 +83,7 @@ export declare class LegendStudioApplicationConfig extends LegendApplicationConf
|
|
71
83
|
readonly options: LegendStudioApplicationCoreOptions;
|
72
84
|
readonly engineServerUrl: string;
|
73
85
|
readonly engineQueryServerUrl?: string | undefined;
|
86
|
+
readonly TEMPORARY__snowflakeServiceDeploymentUrl?: string | undefined;
|
74
87
|
readonly depotServerUrl: string;
|
75
88
|
readonly sdlcServerUrl: string;
|
76
89
|
readonly SDLCServerBaseHeaders?: RequestHeaders | undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendStudioApplicationConfig.d.ts","sourceRoot":"","sources":["../../src/application/LegendStudioApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EAGnB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,KAAK,mCAAmC,EACxC,KAAK,kCAAkC,EACxC,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,oCAAoC;IAC/C,GAAG,EAAG,MAAM,CAAC;IACb,YAAY,EAAG,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,aAAa,EAAG,MAAM,CAAC;IAEvB,MAAM,CAAC,QAAQ,CAAC,aAAa,6DAO3B;CACH;AAED,cAAM,kCAAkC;IACtC;;;;OAIG;IACH,4BAA4B,UAAS;IACrC,gCAAgC,SAAwB;IAExD;;;;;;OAMG;IACH,+BAA+B,UAAS;IACxC;;;;;;;;OAQG;IACH,oCAAoC,EAAE,oCAAoC,EAAE,CACvE;IAEL,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,
|
1
|
+
{"version":3,"file":"LegendStudioApplicationConfig.d.ts","sourceRoot":"","sources":["../../src/application/LegendStudioApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,cAAc,EAGnB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,KAAK,mCAAmC,EACxC,KAAK,kCAAkC,EACxC,MAAM,2BAA2B,CAAC;AAEnC,qBAAa,oCAAoC;IAC/C,GAAG,EAAG,MAAM,CAAC;IACb,YAAY,EAAG,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAM;IACrB,aAAa,EAAG,MAAM,CAAC;IAEvB,MAAM,CAAC,QAAQ,CAAC,aAAa,6DAO3B;CACH;AAED,cAAM,kCAAkC;IACtC;;;;OAIG;IACH,4BAA4B,UAAS;IACrC,gCAAgC,SAAwB;IAExD;;;;;;OAMG;IACH,+BAA+B,UAAS;IACxC;;;;;;;;OAQG;IACH,oCAAoC,EAAE,oCAAoC,EAAE,CACvE;IAEL;;;OAGG;IACH,qCAAqC,UAAS;IAE9C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAUnC;IAEF,MAAM,CAAC,MAAM,CACX,UAAU,EAAE,WAAW,CAAC,kCAAkC,CAAC,GAC1D,kCAAkC;CAKtC;AAED,MAAM,WAAW,wCACf,SAAQ,kCAAkC;IAC1C,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC;IACpD,KAAK,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,wCAAwC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAC/D,CAAC;IACF,KAAK,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CACzB;AAED,qBAAa,6BAA8B,SAAQ,uBAAuB;IACxE,QAAQ,CAAC,OAAO,qCAA4C;IAE5D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,wCAAwC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,qBAAqB,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IAC5D,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;gBAG/C,KAAK,EAAE,mCAAmC,CAAC,wCAAwC,CAAC;IAkE7E,+BAA+B,IAAI,MAAM;CAGnD"}
|
@@ -55,10 +55,16 @@ class LegendStudioApplicationCoreOptions {
|
|
55
55
|
* See https://github.com/finos/legend-studio/issues/65
|
56
56
|
*/
|
57
57
|
TEMPORARY__serviceRegistrationConfig = [];
|
58
|
+
/**
|
59
|
+
* Indicates whether we should render the new mapping testable editor or the deprecated legacy editor.
|
60
|
+
* This flag will be removed once the editor for testable editor is agreed on.
|
61
|
+
*/
|
62
|
+
TEMPORARY_enableMappingTestableEditor = false;
|
58
63
|
static serialization = new SerializationFactory(createModelSchema(LegendStudioApplicationCoreOptions, {
|
59
64
|
enableGraphBuilderStrictMode: optional(primitive()),
|
60
65
|
projectCreationGroupIdSuggestion: optional(primitive()),
|
61
66
|
TEMPORARY__preserveSectionIndex: optional(primitive()),
|
67
|
+
TEMPORARY_enableMappingTestableEditor: optional(primitive()),
|
62
68
|
TEMPORARY__serviceRegistrationConfig: list(object(ServiceRegistrationEnvironmentConfig)),
|
63
69
|
}));
|
64
70
|
static create(configData) {
|
@@ -69,6 +75,7 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
|
|
69
75
|
options = new LegendStudioApplicationCoreOptions();
|
70
76
|
engineServerUrl;
|
71
77
|
engineQueryServerUrl;
|
78
|
+
TEMPORARY__snowflakeServiceDeploymentUrl;
|
72
79
|
depotServerUrl;
|
73
80
|
sdlcServerUrl;
|
74
81
|
SDLCServerBaseHeaders;
|
@@ -81,6 +88,10 @@ export class LegendStudioApplicationConfig extends LegendApplicationConfig {
|
|
81
88
|
if (input.configData.engine.queryUrl) {
|
82
89
|
this.engineQueryServerUrl = LegendApplicationConfig.resolveAbsoluteUrl(input.configData.engine.queryUrl);
|
83
90
|
}
|
91
|
+
if (input.configData.engine.TEMPORARY__snowflakeServiceDeploymentUrl) {
|
92
|
+
this.TEMPORARY__snowflakeServiceDeploymentUrl =
|
93
|
+
LegendApplicationConfig.resolveAbsoluteUrl(input.configData.engine.TEMPORARY__snowflakeServiceDeploymentUrl);
|
94
|
+
}
|
84
95
|
// depot
|
85
96
|
assertNonNullable(input.configData.depot, `Can't configure application: 'depot' field is missing`);
|
86
97
|
this.depotServerUrl = LegendApplicationConfig.resolveAbsoluteUrl(guaranteeNonEmptyString(input.configData.depot.url, `Can't configure application: 'depot.url' field is missing or empty`));
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendStudioApplicationConfig.js","sourceRoot":"","sources":["../../src/application/LegendStudioApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AAEnC,MAAa,oCAAoC;IAC/C,GAAG,CAAU;IACb,YAAY,CAAU;IACtB,KAAK,GAAa,EAAE,CAAC;IACrB,aAAa,CAAU;IAEvB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,oCAAoC,EAAE;QACtD,GAAG,EAAE,SAAS,EAAE;QAChB,YAAY,EAAE,SAAS,EAAE;QACzB,aAAa,EAAE,SAAS,EAAE;QAC1B,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KACzB,CAAC,CACH,CAAC;;SAbS,oCAAoC;AAgBjD,MAAM,kCAAkC;IACtC;;;;OAIG;IACH,4BAA4B,GAAG,KAAK,CAAC;IACrC,gCAAgC,GAAG,oBAAoB,CAAC;IAExD;;;;;;OAMG;IACH,+BAA+B,GAAG,KAAK,CAAC;IACxC;;;;;;;;OAQG;IACH,oCAAoC,GAClC,EAAE,CAAC;
|
1
|
+
{"version":3,"file":"LegendStudioApplicationConfig.js","sourceRoot":"","sources":["../../src/application/LegendStudioApplicationConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,iBAAiB,EACjB,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,OAAO,EAGL,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,GAGxB,MAAM,2BAA2B,CAAC;AAEnC,MAAa,oCAAoC;IAC/C,GAAG,CAAU;IACb,YAAY,CAAU;IACtB,KAAK,GAAa,EAAE,CAAC;IACrB,aAAa,CAAU;IAEvB,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CACtD,iBAAiB,CAAC,oCAAoC,EAAE;QACtD,GAAG,EAAE,SAAS,EAAE;QAChB,YAAY,EAAE,SAAS,EAAE;QACzB,aAAa,EAAE,SAAS,EAAE;QAC1B,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;KACzB,CAAC,CACH,CAAC;;SAbS,oCAAoC;AAgBjD,MAAM,kCAAkC;IACtC;;;;OAIG;IACH,4BAA4B,GAAG,KAAK,CAAC;IACrC,gCAAgC,GAAG,oBAAoB,CAAC;IAExD;;;;;;OAMG;IACH,+BAA+B,GAAG,KAAK,CAAC;IACxC;;;;;;;;OAQG;IACH,oCAAoC,GAClC,EAAE,CAAC;IAEL;;;OAGG;IACH,qCAAqC,GAAG,KAAK,CAAC;IAEtC,MAAM,CAAU,aAAa,GAAG,IAAI,oBAAoB,CAC9D,iBAAiB,CAAC,kCAAkC,EAAE;QACpD,4BAA4B,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACnD,gCAAgC,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACvD,+BAA+B,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QACtD,qCAAqC,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC5D,oCAAoC,EAAE,IAAI,CACxC,MAAM,CAAC,oCAAoC,CAAC,CAC7C;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,UAA2D;QAE3D,OAAO,kCAAkC,CAAC,aAAa,CAAC,QAAQ,CAC9D,UAAU,CACX,CAAC;IACJ,CAAC;;AAqBH,MAAM,OAAO,6BAA8B,SAAQ,uBAAuB;IAC/D,OAAO,GAAG,IAAI,kCAAkC,EAAE,CAAC;IAEnD,eAAe,CAAS;IACxB,oBAAoB,CAAsB;IAC1C,wCAAwC,CAAsB;IAC9D,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,qBAAqB,CAA8B;IACnD,mBAAmB,CAAqB;IAEjD,YACE,KAAoF;QAEpF,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,SAAS;QACT,iBAAiB,CACf,KAAK,CAAC,UAAU,CAAC,MAAM,EACvB,wDAAwD,CACzD,CAAC;QACF,IAAI,CAAC,eAAe,GAAG,uBAAuB,CAAC,kBAAkB,CAC/D,uBAAuB,CACrB,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAC3B,qEAAqE,CACtE,CACF,CAAC;QACF,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE;YACpC,IAAI,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,kBAAkB,CACpE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CACjC,CAAC;SACH;QACD,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,wCAAwC,EAAE;YACpE,IAAI,CAAC,wCAAwC;gBAC3C,uBAAuB,CAAC,kBAAkB,CACxC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,wCAAwC,CACjE,CAAC;SACL;QAED,QAAQ;QACR,iBAAiB,CACf,KAAK,CAAC,UAAU,CAAC,KAAK,EACtB,uDAAuD,CACxD,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,uBAAuB,CAAC,kBAAkB,CAC9D,uBAAuB,CACrB,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAC1B,oEAAoE,CACrE,CACF,CAAC;QAEF,OAAO;QACP,iBAAiB,CACf,KAAK,CAAC,UAAU,CAAC,IAAI,EACrB,sDAAsD,CACvD,CAAC;QACF,IAAI,CAAC,aAAa,GAAG,uBAAuB,CAAC,kBAAkB,CAC7D,uBAAuB,CACrB,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EACzB,mEAAmE,CACpE,CACF,CAAC;QACF,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;QAE/D,QAAQ;QACR,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,EAAE;YAC/B,IAAI,CAAC,mBAAmB,GAAG,uBAAuB,CAAC,kBAAkB,CACnE,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAC3B,CAAC;SACH;QAED,UAAU;QACV,IAAI,CAAC,OAAO,GAAG,kCAAkC,CAAC,MAAM,CACtD,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI;YAChC,EAAE,CAAoD,CACzD,CAAC;IACJ,CAAC;IAEQ,+BAA+B;QACtC,OAAO,eAAe,CAAC;IACzB,CAAC;CACF"}
|
@@ -0,0 +1,23 @@
|
|
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
|
+
/// <reference types="react" resolution-mode="require"/>
|
17
|
+
import { type MappingTestableState } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js';
|
18
|
+
export declare const MappingTestableEditor: ((props: {
|
19
|
+
mappingTestableState: MappingTestableState;
|
20
|
+
}) => JSX.Element) & {
|
21
|
+
displayName: string;
|
22
|
+
};
|
23
|
+
//# sourceMappingURL=MappingTestableEditor.d.ts.map
|
package/lib/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.d.ts.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MappingTestableEditor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/editor/edit-panel/mapping-editor/testable/MappingTestableEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AA6DH,OAAO,EAEL,KAAK,oBAAoB,EAU1B,MAAM,yGAAyG,CAAC;AAmrCjH,eAAO,MAAM,qBAAqB,WACxB;IAAE,oBAAoB,EAAE,oBAAoB,CAAA;CAAE;;CA2IvD,CAAC"}
|
@@ -0,0 +1,387 @@
|
|
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 { ModelStore, Database, getMappingCompatibleClasses, getRootSetImplementation, RelationalInstanceSetImplementation, EmbeddedRelationalInstanceSetImplementation, isStubbed_RawLambda, stub_RawLambda, } from '@finos/legend-graph';
|
19
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
20
|
+
import { BlankPanelPlaceholder, CaretDownIcon, clsx, compareLabelFn, CustomSelectorInput, Dialog, DropdownMenu, MenuContent, MenuContentItem, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalTitle, PanelContent, PanelFormTextField, PencilIcon, PlusIcon, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, ResizablePanelSplitterLine, RunAllIcon, RunErrorsIcon, TestTubeIcon, CheckCircleIcon, TimesCircleIcon, PanelLoadingIndicator, ContextMenu, PURE_ModelStoreIcon, PURE_UnknownElementTypeIcon, PURE_DatabaseIcon, RefreshIcon, } from '@finos/legend-art';
|
21
|
+
import { assertErrorThrown, generateEnumerableNameFromToken, guaranteeNonNullable, prettyCONSTName, uniq, } from '@finos/legend-shared';
|
22
|
+
import { MAPPING_TEST_SUITE_TYPE, MappingQueryTestSuiteState, MappingDataTestState, MappingDataTestSuiteState, MappingQueryTestState, } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js';
|
23
|
+
import { useApplicationStore } from '@finos/legend-application';
|
24
|
+
import { flowResult } from 'mobx';
|
25
|
+
import { QueryBuilderTextEditorMode, } from '@finos/legend-query-builder';
|
26
|
+
import { MappingExecutionQueryBuilderState } from '../../../../../stores/editor/editor-state/element-editor-state/mapping/MappingExecutionQueryBuilderState.js';
|
27
|
+
import { CODE_EDITOR_LANGUAGE, CodeEditor, } from '@finos/legend-lego/code-editor';
|
28
|
+
import { TESTABLE_TEST_TAB } from '../../../../../stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js';
|
29
|
+
import { atomicTest_setDoc, atomicTest_setId, testAssertion_setId, testSuite_setId, } from '../../../../../stores/graph-modifier/Testable_GraphModifierHelper.js';
|
30
|
+
import { RenameModal, TestAssertionEditor, TestAssertionItem, } from '../../../editor-group/testable/TestAssertionEditor.js';
|
31
|
+
import { EmbeddedDataEditor } from '../../../editor-group/data-editor/EmbeddedDataEditor.js';
|
32
|
+
import { TESTABLE_RESULT, getTestableResultFromTestResult, } from '../../../../../stores/editor/sidebar-state/testable/GlobalTestRunnerState.js';
|
33
|
+
import { getTestableResultIcon } from '../../../side-bar/testable/GlobalTestRunner.js';
|
34
|
+
const CreateTestSuiteModal = observer((props) => {
|
35
|
+
const { mappingTestableState } = props;
|
36
|
+
const mappingEditorState = mappingTestableState.mappingEditorState;
|
37
|
+
const mapping = mappingEditorState.mapping;
|
38
|
+
const creatorState = mappingTestableState.createSuiteState;
|
39
|
+
const editorStore = mappingEditorState.editorStore;
|
40
|
+
// quick funcs
|
41
|
+
const getDefaultSuite = (val) => {
|
42
|
+
if (val) {
|
43
|
+
const rootSetImpl = getRootSetImplementation(mapping, val);
|
44
|
+
if (rootSetImpl instanceof RelationalInstanceSetImplementation ||
|
45
|
+
rootSetImpl instanceof EmbeddedRelationalInstanceSetImplementation ||
|
46
|
+
rootSetImpl instanceof EmbeddedRelationalInstanceSetImplementation) {
|
47
|
+
return MAPPING_TEST_SUITE_TYPE.DATA;
|
48
|
+
}
|
49
|
+
else {
|
50
|
+
return MAPPING_TEST_SUITE_TYPE.QUERY;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return MAPPING_TEST_SUITE_TYPE.QUERY;
|
54
|
+
};
|
55
|
+
// Class mapping selector
|
56
|
+
const compatibleClasses = getMappingCompatibleClasses(mapping, editorStore.graphManagerState.usableClasses);
|
57
|
+
const mappedClassSelectorRef = useRef(null);
|
58
|
+
const mappedClassOptions = uniq(compatibleClasses)
|
59
|
+
.map((e) => ({
|
60
|
+
label: e.name,
|
61
|
+
value: e,
|
62
|
+
}))
|
63
|
+
.sort(compareLabelFn);
|
64
|
+
const [selectedClass, setSelectedClass] = useState(compatibleClasses[0]);
|
65
|
+
const selectedClassOption = selectedClass
|
66
|
+
? {
|
67
|
+
value: selectedClass,
|
68
|
+
label: selectedClass.name,
|
69
|
+
}
|
70
|
+
: null;
|
71
|
+
// init states
|
72
|
+
const [suiteName, setSuiteName] = useState(generateEnumerableNameFromToken(mapping.tests.map((e) => e.id), selectedClass ? `${selectedClass.name}_suite` : 'suite'));
|
73
|
+
const [suiteType, setSuiteType] = useState(getDefaultSuite(selectedClass));
|
74
|
+
const isValid = selectedClass && suiteName;
|
75
|
+
const handleEnterClassMappingSelectorModal = () => mappedClassSelectorRef.current?.focus();
|
76
|
+
const changeClassOption = (val) => {
|
77
|
+
if (val?.value) {
|
78
|
+
setSelectedClass(val.value);
|
79
|
+
setSuiteType(getDefaultSuite(val.value));
|
80
|
+
setSuiteName(generateEnumerableNameFromToken(mapping.tests.map((e) => e.id), `${val.value.name}_suite`));
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
setSelectedClass(undefined);
|
84
|
+
setSuiteType(getDefaultSuite(undefined));
|
85
|
+
}
|
86
|
+
};
|
87
|
+
// model
|
88
|
+
const close = () => creatorState.setShowModal(false);
|
89
|
+
const create = () => {
|
90
|
+
if (selectedClass && suiteName) {
|
91
|
+
flowResult(creatorState.createAndAddTestSuite(selectedClass, suiteType, suiteName)).catch(editorStore.applicationStore.alertUnhandledError);
|
92
|
+
}
|
93
|
+
};
|
94
|
+
return (_jsx(Dialog, { open: creatorState.showModal, onClose: close, TransitionProps: {
|
95
|
+
onEnter: handleEnterClassMappingSelectorModal,
|
96
|
+
}, classes: { container: 'search-modal__container' }, PaperProps: { classes: { root: 'search-modal__inner-container' } }, children: _jsxs(Modal, { darkMode: true, className: "search-modal", children: [_jsx(ModalTitle, { title: "Create Test Suite" }), _jsxs(ModalBody, { children: [_jsxs("div", { className: "panel__content__form__section", children: [_jsx("div", { className: "panel__content__form__section__header__label", children: "Target Class To Test" }), _jsx("div", { className: "panel__content__form__section__header__prompt", children: "Mapped class for which you would like to build test suite for" }), _jsx(CustomSelectorInput, { ref: mappedClassSelectorRef, options: mappedClassOptions, onChange: changeClassOption, value: selectedClassOption, darkMode: true, placeholder: "Choose a class...", isClearable: true })] }), _jsx(PanelFormTextField, { name: "Test Suite Name", prompt: "", value: suiteName, update: (value) => setSuiteName(value ?? ''), errorMessage: suiteName.includes(' ')
|
97
|
+
? `Suite name can't contain spaces`
|
98
|
+
: !suiteName
|
99
|
+
? `Suite name is required`
|
100
|
+
: undefined })] }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { disabled: !isValid, onClick: create, text: "Create" }), _jsx(ModalFooterButton, { onClick: close, text: "Close" })] })] }) }));
|
101
|
+
});
|
102
|
+
const CreateTestModal = observer((props) => {
|
103
|
+
const { mappingSuiteState } = props;
|
104
|
+
const suite = mappingSuiteState.suite;
|
105
|
+
const [id, setId] = useState(generateEnumerableNameFromToken(suite.tests.map((e) => e.id), 'test'));
|
106
|
+
const isValid = id && !id.includes(' ');
|
107
|
+
// model
|
108
|
+
const close = () => mappingSuiteState.setShowModal(false);
|
109
|
+
const create = () => mappingSuiteState.addTest(id);
|
110
|
+
return (_jsx(Dialog, { open: mappingSuiteState.showCreateModal, onClose: close, classes: { container: 'search-modal__container' }, PaperProps: { classes: { root: 'search-modal__inner-container' } }, children: _jsxs(Modal, { darkMode: true, className: "search-modal", children: [_jsx(ModalTitle, { title: "Create Test Suite" }), _jsx(ModalBody, { children: _jsx(PanelFormTextField, { name: "Test Suite Name", prompt: "", value: id, update: (value) => setId(value ?? ''), errorMessage: id.includes(' ')
|
111
|
+
? `Suite name can't contain spaces`
|
112
|
+
: !id
|
113
|
+
? `Suite name is required`
|
114
|
+
: undefined }) }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { disabled: !isValid, onClick: create, text: "Create" }), _jsx(ModalFooterButton, { onClick: close, text: "Close" })] })] }) }));
|
115
|
+
});
|
116
|
+
const MappingTestableQueryEditor = observer((props) => {
|
117
|
+
const { testableQueryState, mappingTestableState, isReadOnly } = props;
|
118
|
+
const mapping = mappingTestableState.mapping;
|
119
|
+
const queryState = testableQueryState;
|
120
|
+
const editorStore = mappingTestableState.mappingEditorState.editorStore;
|
121
|
+
const applicationStore = useApplicationStore();
|
122
|
+
// actions
|
123
|
+
const editWithQueryBuilder = (openInTextMode = false) => applicationStore.guardUnhandledError(async () => {
|
124
|
+
const embeddedQueryBuilderState = editorStore.embeddedQueryBuilderState;
|
125
|
+
await flowResult(embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration({
|
126
|
+
setupQueryBuilderState: () => {
|
127
|
+
const queryBuilderState = new MappingExecutionQueryBuilderState(embeddedQueryBuilderState.editorStore.applicationStore, embeddedQueryBuilderState.editorStore.graphManagerState, mapping);
|
128
|
+
queryBuilderState.initializeWithQuery(testableQueryState.query);
|
129
|
+
if (openInTextMode) {
|
130
|
+
queryBuilderState.textEditorState.openModal(QueryBuilderTextEditorMode.TEXT);
|
131
|
+
}
|
132
|
+
return queryBuilderState;
|
133
|
+
},
|
134
|
+
actionConfigs: [
|
135
|
+
{
|
136
|
+
key: 'save-query-btn',
|
137
|
+
renderer: (queryBuilderState) => {
|
138
|
+
const save = applicationStore.guardUnhandledError(async () => {
|
139
|
+
try {
|
140
|
+
const rawLambda = queryBuilderState.buildQuery();
|
141
|
+
await flowResult(queryState.updateLamba(rawLambda));
|
142
|
+
applicationStore.notificationService.notifySuccess(`Mapping testable query is updated`);
|
143
|
+
embeddedQueryBuilderState.setEmbeddedQueryBuilderConfiguration(undefined);
|
144
|
+
}
|
145
|
+
catch (error) {
|
146
|
+
assertErrorThrown(error);
|
147
|
+
applicationStore.notificationService.notifyError(`Can't save query: ${error.message}`);
|
148
|
+
}
|
149
|
+
});
|
150
|
+
return (_jsx("button", { className: "query-builder__dialog__header__custom-action", tabIndex: -1, disabled: isReadOnly, onClick: save, children: "Save Query" }));
|
151
|
+
},
|
152
|
+
},
|
153
|
+
],
|
154
|
+
disableCompile: isStubbed_RawLambda(queryState.query),
|
155
|
+
}));
|
156
|
+
});
|
157
|
+
const clearQuery = applicationStore.guardUnhandledError(() => flowResult(queryState.updateLamba(stub_RawLambda())));
|
158
|
+
return (_jsxs("div", { className: "panel mapping-test-editor__query-panel", children: [_jsxs("div", { className: "panel__header", children: [_jsx("div", { className: "panel__header__title", children: _jsx("div", { className: "panel__header__title__label", children: "query" }) }), _jsx("div", { className: "panel__header__actions", children: _jsxs("div", { className: "mapping-test-editor__action-btn", children: [_jsxs("button", { className: "mapping-test-editor__action-btn__label", onClick: editWithQueryBuilder(), title: "Edit Query", tabIndex: -1, children: [_jsx(PencilIcon, { className: "mapping-test-editor__action-btn__label__icon" }), _jsx("div", { className: "mapping-test-editor__action-btn__label__title", children: "Edit Query" })] }), _jsx(DropdownMenu, { className: "mapping-test-editor__action-btn__dropdown-btn", content: _jsxs(MenuContent, { children: [_jsx(MenuContentItem, { className: "mapping-test-editor__action-btn__option", onClick: editWithQueryBuilder(true), children: "Text Mode" }), _jsx(MenuContentItem, { className: "mapping-test-editor__action-btn__option", onClick: clearQuery, children: "Clear Query" })] }), menuProps: {
|
159
|
+
anchorOrigin: { vertical: 'bottom', horizontal: 'right' },
|
160
|
+
transformOrigin: { vertical: 'top', horizontal: 'right' },
|
161
|
+
}, children: _jsx(CaretDownIcon, {}) })] }) })] }), !isStubbed_RawLambda(queryState.query) && (_jsx(PanelContent, { children: _jsx("div", { className: "mapping-test-editor__query-panel__query", title: "Double click to edit in query builder", onDoubleClick: (event) => {
|
162
|
+
event.preventDefault();
|
163
|
+
event.stopPropagation();
|
164
|
+
editWithQueryBuilder()();
|
165
|
+
}, children: _jsx(CodeEditor, { inputValue: queryState.lambdaString, isReadOnly: true, language: CODE_EDITOR_LANGUAGE.PURE, showMiniMap: false }) }) }))] }));
|
166
|
+
});
|
167
|
+
const MappingTestAssertionsEditor = observer((props) => {
|
168
|
+
const { mappingDataTestState } = props;
|
169
|
+
const editorStore = mappingDataTestState.editorStore;
|
170
|
+
const mappingEditorState = mappingDataTestState.mappingTestableState.mappingEditorState;
|
171
|
+
const isReadOnly = mappingEditorState.isReadOnly;
|
172
|
+
const addAssertion = () => mappingDataTestState.addAssertion();
|
173
|
+
const runTest = () => {
|
174
|
+
flowResult(mappingDataTestState.runTest()).catch(editorStore.applicationStore.alertUnhandledError);
|
175
|
+
};
|
176
|
+
const renameAssertion = (val) => testAssertion_setId(guaranteeNonNullable(mappingDataTestState.assertionToRename), val);
|
177
|
+
return (_jsxs("div", { className: "panel service-test-editor", children: [_jsx("div", { className: "service-test-suite-editor__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--assertions", children: "assertions" }) }) }), _jsx("div", { className: "service-test-editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsxs(ResizablePanel, { minSize: 100, size: 200, children: [_jsxs("div", { className: "binding-editor__header", children: [_jsxs("div", { className: "binding-editor__header__title", children: [_jsxs("div", { className: "testable-test-assertion-explorer__header__summary", children: [_jsx("div", { className: "testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--assertion", children: _jsx(TestTubeIcon, {}) }), _jsx("div", { children: mappingDataTestState.assertionCount })] }), _jsxs("div", { className: "testable-test-assertion-explorer__header__summary", children: [_jsx("div", { className: "testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--passed", children: _jsx(CheckCircleIcon, {}) }), _jsx("div", { children: mappingDataTestState.assertionPassed })] }), _jsxs("div", { className: "testable-test-assertion-explorer__header__summary", children: [_jsx("div", { className: "testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--failed", children: _jsx(TimesCircleIcon, {}) }), _jsx("div", { children: mappingDataTestState.assertionFailed })] })] }), _jsxs("div", { className: "panel__header__actions", children: [_jsx("button", { className: "panel__header__action testable-test-explorer__play__all__icon", tabIndex: -1, onClick: runTest, title: "Run All Assertions", children: _jsx(RunAllIcon, {}) }), _jsx("button", { className: "panel__header__action", tabIndex: -1, onClick: addAssertion, title: "Add Test Assertion", children: _jsx(PlusIcon, {}) })] })] }), _jsx("div", { children: mappingDataTestState.assertionEditorStates.map((assertionState) => (_jsx(TestAssertionItem, { testableTestState: mappingDataTestState, testAssertionEditorState: assertionState, isReadOnly: isReadOnly }, assertionState.assertion.id))) }), mappingDataTestState.assertionToRename && (_jsx(RenameModal, { val: mappingDataTestState.assertionToRename.id, isReadOnly: isReadOnly, showModal: true, closeModal: () => mappingDataTestState.setAssertionToRename(undefined), setValue: renameAssertion }))] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { children: mappingDataTestState.selectedAsertionState && (_jsx(TestAssertionEditor, { testAssertionState: mappingDataTestState.selectedAsertionState })) })] }) })] }));
|
178
|
+
});
|
179
|
+
const StoreTestDataContextMenu = observer(forwardRef(function TestContainerContextMenu(props, ref) {
|
180
|
+
const { deleteStoreData } = props;
|
181
|
+
const remove = () => deleteStoreData();
|
182
|
+
return (_jsx(MenuContent, { ref: ref, children: _jsx(MenuContentItem, { onClick: remove, children: "Delete" }) }));
|
183
|
+
}));
|
184
|
+
const StoreTestDataItem = observer((props) => {
|
185
|
+
const { storeTestData, mappingTestableDataState } = props;
|
186
|
+
const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] = useState(false);
|
187
|
+
const store = storeTestData.store;
|
188
|
+
const isReadOnly = mappingTestableDataState.mappingTestableState.mappingEditorState
|
189
|
+
.isReadOnly;
|
190
|
+
const openConnectionTestData = () => mappingTestableDataState.openStoreTestData(storeTestData);
|
191
|
+
const isActive = mappingTestableDataState.selectedDataState?.storeTestData ===
|
192
|
+
storeTestData;
|
193
|
+
const deleteStoreTestData = () => mappingTestableDataState.deleteStoreTestData(storeTestData);
|
194
|
+
const onContextMenuOpen = () => setIsSelectedFromContextMenu(true);
|
195
|
+
const onContextMenuClose = () => setIsSelectedFromContextMenu(false);
|
196
|
+
const icon = store instanceof ModelStore ? (_jsx(PURE_ModelStoreIcon, {})) : store instanceof Database ? (_jsx(PURE_DatabaseIcon, {})) : (_jsx(PURE_UnknownElementTypeIcon, {}));
|
197
|
+
return (_jsx(ContextMenu, { className: clsx('testable-test-assertion-explorer__item', {
|
198
|
+
'testable-test-assertion-explorer__item--selected-from-context-menu': !isActive && isSelectedFromContextMenu,
|
199
|
+
}, { 'testable-test-assertion-explorer__item--active': isActive }), disabled: isReadOnly, content: _jsx(StoreTestDataContextMenu, { storeTestData: storeTestData, deleteStoreData: deleteStoreTestData }), menuProps: { elevation: 7 }, onOpen: onContextMenuOpen, onClose: onContextMenuClose, children: _jsxs("button", { className: clsx('testable-test-assertion-explorer__item__label'), onClick: openConnectionTestData, tabIndex: -1, children: [_jsx("div", { className: "testable-test-assertion-explorer__item__label__icon testable-test-assertion-explorer__test-result-indicator__container", children: icon }), _jsx("div", { className: "testable-test-assertion-explorer__item__label__text", children: store.value.path })] }) }));
|
200
|
+
});
|
201
|
+
const StoreTestDataEditor = observer((props) => {
|
202
|
+
const { mappingTestableDataState, storeTestDataState } = props;
|
203
|
+
const isReadOnly = mappingTestableDataState.mappingTestableState.mappingEditorState
|
204
|
+
.isReadOnly;
|
205
|
+
return (_jsxs("div", { className: "service-test-data-editor", children: [_jsxs("div", { className: "service-test-suite-editor__header", children: [_jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "data" }) }), _jsxs("div", { className: "panel__header__actions", children: [_jsx("div", { className: clsx('panel__content__form__section__toggler', {
|
206
|
+
'panel__content__form__section__toggler--disabled': isReadOnly,
|
207
|
+
}) }), _jsx("button", { className: "panel__header__action service-execution-editor__test-data__generate-btn",
|
208
|
+
// onClick={generateTestData}
|
209
|
+
title: "Generate test data if possible", disabled: storeTestDataState.generatingTestDataSate.isInProgress, tabIndex: -1, children: _jsxs("div", { className: "service-execution-editor__test-data__generate-btn__label", children: [_jsx(RefreshIcon, { className: "service-execution-editor__test-data__generate-btn__label__icon" }), _jsx("div", { className: "service-execution-editor__test-data__generate-btn__label__title", children: "Generate" })] }) })] })] }), _jsx(EmbeddedDataEditor, { isReadOnly: isReadOnly, embeddedDataEditorState: storeTestDataState.embeddedEditorState })] }));
|
210
|
+
});
|
211
|
+
const MappingTestableStoreDataEditor = observer((props) => {
|
212
|
+
const { mappingTestableDataState } = props;
|
213
|
+
const addStoreTestData = () => {
|
214
|
+
mappingTestableDataState.newConnectionDataState.openModal();
|
215
|
+
};
|
216
|
+
return (_jsxs("div", { className: "service-test-data-editor panel", children: [_jsxs("div", { className: "service-test-suite-editor__header", children: [_jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "Data" }) }), _jsxs("div", { className: "panel__header__actions", children: [_jsx("button", { className: "panel__header__action service-execution-editor__test-data__generate-btn",
|
217
|
+
// onClick={generateParameterValues}
|
218
|
+
title: "Generate test parameter values", tabIndex: -1, children: _jsx("div", { className: "service-execution-editor__test-data__generate-btn__label", children: _jsx("div", { className: "service-execution-editor__test-data__generate-btn__label__title", children: "Generate" }) }) }), _jsx("button", { className: "panel__header__action", tabIndex: -1,
|
219
|
+
// disabled={!setupState.newParamOptions.length}
|
220
|
+
// onClick={addParameter}
|
221
|
+
title: "Add Store Data", children: _jsx(PlusIcon, {}) })] })] }), _jsx("div", { className: "service-test-data-editor__data", children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsxs(ResizablePanel, { minSize: 100, children: [_jsxs("div", { className: "binding-editor__header", children: [_jsx("div", { className: "binding-editor__header__title", children: _jsx("div", { className: "binding-editor__header__title__label", children: "stores" }) }), _jsx("div", { className: "panel__header__actions", children: _jsx("button", { className: "panel__header__action", tabIndex: -1, onClick: addStoreTestData, title: "Add Store Test Data", children: _jsx(PlusIcon, {}) }) })] }), _jsx("div", { children: mappingTestableDataState.dataHolder.storeTestData.map((storeTestData) => (_jsx(StoreTestDataItem, { storeTestData: storeTestData, mappingTestableDataState: mappingTestableDataState }, storeTestData.store.value.name))) })] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsxs(ResizablePanel, { minSize: 600, children: [_jsx(PanelLoadingIndicator, { isLoading: Boolean(mappingTestableDataState.selectedDataState
|
222
|
+
?.generatingTestDataSate.isInProgress) }), mappingTestableDataState.selectedDataState && (_jsx(StoreTestDataEditor, { storeTestDataState: mappingTestableDataState.selectedDataState, mappingTestableDataState: mappingTestableDataState }))] })] }) })] }));
|
223
|
+
});
|
224
|
+
const MappingDataTestSetupEditor = observer((props) => {
|
225
|
+
const { mappingDataTestState } = props;
|
226
|
+
const test = mappingDataTestState.test;
|
227
|
+
return (_jsxs("div", { className: "panel service-test-editor", children: [_jsx("div", { className: "panel__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "setup" }) }) }), _jsx("div", { className: "service-test-editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { size: 150, minSize: 28, children: _jsxs("div", { className: "service-test-data-editor panel", children: [_jsx("div", { className: "service-test-suite-editor__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "configuration" }) }) }), _jsx("div", { className: "service-test-editor__setup__configuration", children: _jsx(PanelFormTextField, { name: "Documentation", prompt: "Test Documentation", value: test.doc, update: (value) => atomicTest_setDoc(test, value ?? undefined) }) })] }) }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 56, children: _jsx(MappingTestableStoreDataEditor, { mappingTestableDataState: mappingDataTestState.dataState }) })] }) })] }));
|
228
|
+
});
|
229
|
+
const MappingQueryTestSetupEditor = observer((props) => {
|
230
|
+
const { mappingQueryTestState } = props;
|
231
|
+
const test = mappingQueryTestState.test;
|
232
|
+
const mappingTestableState = mappingQueryTestState.mappingTestableState;
|
233
|
+
const queryState = mappingQueryTestState.queryState;
|
234
|
+
const isReadOnly = mappingQueryTestState.mappingTestableState.mappingEditorState.isReadOnly;
|
235
|
+
return (_jsxs("div", { className: "panel service-test-editor", children: [_jsx("div", { className: "panel__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "setup" }) }) }), _jsx("div", { className: "service-test-editor__content", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { size: 150, minSize: 28, children: _jsxs("div", { className: "service-test-data-editor panel", children: [_jsx("div", { className: "service-test-suite-editor__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label", children: "configuration" }) }) }), _jsx("div", { className: "service-test-editor__setup__configuration", children: _jsx(PanelFormTextField, { name: "Documentation", prompt: "Test Documentation", value: test.doc, update: (value) => atomicTest_setDoc(test, value) }) })] }) }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 56, children: _jsx(MappingTestableQueryEditor, { testableQueryState: queryState, mappingTestableState: mappingTestableState, isReadOnly: isReadOnly }) })] }) })] }));
|
236
|
+
});
|
237
|
+
const MappingTestEditor = observer((props) => {
|
238
|
+
const { mappingTestState } = props;
|
239
|
+
const selectedTab = mappingTestState.selectedTab;
|
240
|
+
const renderMappingSetupTestEditor = () => {
|
241
|
+
if (mappingTestState instanceof MappingDataTestState) {
|
242
|
+
return (_jsx(MappingDataTestSetupEditor, { mappingDataTestState: mappingTestState }));
|
243
|
+
}
|
244
|
+
else if (mappingTestState instanceof MappingQueryTestState) {
|
245
|
+
return (_jsx(MappingQueryTestSetupEditor, { mappingQueryTestState: mappingTestState }));
|
246
|
+
}
|
247
|
+
return null;
|
248
|
+
};
|
249
|
+
return (_jsxs("div", { className: "service-test-editor panel", children: [_jsx("div", { className: "panel__header", children: _jsx("div", { className: "panel__header service-test-editor__header--with-tabs", children: _jsx("div", { className: "uml-element-editor__tabs", children: Object.values(TESTABLE_TEST_TAB).map((tab) => (_jsx("div", { onClick: () => mappingTestState.setSelectedTab(tab), className: clsx('service-test-editor__tab', {
|
250
|
+
'service-test-editor__tab--active': tab === mappingTestState.selectedTab,
|
251
|
+
}), children: prettyCONSTName(tab) }, tab))) }) }) }), _jsxs("div", { className: "service-test-editor", children: [selectedTab === TESTABLE_TEST_TAB.SETUP &&
|
252
|
+
renderMappingSetupTestEditor(), selectedTab === TESTABLE_TEST_TAB.ASSERTIONS && (_jsx(MappingTestAssertionsEditor, { mappingDataTestState: mappingTestState }))] })] }));
|
253
|
+
});
|
254
|
+
const MappingTestableContextMenu = observer(forwardRef(function TestContainerContextMenu(props, ref) {
|
255
|
+
const { addName, add, rename, _delete } = props;
|
256
|
+
const addTest = () => {
|
257
|
+
add?.();
|
258
|
+
};
|
259
|
+
const remove = () => _delete?.();
|
260
|
+
const handleRename = () => rename?.();
|
261
|
+
return (_jsxs(MenuContent, { ref: ref, children: [rename && (_jsx(MenuContentItem, { onClick: handleRename, children: "Rename" })), _delete && _jsx(MenuContentItem, { onClick: remove, children: "Delete" }), addName && rename && (_jsx(MenuContentItem, { onClick: addTest, children: `Add ${addName}` }))] }));
|
262
|
+
}));
|
263
|
+
const MappingTestItem = observer((props) => {
|
264
|
+
const { mappingTestState, suiteState } = props;
|
265
|
+
const mappingTest = mappingTestState.test;
|
266
|
+
const isRunning = mappingTestState.runningTestAction.isInProgress;
|
267
|
+
const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] = useState(false);
|
268
|
+
const isReadOnly = suiteState.mappingTestableState.mappingEditorState.isReadOnly;
|
269
|
+
const openTest = () => suiteState.changeTest(mappingTest);
|
270
|
+
const isActive = suiteState.selectTestState?.test === mappingTest;
|
271
|
+
const _testableResult = getTestableResultFromTestResult(mappingTestState.testResultState.result);
|
272
|
+
const testableResult = isRunning
|
273
|
+
? TESTABLE_RESULT.IN_PROGRESS
|
274
|
+
: _testableResult;
|
275
|
+
const resultIcon = getTestableResultIcon(testableResult);
|
276
|
+
const onContextMenuOpen = () => setIsSelectedFromContextMenu(true);
|
277
|
+
const onContextMenuClose = () => setIsSelectedFromContextMenu(false);
|
278
|
+
const add = () => {
|
279
|
+
suiteState.setShowModal(true);
|
280
|
+
};
|
281
|
+
const _delete = () => {
|
282
|
+
suiteState.changeTest(mappingTest);
|
283
|
+
};
|
284
|
+
const rename = () => {
|
285
|
+
suiteState.setRenameTest(mappingTest);
|
286
|
+
};
|
287
|
+
return (_jsx(ContextMenu, { className: clsx('testable-test-explorer__item', {
|
288
|
+
'testable-test-explorer__item--selected-from-context-menu': !isActive && isSelectedFromContextMenu,
|
289
|
+
}, { 'testable-test-explorer__item--active': isActive }), disabled: isReadOnly, content: _jsx(MappingTestableContextMenu, { addName: "Test", add: add, _delete: _delete, rename: rename }), menuProps: { elevation: 7 }, onOpen: onContextMenuOpen, onClose: onContextMenuClose, children: _jsxs("button", { className: clsx('testable-test-explorer__item__label'), onClick: openTest, tabIndex: -1, children: [_jsx("div", { className: "testable-test-explorer__item__label__icon", children: resultIcon }), _jsx("div", { className: "testable-test-explorer__item__label__text", children: mappingTest.id })] }) }));
|
290
|
+
});
|
291
|
+
const MappingTestSuiteEditor = observer((props) => {
|
292
|
+
const { mappingTestSuiteState } = props;
|
293
|
+
const selectedTestState = mappingTestSuiteState.selectTestState;
|
294
|
+
const isReadOnly = mappingTestSuiteState.mappingTestableState.mappingEditorState.isReadOnly;
|
295
|
+
const addTest = () => mappingTestSuiteState.setShowModal(true);
|
296
|
+
const runTests = () => {
|
297
|
+
mappingTestSuiteState.runTests();
|
298
|
+
};
|
299
|
+
const runFailingTests = () => {
|
300
|
+
mappingTestSuiteState.runFailingTests();
|
301
|
+
};
|
302
|
+
const renderMappingTestSuiteDriver = () => {
|
303
|
+
if (mappingTestSuiteState instanceof MappingDataTestSuiteState) {
|
304
|
+
return (_jsx(MappingTestableStoreDataEditor, { mappingTestableDataState: mappingTestSuiteState.dataState }));
|
305
|
+
}
|
306
|
+
else if (mappingTestSuiteState instanceof MappingQueryTestSuiteState) {
|
307
|
+
return (_jsx(MappingTestableQueryEditor, { testableQueryState: mappingTestSuiteState.queryState, mappingTestableState: mappingTestSuiteState.mappingTestableState, isReadOnly: isReadOnly }, mappingTestSuiteState.queryState.uuid));
|
308
|
+
}
|
309
|
+
return null;
|
310
|
+
};
|
311
|
+
const renderMappingTestEditor = () => {
|
312
|
+
if (selectedTestState) {
|
313
|
+
return _jsx(MappingTestEditor, { mappingTestState: selectedTestState });
|
314
|
+
}
|
315
|
+
else if (!mappingTestSuiteState.suite.tests.length) {
|
316
|
+
return (_jsx(BlankPanelPlaceholder, { text: "Add Mapping Test", onClick: addTest, clickActionType: "add", tooltipText: "Click to add mapping test" }));
|
317
|
+
}
|
318
|
+
return null;
|
319
|
+
};
|
320
|
+
const renameTest = (test, val) => {
|
321
|
+
if (test) {
|
322
|
+
atomicTest_setId(test, val);
|
323
|
+
}
|
324
|
+
};
|
325
|
+
return (_jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { size: 300, minSize: 28, children: renderMappingTestSuiteDriver() }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 56, children: _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsxs(ResizablePanel, { size: 300, minSize: 28, children: [_jsxs("div", { className: "binding-editor__header", children: [_jsx("div", { className: "binding-editor__header__title", children: _jsx("div", { className: "panel__header__title__content", children: "Tests" }) }), _jsxs("div", { className: "panel__header__actions", children: [_jsx("button", { className: "panel__header__action testable-test-explorer__play__all__icon", tabIndex: -1, onClick: runTests, title: "Run All Tests", children: _jsx(RunAllIcon, {}) }), _jsx("button", { className: "panel__header__action testable-test-explorer__play__all__icon", tabIndex: -1, onClick: runFailingTests, title: "Run All Failing Tests", children: _jsx(RunErrorsIcon, {}) }), _jsx("button", { className: "panel__header__action", tabIndex: -1, onClick: addTest, title: "Add Mapping Suite", children: _jsx(PlusIcon, {}) })] })] }), _jsxs(PanelContent, { children: [mappingTestSuiteState.testsStates.map((test) => (_jsx(MappingTestItem, { mappingTestState: test, suiteState: mappingTestSuiteState }, test.uuid))), mappingTestSuiteState.renameTest && (_jsx(RenameModal, { val: mappingTestSuiteState.renameTest.id, isReadOnly: isReadOnly, showModal: true, closeModal: () => mappingTestSuiteState.setRenameTest(undefined), setValue: (val) => renameTest(mappingTestSuiteState.renameTest, val) })), mappingTestSuiteState.showCreateModal && (_jsx(CreateTestModal, { mappingSuiteState: mappingTestSuiteState }))] })] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 28, children: renderMappingTestEditor() })] }) })] }));
|
326
|
+
});
|
327
|
+
const MappingTestSuiteItem = observer((props) => {
|
328
|
+
const { suite, mappingTestableState } = props;
|
329
|
+
const [isSelectedFromContextMenu, setIsSelectedFromContextMenu] = useState(false);
|
330
|
+
const isReadOnly = mappingTestableState.mappingEditorState.isReadOnly;
|
331
|
+
const openSuite = () => mappingTestableState.changeSuite(suite);
|
332
|
+
const isActive = mappingTestableState.selectedTestSuite?.suite === suite;
|
333
|
+
// const _testableResult = getTestableResultFromTestResult(
|
334
|
+
// serviceTestState.testResultState.result,
|
335
|
+
// );
|
336
|
+
// const testableResult = isRunning
|
337
|
+
// ? TESTABLE_RESULT.IN_PROGRESS
|
338
|
+
// : _testableResult;
|
339
|
+
// const resultIcon = getTestableResultIcon(testableResult);
|
340
|
+
const onContextMenuOpen = () => setIsSelectedFromContextMenu(true);
|
341
|
+
const onContextMenuClose = () => setIsSelectedFromContextMenu(false);
|
342
|
+
const add = () => {
|
343
|
+
mappingTestableState.createSuiteState.setShowModal(true);
|
344
|
+
};
|
345
|
+
const _delete = () => {
|
346
|
+
mappingTestableState.deleteTestSuite(suite);
|
347
|
+
};
|
348
|
+
const rename = () => {
|
349
|
+
mappingTestableState.setSuiteToRename(suite);
|
350
|
+
};
|
351
|
+
return (_jsx(ContextMenu, { className: clsx('testable-test-explorer__item', {
|
352
|
+
'testable-test-explorer__item--selected-from-context-menu': !isActive && isSelectedFromContextMenu,
|
353
|
+
}, { 'testable-test-explorer__item--active': isActive }), disabled: isReadOnly, content: _jsx(MappingTestableContextMenu, { addName: "Suite", add: add, _delete: _delete, rename: rename }), menuProps: { elevation: 7 }, onOpen: onContextMenuOpen, onClose: onContextMenuClose, children: _jsxs("button", { className: clsx('testable-test-explorer__item__label'), onClick: openSuite, tabIndex: -1, children: [_jsx("div", { className: "testable-test-explorer__item__label__icon" }), _jsx("div", { className: "testable-test-explorer__item__label__text", children: suite.id })] }) }));
|
354
|
+
});
|
355
|
+
export const MappingTestableEditor = observer((props) => {
|
356
|
+
const { mappingTestableState } = props;
|
357
|
+
const mappingEditorState = mappingTestableState.mappingEditorState;
|
358
|
+
useEffect(() => {
|
359
|
+
mappingTestableState.init();
|
360
|
+
}, [mappingTestableState]);
|
361
|
+
const isReadOnly = mappingEditorState.isReadOnly;
|
362
|
+
const suites = mappingTestableState.mapping.tests;
|
363
|
+
const selectedSuiteState = mappingTestableState.selectedTestSuite;
|
364
|
+
const addSuite = () => mappingTestableState.createSuiteState.setShowModal(true);
|
365
|
+
const runSuites = () => {
|
366
|
+
mappingTestableState.runAllSuites();
|
367
|
+
};
|
368
|
+
const runFailingTests = () => {
|
369
|
+
mappingTestableState.runAllFailingSuites();
|
370
|
+
};
|
371
|
+
const renderSuiteState = () => {
|
372
|
+
if (selectedSuiteState) {
|
373
|
+
return (_jsx(MappingTestSuiteEditor, { mappingTestSuiteState: selectedSuiteState }));
|
374
|
+
}
|
375
|
+
else if (!suites.length) {
|
376
|
+
return (_jsx(BlankPanelPlaceholder, { text: "Add Test Suite", onClick: addSuite, clickActionType: "add", tooltipText: "Click to add test suite" }));
|
377
|
+
}
|
378
|
+
return null;
|
379
|
+
};
|
380
|
+
const renameSuite = (val, suite) => {
|
381
|
+
if (suite) {
|
382
|
+
testSuite_setId(suite, val);
|
383
|
+
}
|
384
|
+
};
|
385
|
+
return (_jsx("div", { className: "service-test-suite-editor panel", children: _jsxs("div", { className: "service-test-suite-editor", children: [_jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsxs(ResizablePanel, { size: 150, minSize: 28, children: [_jsxs("div", { className: "binding-editor__header", children: [_jsx("div", { className: "binding-editor__header__title", children: _jsx("div", { className: "panel__header__title__content", children: "Test Suites" }) }), _jsxs("div", { className: "panel__header__actions", children: [_jsx("button", { className: "panel__header__action testable-test-explorer__play__all__icon", tabIndex: -1, onClick: runSuites, title: "Run All Suites", children: _jsx(RunAllIcon, {}) }), _jsx("button", { className: "panel__header__action testable-test-explorer__play__all__icon", tabIndex: -1, onClick: runFailingTests, title: "Run All Failing Tests", children: _jsx(RunErrorsIcon, {}) }), _jsx("button", { className: "panel__header__action", tabIndex: -1, onClick: addSuite, title: "Add Mapping Suite", children: _jsx(PlusIcon, {}) })] })] }), _jsx(PanelContent, { children: suites.map((suite) => (_jsx(MappingTestSuiteItem, { mappingTestableState: mappingTestableState, suite: suite }, suite.id))) }), !suites.length && (_jsx(BlankPanelPlaceholder, { disabled: mappingEditorState.isReadOnly, onClick: addSuite, text: "Add a Test Suite", clickActionType: "add", tooltipText: "Click to add a new mapping test suite" }))] }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-200)" }) }), _jsx(ResizablePanel, { minSize: 56, children: _jsxs("div", { className: "panel service-test-editor", children: [_jsx("div", { className: "service-test-suite-editor__header", children: _jsx("div", { className: "service-test-suite-editor__header__title", children: _jsx("div", { className: "service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--tests-suites", children: "suite" }) }) }), _jsx("div", { className: "service-test-editor__content", children: renderSuiteState() })] }) })] }), mappingTestableState.createSuiteState.showModal && (_jsx(CreateTestSuiteModal, { mappingTestableState: mappingTestableState })), mappingTestableState.suiteToRename && (_jsx(RenameModal, { val: mappingTestableState.suiteToRename.id, isReadOnly: isReadOnly, showModal: true, closeModal: () => mappingTestableState.setSuiteToRename(undefined), setValue: (val) => renameSuite(val, mappingTestableState.suiteToRename) }))] }) }));
|
386
|
+
});
|
387
|
+
//# sourceMappingURL=MappingTestableEditor.js.map
|