@finos/legend-application-studio 26.1.8 → 26.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.d.ts.map +1 -1
  2. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js +2 -2
  3. package/lib/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.js.map +1 -1
  4. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts +15 -2
  5. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.d.ts.map +1 -1
  6. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js +46 -5
  7. package/lib/components/editor/editor-group/data-editor/EmbeddedDataEditor.js.map +1 -1
  8. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.d.ts.map +1 -1
  9. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js +18 -3
  10. package/lib/components/editor/editor-group/data-editor/RelationalCSVDataEditor.js.map +1 -1
  11. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.d.ts.map +1 -1
  12. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js +2 -2
  13. package/lib/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.js.map +1 -1
  14. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.d.ts.map +1 -1
  15. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js +0 -3
  16. package/lib/components/editor/editor-group/mapping-editor/MappingEditor.js.map +1 -1
  17. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.d.ts.map +1 -1
  18. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js +36 -72
  19. package/lib/components/editor/editor-group/mapping-editor/MappingTestableEditor.js.map +1 -1
  20. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts +5 -0
  21. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
  22. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +53 -8
  23. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
  24. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.d.ts.map +1 -1
  25. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js +3 -1
  26. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.js.map +1 -1
  27. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
  28. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +7 -3
  29. package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
  30. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +1 -1
  31. package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
  32. package/lib/index.css +2 -2
  33. package/lib/index.css.map +1 -1
  34. package/lib/package.json +3 -3
  35. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts +22 -1
  36. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.d.ts.map +1 -1
  37. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js +56 -5
  38. package/lib/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.js.map +1 -1
  39. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +12 -12
  40. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
  41. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +113 -61
  42. package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
  43. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts +4 -2
  44. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.d.ts.map +1 -1
  45. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js +23 -9
  46. package/lib/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.js.map +1 -1
  47. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +5 -2
  48. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
  49. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +23 -16
  50. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
  51. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -2
  52. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
  53. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +11 -7
  54. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
  55. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts +3 -2
  56. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
  57. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +29 -8
  58. package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
  59. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts +2 -2
  60. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.d.ts.map +1 -1
  61. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js +8 -6
  62. package/lib/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.js.map +1 -1
  63. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +14 -2
  64. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
  65. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +75 -5
  66. package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
  67. package/lib/stores/editor/utils/MockDataUtils.d.ts +4 -1
  68. package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
  69. package/lib/stores/editor/utils/MockDataUtils.js +70 -2
  70. package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
  71. package/lib/stores/editor/utils/TestableUtils.d.ts +1 -2
  72. package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
  73. package/lib/stores/editor/utils/TestableUtils.js +4 -13
  74. package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
  75. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts +6 -2
  76. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.d.ts.map +1 -1
  77. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js +23 -4
  78. package/lib/stores/graph-modifier/DSL_Data_GraphModifierHelper.js.map +1 -1
  79. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js +1 -1
  80. package/lib/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.js.map +1 -1
  81. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts +1 -0
  82. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.d.ts.map +1 -1
  83. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js +3 -0
  84. package/lib/stores/graph-modifier/STO_Relational_GraphModifierHelper.js.map +1 -1
  85. package/package.json +13 -13
  86. package/src/components/editor/editor-group/connection-editor/RelationalDatabaseConnectionEditor.tsx +13 -0
  87. package/src/components/editor/editor-group/data-editor/EmbeddedDataEditor.tsx +129 -3
  88. package/src/components/editor/editor-group/data-editor/RelationalCSVDataEditor.tsx +65 -0
  89. package/src/components/editor/editor-group/external-format-editor/DSL_ExternalFormat_NewSchemaSetDriver.tsx +6 -3
  90. package/src/components/editor/editor-group/mapping-editor/MappingEditor.tsx +0 -6
  91. package/src/components/editor/editor-group/mapping-editor/MappingTestableEditor.tsx +159 -366
  92. package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +187 -61
  93. package/src/components/editor/editor-group/service-editor/testable/ServiceTestableEditor.tsx +26 -18
  94. package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +85 -83
  95. package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +2 -2
  96. package/src/stores/editor/editor-state/element-editor-state/data/EmbeddedDataState.ts +75 -4
  97. package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +157 -69
  98. package/src/stores/editor/editor-state/element-editor-state/service/ServiceEditorState.ts +45 -10
  99. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +37 -15
  100. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +15 -8
  101. package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +57 -6
  102. package/src/stores/editor/editor-state/element-editor-state/testable/TestAssertionState.ts +10 -6
  103. package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +92 -3
  104. package/src/stores/editor/utils/MockDataUtils.ts +109 -1
  105. package/src/stores/editor/utils/TestableUtils.ts +4 -19
  106. package/src/stores/graph-modifier/DSL_Data_GraphModifierHelper.ts +45 -6
  107. package/src/stores/graph-modifier/DSL_Mapping_GraphModifierHelper.ts +1 -1
  108. package/src/stores/graph-modifier/STO_Relational_GraphModifierHelper.ts +6 -0
@@ -24,8 +24,10 @@ import {
24
24
  MaskIcon,
25
25
  MenuContent,
26
26
  MenuContentItem,
27
+ Modal,
27
28
  ModalBody,
28
29
  ModalFooter,
30
+ ModalFooterButton,
29
31
  ModalHeader,
30
32
  PanelLoadingIndicator,
31
33
  PlusIcon,
@@ -36,10 +38,13 @@ import {
36
38
  ResizablePanelSplitter,
37
39
  ResizablePanelSplitterLine,
38
40
  } from '@finos/legend-art';
39
- import type {
40
- IdentifiedConnection,
41
- ConnectionTestData,
42
- DataElement,
41
+ import {
42
+ type IdentifiedConnection,
43
+ type ConnectionTestData,
44
+ type DataElement,
45
+ getAllIdentifiedServiceConnections,
46
+ DataElementReference,
47
+ PackageableElementExplicitReference,
43
48
  } from '@finos/legend-graph';
44
49
  import { observer } from 'mobx-react-lite';
45
50
  import { forwardRef, useState } from 'react';
@@ -60,8 +65,84 @@ import { buildElementOption } from '@finos/legend-lego/graph-editor';
60
65
  import { prettyCONSTName } from '@finos/legend-shared';
61
66
  import type { DSL_Data_LegendStudioApplicationPlugin_Extension } from '../../../../../stores/extensions/DSL_Data_LegendStudioApplicationPlugin_Extension.js';
62
67
  import { useEditorStore } from '../../../EditorStoreProvider.js';
63
- import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../../../../__lib__/LegendStudioDocumentation.js';
64
68
  import { LambdaParameterValuesEditor } from '@finos/legend-query-builder';
69
+ import { LEGEND_STUDIO_DOCUMENTATION_KEY } from '../../../../../__lib__/LegendStudioDocumentation.js';
70
+
71
+ export const UseDataElementModal = observer(
72
+ (props: { connectionTestDataState: ConnectionTestDataState }) => {
73
+ const { connectionTestDataState } = props;
74
+ const editorStore = connectionTestDataState.editorStore;
75
+ const useSharedModal = connectionTestDataState.useSharedModal;
76
+ const closeModal = (): void =>
77
+ connectionTestDataState.setUseSharedModal(false);
78
+ const dataElements =
79
+ connectionTestDataState.editorStore.graphManagerState.graph.dataElements;
80
+ const [dataElement, setDataElement] = useState(dataElements[0]);
81
+ const dataElementOptions =
82
+ editorStore.graphManagerState.usableDataElements.map(buildElementOption);
83
+ const selectedDataElement = dataElement
84
+ ? buildElementOption(dataElement)
85
+ : null;
86
+ const onDataElementChange = (val: {
87
+ label: string;
88
+ value?: DataElement;
89
+ }): void => {
90
+ if (val.value !== selectedDataElement?.value && val.value) {
91
+ setDataElement(val.value);
92
+ }
93
+ };
94
+ const change = (): void => {
95
+ if (dataElement) {
96
+ const value = new DataElementReference();
97
+ value.dataElement =
98
+ PackageableElementExplicitReference.create(dataElement);
99
+ connectionTestDataState.changeEmbeddedData(value);
100
+ }
101
+ closeModal();
102
+ };
103
+ const isReadOnly =
104
+ connectionTestDataState.testDataState.testSuiteState.testableState
105
+ .serviceEditorState.isReadOnly;
106
+ return (
107
+ <Dialog
108
+ open={useSharedModal}
109
+ onClose={closeModal}
110
+ classes={{ container: 'search-modal__container' }}
111
+ PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
112
+ >
113
+ <Modal darkMode={true} className="service-test-data-modal">
114
+ <ModalBody>
115
+ <div className="panel__content__form__section">
116
+ <div className="panel__content__form__section__header__label">
117
+ Data Element
118
+ </div>
119
+ <div className="explorer__new-element-modal__driver">
120
+ <CustomSelectorInput
121
+ className="panel__content__form__section__dropdown data-element-reference-editor__value__dropdown"
122
+ disabled={false}
123
+ options={dataElementOptions}
124
+ onChange={onDataElementChange}
125
+ value={selectedDataElement}
126
+ darkMode={true}
127
+ />
128
+ </div>
129
+ </div>
130
+ </ModalBody>
131
+ <ModalFooter>
132
+ <ModalFooterButton
133
+ className="database-builder__action--btn"
134
+ disabled={isReadOnly}
135
+ onClick={change}
136
+ title="Change to use Shared Data"
137
+ >
138
+ Change
139
+ </ModalFooterButton>
140
+ </ModalFooter>
141
+ </Modal>
142
+ </Dialog>
143
+ );
144
+ },
145
+ );
65
146
 
66
147
  export const ConnectionTestDataEditor = observer(
67
148
  (props: { connectionTestDataState: ConnectionTestDataState }) => {
@@ -72,6 +153,13 @@ export const ConnectionTestDataEditor = observer(
72
153
  const isReadOnly =
73
154
  connectionTestDataState.testDataState.testSuiteState.testableState
74
155
  .serviceEditorState.isReadOnly;
156
+ const dataElements =
157
+ connectionTestDataState.editorStore.graphManagerState.graph.dataElements;
158
+ const openShared = (): void => {
159
+ if (dataElements.length) {
160
+ connectionTestDataState.setUseSharedModal(true);
161
+ }
162
+ };
75
163
  // test data
76
164
  const anonymizeGeneratedData =
77
165
  connectionTestDataState.anonymizeGeneratedData;
@@ -159,6 +247,22 @@ export const ConnectionTestDataEditor = observer(
159
247
  </div>
160
248
  </div>
161
249
  </button>
250
+ <button
251
+ className="panel__header__action service-execution-editor__test-data__generate-btn"
252
+ onClick={openShared}
253
+ title="Use Shared Data via Defined Data Element"
254
+ disabled={
255
+ connectionTestDataState.generatingTestDataState.isInProgress ||
256
+ !dataElements.length
257
+ }
258
+ tabIndex={-1}
259
+ >
260
+ <div className="service-execution-editor__test-data__generate-btn__label">
261
+ <div className="service-execution-editor__test-data__generate-btn__label__title">
262
+ Shared Data
263
+ </div>
264
+ </div>
265
+ </button>
162
266
  </div>
163
267
  </div>
164
268
  <EmbeddedDataEditor
@@ -176,6 +280,11 @@ export const ConnectionTestDataEditor = observer(
176
280
  lambdaParametersState={connectionTestDataState.parametersState}
177
281
  />
178
282
  )}
283
+ {connectionTestDataState.useSharedModal && (
284
+ <UseDataElementModal
285
+ connectionTestDataState={connectionTestDataState}
286
+ />
287
+ )}
179
288
  </div>
180
289
  );
181
290
  },
@@ -279,13 +388,15 @@ export const NewConnectionDataModal = observer(
279
388
  };
280
389
  const isReadOnly =
281
390
  testDataState.testSuiteState.testableState.serviceEditorState.isReadOnly;
391
+ const service =
392
+ testDataState.testSuiteState.testableState.serviceEditorState.service;
282
393
  const closeModal = (): void => newConnectionState.setModal(false);
283
- const connectionOptions = testDataState.allIdentifiedConnections.map(
284
- (e) => ({
285
- label: e.id,
286
- value: e,
287
- }),
288
- );
394
+ const allIdentifiedConnections =
395
+ getAllIdentifiedServiceConnections(service);
396
+ const connectionOptions = allIdentifiedConnections.map((e) => ({
397
+ label: e.id,
398
+ value: e,
399
+ }));
289
400
  const selectedConnection = newConnectionState.connection
290
401
  ? {
291
402
  label: newConnectionState.connection.id,
@@ -294,7 +405,7 @@ export const NewConnectionDataModal = observer(
294
405
  : undefined;
295
406
  const isDisabled =
296
407
  isReadOnly ||
297
- !testDataState.allIdentifiedConnections.length ||
408
+ !allIdentifiedConnections.length ||
298
409
  Boolean(
299
410
  testDataState.testData.connectionsTestData.find(
300
411
  (c) => c.connectionId === selectedConnection?.value.id,
@@ -439,6 +550,15 @@ export const ServiceTestDataEditor = observer(
439
550
  const applicationStore = useApplicationStore();
440
551
  const testData = testDataState.testData;
441
552
  const newConnectionDataState = testDataState.newConnectionDataState;
553
+ const identifedConnections = getAllIdentifiedServiceConnections(
554
+ testDataState.testSuiteState.testableState.service,
555
+ );
556
+ const selectedDataState = testDataState.selectedDataState;
557
+ const hideExplorer =
558
+ identifedConnections.length === 1 &&
559
+ testData.connectionsTestData.length === 1 &&
560
+ testData.connectionsTestData[0]?.connectionId ===
561
+ identifedConnections[0]?.id;
442
562
  const addConnectionTestData = (): void => {
443
563
  testDataState.newConnectionDataState.openModal();
444
564
  };
@@ -451,7 +571,7 @@ export const ServiceTestDataEditor = observer(
451
571
  <div className="service-test-suite-editor__header">
452
572
  <div className="service-test-suite-editor__header__title">
453
573
  <div className="service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--data">
454
- test suite data
574
+ Test DATA
455
575
  </div>
456
576
  </div>
457
577
  </div>
@@ -464,63 +584,69 @@ export const ServiceTestDataEditor = observer(
464
584
  tooltipText="Click to add connection test data"
465
585
  />
466
586
  )}
467
- <ResizablePanelGroup orientation="vertical">
468
- <ResizablePanel minSize={100}>
469
- <div className="binding-editor__header">
470
- <div className="binding-editor__header__title">
471
- <div className="binding-editor__header__title__label">
472
- connections
587
+ {hideExplorer && selectedDataState ? (
588
+ <ConnectionTestDataEditor
589
+ connectionTestDataState={selectedDataState}
590
+ />
591
+ ) : (
592
+ <ResizablePanelGroup orientation="vertical">
593
+ <ResizablePanel minSize={100}>
594
+ <div className="binding-editor__header">
595
+ <div className="binding-editor__header__title">
596
+ <div className="binding-editor__header__title__label">
597
+ connections
598
+ <button
599
+ className="binding-editor__header__title__label__hint"
600
+ tabIndex={-1}
601
+ onClick={seeDocumentation}
602
+ title="click to see more details on connection test data"
603
+ >
604
+ <InfoCircleIcon />
605
+ </button>
606
+ </div>
607
+ </div>
608
+ <div className="panel__header__actions">
473
609
  <button
474
- className="binding-editor__header__title__label__hint"
610
+ className="panel__header__action"
475
611
  tabIndex={-1}
476
- onClick={seeDocumentation}
477
- title="click to see more details on connection test data"
612
+ onClick={addConnectionTestData}
613
+ title="Add Connection Test Data"
478
614
  >
479
- <InfoCircleIcon />
615
+ <PlusIcon />
480
616
  </button>
481
617
  </div>
482
618
  </div>
483
- <div className="panel__header__actions">
484
- <button
485
- className="panel__header__action"
486
- tabIndex={-1}
487
- onClick={addConnectionTestData}
488
- title="Add Connection Test Data"
489
- >
490
- <PlusIcon />
491
- </button>
619
+ <div>
620
+ {testData.connectionsTestData.map((connectionTestData) => (
621
+ <ConnectionTestDataItem
622
+ key={connectionTestData.connectionId}
623
+ serviceTestDataState={testDataState}
624
+ connectionTestData={connectionTestData}
625
+ />
626
+ ))}
492
627
  </div>
493
- </div>
494
- <div>
495
- {testData.connectionsTestData.map((connectionTestData) => (
496
- <ConnectionTestDataItem
497
- key={connectionTestData.connectionId}
498
- serviceTestDataState={testDataState}
499
- connectionTestData={connectionTestData}
628
+ </ResizablePanel>
629
+ <ResizablePanelSplitter>
630
+ <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
631
+ </ResizablePanelSplitter>
632
+ <ResizablePanel minSize={600}>
633
+ <PanelLoadingIndicator
634
+ isLoading={Boolean(
635
+ testDataState.selectedDataState?.generatingTestDataState
636
+ .isInProgress,
637
+ )}
638
+ />
639
+ {testDataState.selectedDataState && (
640
+ <ConnectionTestDataEditor
641
+ connectionTestDataState={testDataState.selectedDataState}
500
642
  />
501
- ))}
502
- </div>
503
- </ResizablePanel>
504
- <ResizablePanelSplitter>
505
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
506
- </ResizablePanelSplitter>
507
- <ResizablePanel minSize={600}>
508
- <PanelLoadingIndicator
509
- isLoading={Boolean(
510
- testDataState.selectedDataState?.generatingTestDataState
511
- .isInProgress,
512
643
  )}
513
- />
514
- {testDataState.selectedDataState && (
515
- <ConnectionTestDataEditor
516
- connectionTestDataState={testDataState.selectedDataState}
517
- />
518
- )}
519
- {newConnectionDataState.showModal && (
520
- <NewConnectionDataModal testDataState={testDataState} />
521
- )}
522
- </ResizablePanel>
523
- </ResizablePanelGroup>
644
+ {newConnectionDataState.showModal && (
645
+ <NewConnectionDataModal testDataState={testDataState} />
646
+ )}
647
+ </ResizablePanel>
648
+ </ResizablePanelGroup>
649
+ )}
524
650
  </div>
525
651
  </div>
526
652
  );
@@ -49,26 +49,34 @@ import { RenameModal } from '../../testable/TestableSharedComponents.js';
49
49
  export const ServiceTestSuiteEditor = observer(
50
50
  (props: { serviceTestSuiteState: ServiceTestSuiteState }) => {
51
51
  const { serviceTestSuiteState } = props;
52
+ const serviceRuntime =
53
+ serviceTestSuiteState.testableState.serviceEditorState.executionState
54
+ .serviceExecutionParameters?.runtime;
55
+
52
56
  return (
53
57
  <div className="service-test-suite-editor">
54
- <ResizablePanelGroup orientation="horizontal">
55
- <ResizablePanel size={300} minSize={28}>
56
- {serviceTestSuiteState.testDataState && (
57
- <ServiceTestDataEditor
58
- testDataState={serviceTestSuiteState.testDataState}
59
- />
60
- )}
61
- {!serviceTestSuiteState.testDataState && (
62
- <BlankPanelContent>No test data specified</BlankPanelContent>
63
- )}
64
- </ResizablePanel>
65
- <ResizablePanelSplitter>
66
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
67
- </ResizablePanelSplitter>
68
- <ResizablePanel minSize={56}>
69
- <ServiceTestsEditor suiteState={serviceTestSuiteState} />
70
- </ResizablePanel>
71
- </ResizablePanelGroup>
58
+ {serviceRuntime ? (
59
+ <ResizablePanelGroup orientation="horizontal">
60
+ <ResizablePanel size={300} minSize={28}>
61
+ {serviceTestSuiteState.testDataState && (
62
+ <ServiceTestDataEditor
63
+ testDataState={serviceTestSuiteState.testDataState}
64
+ />
65
+ )}
66
+ {!serviceTestSuiteState.testDataState && (
67
+ <BlankPanelContent>No test data specified</BlankPanelContent>
68
+ )}
69
+ </ResizablePanel>
70
+ <ResizablePanelSplitter>
71
+ <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
72
+ </ResizablePanelSplitter>
73
+ <ResizablePanel minSize={56}>
74
+ <ServiceTestsEditor suiteState={serviceTestSuiteState} />
75
+ </ResizablePanel>
76
+ </ResizablePanelGroup>
77
+ ) : (
78
+ <ServiceTestsEditor suiteState={serviceTestSuiteState} />
79
+ )}
72
80
  </div>
73
81
  );
74
82
  },
@@ -542,6 +542,11 @@ const TestAssertionsEditor = observer(
542
542
  const isReadOnly =
543
543
  serviceTestState.suiteState.testableState.serviceEditorState.isReadOnly;
544
544
  const editorStore = serviceTestState.editorStore;
545
+ const selectedAsertionState = serviceTestState.selectedAsertionState;
546
+ const hideExplorer =
547
+ serviceTestState.test.assertions.length === 1 &&
548
+ serviceTestState.selectedAsertionState?.assertion.id ===
549
+ serviceTestState.test.assertions[0]?.id;
545
550
  const addAssertion = (): void => serviceTestState.addAssertion();
546
551
  const renameAssertion = (val: string): void =>
547
552
  testAssertion_setId(
@@ -555,95 +560,92 @@ const TestAssertionsEditor = observer(
555
560
  };
556
561
  return (
557
562
  <div className="panel service-test-editor">
558
- <div className="service-test-suite-editor__header">
559
- <div className="service-test-suite-editor__header__title">
560
- <div className="service-test-suite-editor__header__title__label service-test-suite-editor__header__title__label--assertions">
561
- assertions
562
- </div>
563
- </div>
564
- </div>
565
- <div className="service-test-editor__content">
566
- <ResizablePanelGroup orientation="vertical">
567
- <ResizablePanel minSize={100} size={200}>
568
- <div className="binding-editor__header">
569
- <div className="binding-editor__header__title">
570
- <div className="testable-test-assertion-explorer__header__summary">
571
- <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--assertion">
572
- <TestTubeIcon />
563
+ {hideExplorer && selectedAsertionState ? (
564
+ <TestAssertionEditor testAssertionState={selectedAsertionState} />
565
+ ) : (
566
+ <div className="service-test-editor__content">
567
+ <ResizablePanelGroup orientation="vertical">
568
+ <ResizablePanel minSize={100} size={200}>
569
+ <div className="binding-editor__header">
570
+ <div className="binding-editor__header__title">
571
+ <div className="testable-test-assertion-explorer__header__summary">
572
+ <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--assertion">
573
+ <TestTubeIcon />
574
+ </div>
575
+ <div>{serviceTestState.assertionCount}</div>
573
576
  </div>
574
- <div>{serviceTestState.assertionCount}</div>
575
- </div>
576
- <div className="testable-test-assertion-explorer__header__summary">
577
- <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--passed">
578
- <CheckCircleIcon />
577
+ <div className="testable-test-assertion-explorer__header__summary">
578
+ <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--passed">
579
+ <CheckCircleIcon />
580
+ </div>
581
+ <div>{serviceTestState.assertionPassed}</div>
579
582
  </div>
580
- <div>{serviceTestState.assertionPassed}</div>
581
- </div>
582
- <div className="testable-test-assertion-explorer__header__summary">
583
- <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--failed">
584
- <TimesCircleIcon />
583
+ <div className="testable-test-assertion-explorer__header__summary">
584
+ <div className="testable-test-assertion-explorer__header__summary__icon testable-test-assertion-explorer__header__summary__icon--failed">
585
+ <TimesCircleIcon />
586
+ </div>
587
+ <div>{serviceTestState.assertionFailed}</div>
585
588
  </div>
586
- <div>{serviceTestState.assertionFailed}</div>
589
+ </div>
590
+ <div className="panel__header__actions">
591
+ <button
592
+ className="panel__header__action testable-test-explorer__play__all__icon"
593
+ tabIndex={-1}
594
+ onClick={runTest}
595
+ title="Run All Assertions"
596
+ >
597
+ <RunAllIcon />
598
+ </button>
599
+ <button
600
+ className="panel__header__action"
601
+ tabIndex={-1}
602
+ onClick={addAssertion}
603
+ title="Add Test Assertion"
604
+ >
605
+ <PlusIcon />
606
+ </button>
587
607
  </div>
588
608
  </div>
589
- <div className="panel__header__actions">
590
- <button
591
- className="panel__header__action testable-test-explorer__play__all__icon"
592
- tabIndex={-1}
593
- onClick={runTest}
594
- title="Run All Assertions"
595
- >
596
- <RunAllIcon />
597
- </button>
598
- <button
599
- className="panel__header__action"
600
- tabIndex={-1}
601
- onClick={addAssertion}
602
- title="Add Test Assertion"
603
- >
604
- <PlusIcon />
605
- </button>
609
+ <div>
610
+ {serviceTestState.assertionEditorStates.map(
611
+ (assertionState) => (
612
+ <TestAssertionItem
613
+ key={assertionState.assertion.id}
614
+ testableTestState={serviceTestState}
615
+ testAssertionEditorState={assertionState}
616
+ isReadOnly={
617
+ serviceTestState.suiteState.testableState
618
+ .serviceEditorState.isReadOnly
619
+ }
620
+ />
621
+ ),
622
+ )}
606
623
  </div>
607
- </div>
608
- <div>
609
- {serviceTestState.assertionEditorStates.map(
610
- (assertionState) => (
611
- <TestAssertionItem
612
- key={assertionState.assertion.id}
613
- testableTestState={serviceTestState}
614
- testAssertionEditorState={assertionState}
615
- isReadOnly={
616
- serviceTestState.suiteState.testableState
617
- .serviceEditorState.isReadOnly
618
- }
619
- />
620
- ),
624
+ {serviceTestState.assertionToRename && (
625
+ <RenameModal
626
+ val={serviceTestState.assertionToRename.id}
627
+ isReadOnly={isReadOnly}
628
+ showModal={true}
629
+ closeModal={(): void =>
630
+ serviceTestState.setAssertionToRename(undefined)
631
+ }
632
+ setValue={renameAssertion}
633
+ />
621
634
  )}
622
- </div>
623
- {serviceTestState.assertionToRename && (
624
- <RenameModal
625
- val={serviceTestState.assertionToRename.id}
626
- isReadOnly={isReadOnly}
627
- showModal={true}
628
- closeModal={(): void =>
629
- serviceTestState.setAssertionToRename(undefined)
630
- }
631
- setValue={renameAssertion}
632
- />
633
- )}
634
- </ResizablePanel>
635
- <ResizablePanelSplitter>
636
- <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
637
- </ResizablePanelSplitter>
638
- <ResizablePanel>
639
- {serviceTestState.selectedAsertionState && (
640
- <TestAssertionEditor
641
- testAssertionState={serviceTestState.selectedAsertionState}
642
- />
643
- )}
644
- </ResizablePanel>
645
- </ResizablePanelGroup>
646
- </div>
635
+ </ResizablePanel>
636
+ <ResizablePanelSplitter>
637
+ <ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
638
+ </ResizablePanelSplitter>
639
+ <ResizablePanel>
640
+ {selectedAsertionState && (
641
+ <TestAssertionEditor
642
+ testAssertionState={selectedAsertionState}
643
+ />
644
+ )}
645
+ </ResizablePanel>
646
+ </ResizablePanelGroup>
647
+ </div>
648
+ )}
647
649
  </div>
648
650
  );
649
651
  },
@@ -678,7 +680,7 @@ const ServiceTestEditor = observer(
678
680
  <ServiceTestSetupEditor serviceTestState={serviceTestState} />
679
681
  )}
680
682
 
681
- {selectedTab === TESTABLE_TEST_TAB.ASSERTIONS && (
683
+ {selectedTab === TESTABLE_TEST_TAB.ASSERTION && (
682
684
  <TestAssertionsEditor serviceTestState={serviceTestState} />
683
685
  )}
684
686
  </div>
@@ -497,12 +497,12 @@ export const TestAssertionEditor = observer(
497
497
  </div>
498
498
  </div>
499
499
  <div className="testable-test-assertion-editor__content">
500
- {selectedTab === TEST_ASSERTION_TAB.ASSERTION_SETUP && (
500
+ {selectedTab === TEST_ASSERTION_TAB.SETUP && (
501
501
  <div className="testable-test-assertion-editor__setup">
502
502
  {renderContent(testAssertionState.assertionState)}
503
503
  </div>
504
504
  )}
505
- {selectedTab === TEST_ASSERTION_TAB.ASSERTION_RESULT && (
505
+ {selectedTab === TEST_ASSERTION_TAB.RESULT && (
506
506
  <TestAssertionResultViewer
507
507
  testAssertionEditorState={testAssertionState}
508
508
  />