@finos/legend-application-studio 28.14.0 → 28.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js +93 -14
- package/lib/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js +7 -1
- package/lib/components/editor/editor-group/service-editor/ServiceRegistrationEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts +1 -13
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js +7 -21
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.js.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts +12 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.d.ts.map +1 -1
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js +13 -3
- package/lib/components/editor/editor-group/testable/TestableSharedComponents.js.map +1 -1
- package/lib/index.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +34 -10
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +174 -95
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +1 -8
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +1 -70
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js +2 -4
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts +2 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +6 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +0 -8
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +3 -73
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +12 -2
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +120 -16
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts +7 -1
- package/lib/stores/editor/utils/TestableUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/TestableUtils.js +71 -2
- package/lib/stores/editor/utils/TestableUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts +6 -1
- package/lib/stores/graph-modifier/DomainGraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DomainGraphModifierHelper.js +16 -1
- package/lib/stores/graph-modifier/DomainGraphModifierHelper.js.map +1 -1
- package/package.json +4 -4
- package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx +376 -61
- package/src/components/editor/editor-group/service-editor/ServiceRegistrationEditor.tsx +38 -1
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestsEditor.tsx +18 -92
- package/src/components/editor/editor-group/testable/TestableSharedComponents.tsx +74 -1
- package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +280 -131
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +2 -94
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestingHelper.ts +5 -5
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +7 -0
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +1 -143
- package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +159 -19
- package/src/stores/editor/utils/TestableUtils.ts +144 -4
- package/src/stores/graph-modifier/DomainGraphModifierHelper.ts +33 -0
package/src/components/editor/editor-group/function-activator/testable/FunctionTestableEditor.tsx
CHANGED
@@ -18,7 +18,9 @@ import { observer } from 'mobx-react-lite';
|
|
18
18
|
import {
|
19
19
|
BlankPanelPlaceholder,
|
20
20
|
ContextMenu,
|
21
|
+
CustomSelectorInput,
|
21
22
|
Dialog,
|
23
|
+
FilledWindowMaximizeIcon,
|
22
24
|
MenuContent,
|
23
25
|
MenuContentItem,
|
24
26
|
Modal,
|
@@ -31,12 +33,14 @@ import {
|
|
31
33
|
PanelFormTextField,
|
32
34
|
PlayIcon,
|
33
35
|
PlusIcon,
|
36
|
+
RefreshIcon,
|
34
37
|
ResizablePanel,
|
35
38
|
ResizablePanelGroup,
|
36
39
|
ResizablePanelSplitter,
|
37
40
|
ResizablePanelSplitterLine,
|
38
41
|
RunAllIcon,
|
39
42
|
RunErrorsIcon,
|
43
|
+
TimesIcon,
|
40
44
|
clsx,
|
41
45
|
} from '@finos/legend-art';
|
42
46
|
import { forwardRef, useEffect, useRef, useState } from 'react';
|
@@ -44,18 +48,22 @@ import {
|
|
44
48
|
type FunctionTestSuite,
|
45
49
|
type DataElement,
|
46
50
|
type EmbeddedData,
|
51
|
+
type ValueSpecification,
|
47
52
|
DataElementReference,
|
48
53
|
PackageableElementExplicitReference,
|
49
54
|
RelationalCSVData,
|
50
55
|
ModelStoreData,
|
51
56
|
ExternalFormatData,
|
52
57
|
ModelEmbeddedData,
|
58
|
+
PrimitiveInstanceValue,
|
59
|
+
PrimitiveType,
|
53
60
|
} from '@finos/legend-graph';
|
54
|
-
import
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
61
|
+
import {
|
62
|
+
FunctionValueSpecificationTestParameterState,
|
63
|
+
type FunctionStoreTestDataState,
|
64
|
+
type FunctionTestState,
|
65
|
+
type FunctionTestSuiteState,
|
66
|
+
type FunctionTestableState,
|
59
67
|
} from '../../../../../stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js';
|
60
68
|
import {
|
61
69
|
TESTABLE_RESULT,
|
@@ -64,20 +72,32 @@ import {
|
|
64
72
|
} from '../../../../../stores/editor/sidebar-state/testable/GlobalTestRunnerState.js';
|
65
73
|
import { flowResult } from 'mobx';
|
66
74
|
import { getTestableResultIcon } from '../../../side-bar/testable/GlobalTestRunner.js';
|
67
|
-
import { atomicTest_setDoc } from '../../../../../stores/graph-modifier/Testable_GraphModifierHelper.js';
|
68
75
|
import {
|
76
|
+
ExternalFormatParameterEditorModal,
|
69
77
|
RenameModal,
|
70
78
|
SharedDataElementModal,
|
71
79
|
TestAssertionEditor,
|
72
80
|
} from '../../testable/TestableSharedComponents.js';
|
73
|
-
import {
|
81
|
+
import {
|
82
|
+
filterByType,
|
83
|
+
prettyCONSTName,
|
84
|
+
returnUndefOnError,
|
85
|
+
} from '@finos/legend-shared';
|
74
86
|
import {
|
75
87
|
EmbeddedDataCreatorFromEmbeddedData,
|
76
88
|
validateTestableId,
|
89
|
+
type TestParamContentType,
|
90
|
+
getContentTypeWithParamFromQuery,
|
77
91
|
} from '../../../../../stores/editor/utils/TestableUtils.js';
|
78
92
|
import { EmbeddedDataEditor } from '../../data-editor/EmbeddedDataEditor.js';
|
79
93
|
import { LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY } from '../../../../../__lib__/LegendStudioApplicationNavigationContext.js';
|
80
94
|
import { useApplicationNavigationContext } from '@finos/legend-application';
|
95
|
+
import {
|
96
|
+
BasicValueSpecificationEditor,
|
97
|
+
instanceValue_setValue,
|
98
|
+
} from '@finos/legend-query-builder';
|
99
|
+
import { TESTABLE_TEST_TAB } from '../../../../../stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js';
|
100
|
+
import { atomicTest_setDoc } from '../../../../../stores/graph-modifier/Testable_GraphModifierHelper.js';
|
81
101
|
|
82
102
|
const FunctionTestableContextMenu = observer(
|
83
103
|
forwardRef<
|
@@ -279,9 +299,9 @@ const FunctionTestDataStateEditor = observer(
|
|
279
299
|
};
|
280
300
|
return (
|
281
301
|
<div className="service-test-data-editor">
|
282
|
-
<div className="
|
283
|
-
<div className="
|
284
|
-
<div className="
|
302
|
+
<div className="function-testable-editor__header">
|
303
|
+
<div className="function-testable-editor__header__title">
|
304
|
+
<div className="function-testable-editor__header__title__label">
|
285
305
|
input data
|
286
306
|
</div>
|
287
307
|
</div>
|
@@ -336,49 +356,345 @@ const FunctionTestDataStateEditor = observer(
|
|
336
356
|
},
|
337
357
|
);
|
338
358
|
|
359
|
+
const FunctionTestParameterEditor = observer(
|
360
|
+
(props: {
|
361
|
+
isReadOnly: boolean;
|
362
|
+
paramState: FunctionValueSpecificationTestParameterState;
|
363
|
+
functionTestState: FunctionTestState;
|
364
|
+
contentTypeParamPair: TestParamContentType | undefined;
|
365
|
+
}) => {
|
366
|
+
const { functionTestState, paramState, isReadOnly, contentTypeParamPair } =
|
367
|
+
props;
|
368
|
+
const [showPopUp, setShowPopUp] = useState(false);
|
369
|
+
const paramIsRequired =
|
370
|
+
paramState.varExpression.multiplicity.lowerBound > 0;
|
371
|
+
const type = contentTypeParamPair
|
372
|
+
? contentTypeParamPair.contentType
|
373
|
+
: paramState.varExpression.genericType?.value.rawType.name ?? 'unknown';
|
374
|
+
const paramValue =
|
375
|
+
paramState.varExpression.genericType?.value.rawType === PrimitiveType.BYTE
|
376
|
+
? atob(
|
377
|
+
(paramState.valueSpec as PrimitiveInstanceValue)
|
378
|
+
.values[0] as string,
|
379
|
+
)
|
380
|
+
: ((paramState.valueSpec as PrimitiveInstanceValue)
|
381
|
+
.values[0] as string);
|
382
|
+
|
383
|
+
const openInPopUp = (): void => setShowPopUp(!showPopUp);
|
384
|
+
const closePopUp = (): void => setShowPopUp(false);
|
385
|
+
const updateParamValue = (val: string): void => {
|
386
|
+
if (paramState.valueSpec instanceof PrimitiveInstanceValue) {
|
387
|
+
instanceValue_setValue(
|
388
|
+
paramState.valueSpec,
|
389
|
+
paramState.varExpression.genericType?.value.rawType ===
|
390
|
+
PrimitiveType.BYTE
|
391
|
+
? btoa(val)
|
392
|
+
: val,
|
393
|
+
0,
|
394
|
+
functionTestState.editorStore.changeDetectionState.observerContext,
|
395
|
+
);
|
396
|
+
paramState.updateValueSpecification(paramState.valueSpec);
|
397
|
+
}
|
398
|
+
};
|
399
|
+
|
400
|
+
return (
|
401
|
+
<div
|
402
|
+
key={paramState.parameterValue.name}
|
403
|
+
className="panel__content__form__section"
|
404
|
+
>
|
405
|
+
<div className="panel__content__form__section__header__label">
|
406
|
+
{paramState.parameterValue.name}
|
407
|
+
<button
|
408
|
+
className={clsx('type-tree__node__type__label', {})}
|
409
|
+
tabIndex={-1}
|
410
|
+
title={type}
|
411
|
+
>
|
412
|
+
{type}
|
413
|
+
</button>
|
414
|
+
</div>
|
415
|
+
<>
|
416
|
+
{contentTypeParamPair ? (
|
417
|
+
<div className="service-test-editor__setup__parameter__code-editor">
|
418
|
+
<textarea
|
419
|
+
className="panel__content__form__section__textarea value-spec-editor__input"
|
420
|
+
spellCheck={false}
|
421
|
+
value={paramValue}
|
422
|
+
placeholder={
|
423
|
+
((paramState.valueSpec as PrimitiveInstanceValue)
|
424
|
+
.values[0] as string) === ''
|
425
|
+
? '(empty)'
|
426
|
+
: undefined
|
427
|
+
}
|
428
|
+
onChange={(event) => {
|
429
|
+
updateParamValue(event.target.value);
|
430
|
+
}}
|
431
|
+
/>
|
432
|
+
{showPopUp && (
|
433
|
+
<ExternalFormatParameterEditorModal
|
434
|
+
valueSpec={paramState.valueSpec}
|
435
|
+
varExpression={paramState.varExpression}
|
436
|
+
isReadOnly={isReadOnly}
|
437
|
+
onClose={closePopUp}
|
438
|
+
updateParamValue={updateParamValue}
|
439
|
+
contentTypeParamPair={contentTypeParamPair}
|
440
|
+
/>
|
441
|
+
)}
|
442
|
+
<div className="service-test-editor__setup__parameter__value__actions">
|
443
|
+
<button
|
444
|
+
className={clsx(
|
445
|
+
'service-test-editor__setup__parameter__code-editor__expand-btn',
|
446
|
+
)}
|
447
|
+
onClick={openInPopUp}
|
448
|
+
tabIndex={-1}
|
449
|
+
title="Open in a popup..."
|
450
|
+
>
|
451
|
+
<FilledWindowMaximizeIcon />
|
452
|
+
</button>
|
453
|
+
<button
|
454
|
+
className={clsx(
|
455
|
+
'btn--icon btn--dark btn--sm service-test-editor__setup__parameter__code-editor__expand-btn',
|
456
|
+
)}
|
457
|
+
disabled={isReadOnly || paramIsRequired}
|
458
|
+
onClick={(): void =>
|
459
|
+
functionTestState.removeParamValueState(paramState)
|
460
|
+
}
|
461
|
+
tabIndex={-1}
|
462
|
+
title={
|
463
|
+
paramIsRequired ? 'Parameter Required' : 'Remove Parameter'
|
464
|
+
}
|
465
|
+
>
|
466
|
+
<TimesIcon />
|
467
|
+
</button>
|
468
|
+
</div>
|
469
|
+
</div>
|
470
|
+
) : (
|
471
|
+
<div className="service-test-editor__setup__parameter__value">
|
472
|
+
<BasicValueSpecificationEditor
|
473
|
+
valueSpecification={paramState.valueSpec}
|
474
|
+
setValueSpecification={(val: ValueSpecification): void => {
|
475
|
+
paramState.updateValueSpecification(val);
|
476
|
+
}}
|
477
|
+
graph={functionTestState.editorStore.graphManagerState.graph}
|
478
|
+
obseverContext={
|
479
|
+
functionTestState.editorStore.changeDetectionState
|
480
|
+
.observerContext
|
481
|
+
}
|
482
|
+
typeCheckOption={{
|
483
|
+
expectedType:
|
484
|
+
paramState.varExpression.genericType?.value.rawType ??
|
485
|
+
PrimitiveType.STRING,
|
486
|
+
}}
|
487
|
+
className="query-builder__parameters__value__editor"
|
488
|
+
resetValue={(): void => {
|
489
|
+
paramState.resetValueSpec();
|
490
|
+
}}
|
491
|
+
/>
|
492
|
+
<div className="service-test-editor__setup__parameter__value__actions">
|
493
|
+
<button
|
494
|
+
className="btn--icon btn--dark btn--sm"
|
495
|
+
disabled={isReadOnly || paramIsRequired}
|
496
|
+
onClick={(): void =>
|
497
|
+
functionTestState.removeParamValueState(paramState)
|
498
|
+
}
|
499
|
+
tabIndex={-1}
|
500
|
+
title={
|
501
|
+
paramIsRequired ? 'Parameter Required' : 'Remove Parameter'
|
502
|
+
}
|
503
|
+
>
|
504
|
+
<TimesIcon />
|
505
|
+
</button>
|
506
|
+
</div>
|
507
|
+
</div>
|
508
|
+
)}
|
509
|
+
</>
|
510
|
+
</div>
|
511
|
+
);
|
512
|
+
},
|
513
|
+
);
|
514
|
+
|
515
|
+
const NewParameterModal = observer(
|
516
|
+
(props: { functionTestState: FunctionTestState; isReadOnly: boolean }) => {
|
517
|
+
const { functionTestState, isReadOnly } = props;
|
518
|
+
const currentOption = {
|
519
|
+
value: functionTestState.newParameterValueName,
|
520
|
+
label: functionTestState.newParameterValueName,
|
521
|
+
};
|
522
|
+
const options = functionTestState.newParamOptions;
|
523
|
+
const closeModal = (): void =>
|
524
|
+
functionTestState.setShowNewParameterModal(false);
|
525
|
+
const onChange = (val: { label: string; value: string } | null): void => {
|
526
|
+
if (val === null) {
|
527
|
+
functionTestState.setNewParameterValueName('');
|
528
|
+
} else if (val.value !== functionTestState.newParameterValueName) {
|
529
|
+
functionTestState.setNewParameterValueName(val.value);
|
530
|
+
}
|
531
|
+
};
|
532
|
+
return (
|
533
|
+
<Dialog
|
534
|
+
open={functionTestState.showNewParameterModal}
|
535
|
+
onClose={closeModal}
|
536
|
+
classes={{ container: 'search-modal__container' }}
|
537
|
+
PaperProps={{ classes: { root: 'search-modal__inner-container' } }}
|
538
|
+
>
|
539
|
+
<form
|
540
|
+
onSubmit={(event) => {
|
541
|
+
event.preventDefault();
|
542
|
+
functionTestState.addParameterValue();
|
543
|
+
}}
|
544
|
+
className="modal modal--dark search-modal"
|
545
|
+
>
|
546
|
+
<div className="modal__title">New Test Parameter Value </div>
|
547
|
+
<CustomSelectorInput
|
548
|
+
className="panel__content__form__section__dropdown"
|
549
|
+
options={options}
|
550
|
+
onChange={onChange}
|
551
|
+
value={currentOption}
|
552
|
+
escapeClearsValue={true}
|
553
|
+
darkMode={true}
|
554
|
+
disable={isReadOnly}
|
555
|
+
/>
|
556
|
+
<div className="search-modal__actions">
|
557
|
+
<button className="btn btn--dark" disabled={isReadOnly}>
|
558
|
+
Add
|
559
|
+
</button>
|
560
|
+
</div>
|
561
|
+
</form>
|
562
|
+
</Dialog>
|
563
|
+
);
|
564
|
+
},
|
565
|
+
);
|
566
|
+
|
339
567
|
const FunctionTestEditor = observer(
|
340
568
|
(props: { functionTestState: FunctionTestState }) => {
|
341
569
|
const { functionTestState } = props;
|
342
|
-
const
|
570
|
+
const selectedTab = functionTestState.selectedTab;
|
571
|
+
const addParameter = (): void => {
|
572
|
+
functionTestState.setShowNewParameterModal(true);
|
573
|
+
};
|
574
|
+
const generateParameterValues = (): void => {
|
575
|
+
functionTestState.generateTestParameterValues();
|
576
|
+
};
|
577
|
+
useEffect(() => {
|
578
|
+
functionTestState.syncWithQuery();
|
579
|
+
}, [functionTestState]);
|
343
580
|
return (
|
344
|
-
<div className="
|
345
|
-
<div className="
|
346
|
-
<div className="
|
347
|
-
<
|
348
|
-
|
349
|
-
<div
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
581
|
+
<div className="function-test-editor panel">
|
582
|
+
<div className="panel__header">
|
583
|
+
<div className="panel__header service-test-editor__header--with-tabs">
|
584
|
+
<div className="uml-element-editor__tabs">
|
585
|
+
{Object.values(TESTABLE_TEST_TAB).map((tab) => (
|
586
|
+
<div
|
587
|
+
key={tab}
|
588
|
+
onClick={(): void => functionTestState.setSelectedTab(tab)}
|
589
|
+
className={clsx('service-test-editor__tab', {
|
590
|
+
'service-test-editor__tab--active':
|
591
|
+
tab === functionTestState.selectedTab,
|
592
|
+
})}
|
593
|
+
>
|
594
|
+
{prettyCONSTName(tab)}
|
595
|
+
</div>
|
596
|
+
))}
|
597
|
+
</div>
|
598
|
+
</div>
|
599
|
+
</div>
|
600
|
+
<div className="panel">
|
601
|
+
{selectedTab === TESTABLE_TEST_TAB.ASSERTION &&
|
602
|
+
functionTestState.selectedAsertionState && (
|
603
|
+
<TestAssertionEditor
|
604
|
+
testAssertionState={functionTestState.selectedAsertionState}
|
605
|
+
/>
|
606
|
+
)}
|
607
|
+
{selectedTab === TESTABLE_TEST_TAB.SETUP &&
|
608
|
+
functionTestState.selectedAsertionState && (
|
609
|
+
<>
|
610
|
+
<div className="function-test-editor__doc">
|
611
|
+
<div className="panel__content__form__section ">
|
612
|
+
<div className="panel__content__form__section__header__label">
|
613
|
+
Test Documentation
|
366
614
|
</div>
|
615
|
+
<textarea
|
616
|
+
className="panel__content__form__section__textarea mapping-testable-editor__doc__textarea"
|
617
|
+
spellCheck={false}
|
618
|
+
value={functionTestState.test.doc ?? ''}
|
619
|
+
onChange={(event) => {
|
620
|
+
atomicTest_setDoc(
|
621
|
+
functionTestState.test,
|
622
|
+
event.target.value ? event.target.value : undefined,
|
623
|
+
);
|
624
|
+
}}
|
625
|
+
/>
|
367
626
|
</div>
|
368
627
|
</div>
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
628
|
+
|
629
|
+
{Boolean(functionTestState.parameterValueStates.length) && (
|
630
|
+
<div className="service-test-data-editor panel">
|
631
|
+
<div className="service-test-suite-editor__header">
|
632
|
+
<div className="service-test-suite-editor__header__title">
|
633
|
+
<div className="service-test-suite-editor__header__title__label">
|
634
|
+
parameters
|
635
|
+
</div>
|
636
|
+
</div>
|
637
|
+
<div className="panel__header__actions">
|
638
|
+
<button
|
639
|
+
className="panel__header__action service-execution-editor__test-data__generate-btn"
|
640
|
+
onClick={generateParameterValues}
|
641
|
+
disabled={!functionTestState.newParamOptions.length}
|
642
|
+
title="Generate test parameter values"
|
643
|
+
tabIndex={-1}
|
644
|
+
>
|
645
|
+
<div className="service-execution-editor__test-data__generate-btn__label">
|
646
|
+
<RefreshIcon className="service-execution-editor__test-data__generate-btn__label__icon" />
|
647
|
+
<div className="service-execution-editor__test-data__generate-btn__label__title">
|
648
|
+
Generate
|
649
|
+
</div>
|
650
|
+
</div>
|
651
|
+
</button>
|
652
|
+
<button
|
653
|
+
className="panel__header__action"
|
654
|
+
tabIndex={-1}
|
655
|
+
disabled={!functionTestState.newParamOptions.length}
|
656
|
+
onClick={addParameter}
|
657
|
+
title="Add Parameter Value"
|
658
|
+
>
|
659
|
+
<PlusIcon />
|
660
|
+
</button>
|
661
|
+
</div>
|
662
|
+
</div>
|
663
|
+
<div className="service-test-editor__setup__parameters">
|
664
|
+
{functionTestState.parameterValueStates
|
665
|
+
.filter(
|
666
|
+
filterByType(
|
667
|
+
FunctionValueSpecificationTestParameterState,
|
668
|
+
),
|
669
|
+
)
|
670
|
+
.map((paramState) => (
|
671
|
+
<FunctionTestParameterEditor
|
672
|
+
key={paramState.uuid}
|
673
|
+
isReadOnly={false}
|
674
|
+
paramState={paramState}
|
675
|
+
functionTestState={functionTestState}
|
676
|
+
contentTypeParamPair={getContentTypeWithParamFromQuery(
|
677
|
+
functionTestState.functionTestableState
|
678
|
+
.functionEditorState.bodyExpressionSequence,
|
679
|
+
functionTestState.functionTestableState
|
680
|
+
.editorStore,
|
681
|
+
).find(
|
682
|
+
(pair) =>
|
683
|
+
pair.param === paramState.parameterValue.name,
|
684
|
+
)}
|
685
|
+
/>
|
686
|
+
))}
|
687
|
+
</div>
|
688
|
+
{functionTestState.showNewParameterModal && (
|
689
|
+
<NewParameterModal
|
690
|
+
functionTestState={functionTestState}
|
691
|
+
isReadOnly={false}
|
692
|
+
/>
|
693
|
+
)}
|
694
|
+
</div>
|
378
695
|
)}
|
379
|
-
|
380
|
-
|
381
|
-
</div>
|
696
|
+
</>
|
697
|
+
)}
|
382
698
|
</div>
|
383
699
|
</div>
|
384
700
|
);
|
@@ -551,7 +867,7 @@ const FunctionTestSuiteEditor = observer(
|
|
551
867
|
// TODO
|
552
868
|
};
|
553
869
|
|
554
|
-
const
|
870
|
+
const renderFunctionTestEditor = (): React.ReactNode => {
|
555
871
|
if (selectedTestState) {
|
556
872
|
return <FunctionTestEditor functionTestState={selectedTestState} />;
|
557
873
|
} else if (!functionTestSuiteState.suite.tests.length) {
|
@@ -645,7 +961,7 @@ const FunctionTestSuiteEditor = observer(
|
|
645
961
|
<ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
|
646
962
|
</ResizablePanelSplitter>
|
647
963
|
<ResizablePanel minSize={28}>
|
648
|
-
{
|
964
|
+
{renderFunctionTestEditor()}
|
649
965
|
</ResizablePanel>
|
650
966
|
</ResizablePanelGroup>
|
651
967
|
</ResizablePanel>
|
@@ -777,8 +1093,8 @@ export const FunctionTestableEditor = observer(
|
|
777
1093
|
);
|
778
1094
|
|
779
1095
|
return (
|
780
|
-
<div className="
|
781
|
-
<div className="
|
1096
|
+
<div className="function-testable-editor panel">
|
1097
|
+
<div className="function-testable-editor">
|
782
1098
|
<ResizablePanelGroup orientation="vertical">
|
783
1099
|
<ResizablePanel size={200} minSize={28}>
|
784
1100
|
<div className="binding-editor__header">
|
@@ -787,7 +1103,6 @@ export const FunctionTestableEditor = observer(
|
|
787
1103
|
Test Suites
|
788
1104
|
</div>
|
789
1105
|
</div>
|
790
|
-
|
791
1106
|
<div className="panel__header__actions">
|
792
1107
|
<button
|
793
1108
|
className="panel__header__action testable-test-explorer__play__all__icon"
|
@@ -831,23 +1146,23 @@ export const FunctionTestableEditor = observer(
|
|
831
1146
|
tooltipText="Click to add test suite"
|
832
1147
|
/>
|
833
1148
|
)}
|
1149
|
+
{!suites.length && (
|
1150
|
+
<BlankPanelPlaceholder
|
1151
|
+
disabled={functionEditorState.isReadOnly}
|
1152
|
+
onClick={addSuite}
|
1153
|
+
text="Add a Test Suite"
|
1154
|
+
clickActionType="add"
|
1155
|
+
tooltipText="Click to add a new function test suite"
|
1156
|
+
/>
|
1157
|
+
)}
|
834
1158
|
</PanelContent>
|
835
|
-
{!suites.length && (
|
836
|
-
<BlankPanelPlaceholder
|
837
|
-
disabled={functionEditorState.isReadOnly}
|
838
|
-
onClick={addSuite}
|
839
|
-
text="Add a Test Suite"
|
840
|
-
clickActionType="add"
|
841
|
-
tooltipText="Click to add a new function test suite"
|
842
|
-
/>
|
843
|
-
)}
|
844
1159
|
</ResizablePanel>
|
845
1160
|
<ResizablePanelSplitter>
|
846
1161
|
<ResizablePanelSplitterLine color="var(--color-dark-grey-200)" />
|
847
1162
|
</ResizablePanelSplitter>
|
848
1163
|
<ResizablePanel minSize={56}>
|
849
|
-
<div className="
|
850
|
-
<div className="
|
1164
|
+
<div className="function-test-suite-editor">
|
1165
|
+
<div className="function-test-suite-editor__content">
|
851
1166
|
{renderSuiteState()}
|
852
1167
|
</div>
|
853
1168
|
</div>
|
@@ -117,6 +117,12 @@ export const ServiceRegistrationEditor = observer(() => {
|
|
117
117
|
);
|
118
118
|
};
|
119
119
|
|
120
|
+
const toggleUseGenerateOpenApi = (): void => {
|
121
|
+
registrationState.setUseGenerateOpenApi(
|
122
|
+
!registrationState.TEMPORARY__useGenerateOpenApi,
|
123
|
+
);
|
124
|
+
};
|
125
|
+
|
120
126
|
// actions
|
121
127
|
const registerService = (): void => {
|
122
128
|
if (selectedEnvOption && selectedServiceType) {
|
@@ -281,7 +287,38 @@ export const ServiceRegistrationEditor = observer(() => {
|
|
281
287
|
</div>
|
282
288
|
</div>
|
283
289
|
}
|
284
|
-
|
290
|
+
{registrationState.serviceExecutionMode ===
|
291
|
+
ServiceExecutionMode.PROD && (
|
292
|
+
<div className="panel__content__form__section">
|
293
|
+
<div className="panel__content__form__section__header__label">
|
294
|
+
Generate Open Api
|
295
|
+
</div>
|
296
|
+
<div
|
297
|
+
className="panel__content__form__section__toggler"
|
298
|
+
onClick={toggleUseGenerateOpenApi}
|
299
|
+
>
|
300
|
+
<button
|
301
|
+
className={clsx(
|
302
|
+
'panel__content__form__section__toggler__btn',
|
303
|
+
{
|
304
|
+
'panel__content__form__section__toggler__btn--toggled':
|
305
|
+
registrationState.TEMPORARY__useGenerateOpenApi,
|
306
|
+
},
|
307
|
+
)}
|
308
|
+
tabIndex={-1}
|
309
|
+
>
|
310
|
+
{registrationState.TEMPORARY__useGenerateOpenApi ? (
|
311
|
+
<CheckSquareIcon />
|
312
|
+
) : (
|
313
|
+
<SquareIcon />
|
314
|
+
)}
|
315
|
+
</button>
|
316
|
+
<div className="panel__content__form__section__toggler__prompt">
|
317
|
+
Generate Open Api
|
318
|
+
</div>
|
319
|
+
</div>
|
320
|
+
</div>
|
321
|
+
)}
|
285
322
|
<div className="panel__content__form__section">
|
286
323
|
<div className="panel__content__form__section__header__label">
|
287
324
|
Project Version
|