systemview 1.1.2 → 1.3.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/api/connections.txt +1 -1
- package/build/asset-manifest.json +29 -0
- package/build/favicon.ico +0 -0
- package/build/index.html +1 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/build/static/css/main.fb15c45d.chunk.css +16 -0
- package/build/static/css/main.fb15c45d.chunk.css.map +1 -0
- package/build/static/js/2.b89d4ccd.chunk.js +3 -0
- package/build/static/js/2.b89d4ccd.chunk.js.LICENSE.txt +435 -0
- package/build/static/js/2.b89d4ccd.chunk.js.map +1 -0
- package/build/static/js/3.0571e5a9.chunk.js +2 -0
- package/build/static/js/3.0571e5a9.chunk.js.map +1 -0
- package/build/static/js/main.a47760bc.chunk.js +2 -0
- package/build/static/js/main.a47760bc.chunk.js.map +1 -0
- package/build/static/js/runtime-main.17d324d3.js +2 -0
- package/build/static/js/runtime-main.17d324d3.js.map +1 -0
- package/package.json +4 -3
- package/server.js +19 -0
- package/babel.config.js +0 -12
- package/src/App.css +0 -38
- package/src/App.js +0 -30
- package/src/ServiceContext.js +0 -9
- package/src/assets/arrow.png +0 -0
- package/src/assets/clear.png +0 -0
- package/src/assets/edit.png +0 -0
- package/src/assets/expand-arrow.svg +0 -41
- package/src/assets/expand-button.svg +0 -41
- package/src/assets/iconfinder-icon (1).svg +0 -14
- package/src/assets/iconfinder-icon.svg +0 -14
- package/src/assets/icons-save-60.png +0 -0
- package/src/assets/missing-doc.png +0 -0
- package/src/assets/saved-doc.png +0 -0
- package/src/assets/sysly.png +0 -0
- package/src/assets/test-missing.png +0 -0
- package/src/assets/test-saved.png +0 -0
- package/src/atoms/Button/Button.js +0 -20
- package/src/atoms/Button/Button.test.js +0 -27
- package/src/atoms/Button/__snapshots__/Button.test.js.snap +0 -9
- package/src/atoms/Button/styles.scss +0 -35
- package/src/atoms/Count/index.js +0 -10
- package/src/atoms/Count/styles.scss +0 -25
- package/src/atoms/DataTable/DataTable.js +0 -27
- package/src/atoms/DataTable/DataTable.test.js +0 -55
- package/src/atoms/DataTable/__snapshots__/DataTable.test.js.snap +0 -36
- package/src/atoms/DataTable/styles.scss +0 -28
- package/src/atoms/DescriptionBox/DescriptionBox.js +0 -24
- package/src/atoms/DescriptionBox/DescriptionBox.test.js +0 -36
- package/src/atoms/DescriptionBox/__snapshots__/DescriptionBox.test.js.snap +0 -14
- package/src/atoms/DescriptionBox/styles.scss +0 -24
- package/src/atoms/DescriptionText/DescriptionText.js +0 -12
- package/src/atoms/DescriptionText/DescriptionText.test.js +0 -22
- package/src/atoms/DescriptionText/styles.scss +0 -10
- package/src/atoms/DocsIcon/DocsIcon.js +0 -20
- package/src/atoms/DocsIcon/DocsIcon.test.js +0 -23
- package/src/atoms/DocsIcon/styles.scss +0 -7
- package/src/atoms/ExpandableIcon/ExpandableIcon.js +0 -30
- package/src/atoms/ExpandableIcon/ExpandableIcon.test.js +0 -18
- package/src/atoms/ExpandableIcon/styles.scss +0 -5
- package/src/atoms/JsonTextBox/JsonTextBox.js +0 -61
- package/src/atoms/JsonTextBox/JsonTextBox.test.js +0 -0
- package/src/atoms/JsonTextBox/styles.scss +0 -41
- package/src/atoms/Link/Link.js +0 -17
- package/src/atoms/Link/Link.test.js +0 -33
- package/src/atoms/Link/styles.scss +0 -8
- package/src/atoms/List/List.js +0 -8
- package/src/atoms/List/List.test.js +0 -26
- package/src/atoms/List/styles.scss +0 -9
- package/src/atoms/Markdown/Markdown.js +0 -48
- package/src/atoms/Markdown/styles.scss +0 -414
- package/src/atoms/RunTestIcon/index.js +0 -41
- package/src/atoms/RunTestIcon/styles.scss +0 -16
- package/src/atoms/SaveIcon/SaveIcon.js +0 -6
- package/src/atoms/SaveIcon/styles.scss +0 -3
- package/src/atoms/Selector/Selector.js +0 -28
- package/src/atoms/Selector/Selector.test.js +0 -0
- package/src/atoms/Selector/styles.scss +0 -1
- package/src/atoms/StatusIndicator/StatusIndicator.js +0 -16
- package/src/atoms/StatusIndicator/styles.scss +0 -33
- package/src/atoms/TestsIcon/TestsIcon.js +0 -17
- package/src/atoms/TestsIcon/TestsIcon.test.js +0 -18
- package/src/atoms/TestsIcon/styles.scss +0 -0
- package/src/atoms/Text/Text.js +0 -8
- package/src/atoms/Text/Text.test.js +0 -21
- package/src/atoms/Text/styles.scss +0 -0
- package/src/atoms/Textbox/Textbox.js +0 -33
- package/src/atoms/Textbox/Textbox.test.js +0 -23
- package/src/atoms/Textbox/styles.scss +0 -14
- package/src/atoms/Title/Title.js +0 -12
- package/src/atoms/Title/Title.test.js +0 -0
- package/src/atoms/Title/styles.scss +0 -6
- package/src/atoms/Toggle/Toggle.js +0 -13
- package/src/atoms/Toggle/Toggle.test.js +0 -0
- package/src/atoms/Toggle/styles.scss +0 -62
- package/src/atoms/TypeSelector/TypeSelector.js +0 -28
- package/src/atoms/TypeSelector/TypeSelector.test.js +0 -0
- package/src/atoms/TypeSelector/styles.scss +0 -9
- package/src/index.css +0 -20
- package/src/index.js +0 -24
- package/src/logo.svg +0 -7
- package/src/molecules/Args/Args.js +0 -302
- package/src/molecules/Args/Args.test.js +0 -0
- package/src/molecules/Args/styles.scss +0 -166
- package/src/molecules/AutoCompleteBox/AutoCompleteBox.js +0 -101
- package/src/molecules/AutoCompleteBox/AutoCompleteBox.test.js +0 -0
- package/src/molecules/AutoCompleteBox/styles.scss +0 -35
- package/src/molecules/DataTableForm/DataTableForm.js +0 -167
- package/src/molecules/DataTableForm/DataTableForm.test.js +0 -0
- package/src/molecules/DataTableForm/styles.scss +0 -51
- package/src/molecules/EditBox/EditBox.js +0 -49
- package/src/molecules/EditBox/EditBox.test.js +0 -0
- package/src/molecules/EditBox/styles.scss +0 -38
- package/src/molecules/ExpandableList/ExpandableList.js +0 -26
- package/src/molecules/ExpandableList/ExpandableList.test.js +0 -33
- package/src/molecules/ExpandableList/styles.scss +0 -18
- package/src/molecules/ExpandableSection/ExpandableSection.js +0 -36
- package/src/molecules/ExpandableSection/ExpandableSection.test.js +0 -0
- package/src/molecules/ExpandableSection/styles.scss +0 -22
- package/src/molecules/ServerModulesList/ServerModulesList.js +0 -75
- package/src/molecules/ServerModulesList/styles.scss +0 -28
- package/src/molecules/TargetSelector/TargetSelector.js +0 -34
- package/src/molecules/TargetSelector/TargetSelector.test.js +0 -0
- package/src/molecules/TargetSelector/styles.scss +0 -0
- package/src/molecules/TestCaption/TestCaption.js +0 -26
- package/src/molecules/TestCaption/TestCaption.test.js +0 -0
- package/src/molecules/TestCaption/styles.scss +0 -40
- package/src/molecules/TestSummary/index.js +0 -212
- package/src/molecules/TestSummary/styles.scss +0 -83
- package/src/molecules/TextWith2Links/TextWith2Links.js +0 -10
- package/src/molecules/TextWith2Links/styles.scss +0 -0
- package/src/molecules/ValidationInput/ValidationInput.js +0 -64
- package/src/molecules/ValidationInput/ValidationInput.test.js +0 -0
- package/src/molecules/ValidationInput/ValidationMessages.js +0 -178
- package/src/molecules/ValidationInput/ValidationOptions.js +0 -113
- package/src/molecules/ValidationInput/styles.scss +0 -74
- package/src/molecules/ValidationInput/validator.js +0 -244
- package/src/organisms/Documentation/Documentation.js +0 -128
- package/src/organisms/Documentation/Documentation.test.js +0 -0
- package/src/organisms/Documentation/styles.scss +0 -22
- package/src/organisms/MultiTestSection/MultiTestSection.js +0 -85
- package/src/organisms/MultiTestSection/MultiTestSection.test.js +0 -0
- package/src/organisms/MultiTestSection/styles.scss +0 -22
- package/src/organisms/SavedTests/SavedTests.js +0 -209
- package/src/organisms/SavedTests/SavedTests.test.js +0 -0
- package/src/organisms/SavedTests/styles.scss +0 -76
- package/src/organisms/SavedTests/transformTests.js +0 -51
- package/src/organisms/ScratchPad/ScratchPad.js +0 -128
- package/src/organisms/ScratchPad/ScratchPad.test.js +0 -0
- package/src/organisms/ScratchPad/styles.scss +0 -100
- package/src/organisms/SystemNavigator/SystemNavigator.js +0 -148
- package/src/organisms/SystemNavigator/SystemNavigator.test.js +0 -24
- package/src/organisms/SystemNavigator/styles.scss +0 -38
- package/src/organisms/TestContainer/TestContainer.js +0 -72
- package/src/organisms/TestContainer/TestContainer.test.js +0 -0
- package/src/organisms/TestContainer/styles.scss +0 -20
- package/src/organisms/TestPanel/AfterTest/AfterTest.js +0 -16
- package/src/organisms/TestPanel/AfterTest/AfterTest.test.js +0 -0
- package/src/organisms/TestPanel/AfterTest/styles.scss +0 -0
- package/src/organisms/TestPanel/BeforeTest/BeforeTest.js +0 -16
- package/src/organisms/TestPanel/BeforeTest/BeforeTest.test.js +0 -0
- package/src/organisms/TestPanel/BeforeTest/styles.scss +0 -0
- package/src/organisms/TestPanel/Evaluations.js +0 -369
- package/src/organisms/TestPanel/EventsTest/EventsTest.js +0 -19
- package/src/organisms/TestPanel/EventsTest/styles.scss +0 -0
- package/src/organisms/TestPanel/MainTest/MainTest.js +0 -20
- package/src/organisms/TestPanel/MainTest/MainTest.test.js +0 -0
- package/src/organisms/TestPanel/MainTest/styles.scss +0 -143
- package/src/organisms/TestPanel/TestPanel.js +0 -170
- package/src/organisms/TestPanel/TestPanel.test.js +0 -0
- package/src/organisms/TestPanel/components/Argument.class.js +0 -94
- package/src/organisms/TestPanel/components/FullTestController.js +0 -78
- package/src/organisms/TestPanel/components/Test.class.js +0 -162
- package/src/organisms/TestPanel/components/TestController.class.js +0 -135
- package/src/organisms/TestPanel/components/test-helpers.js +0 -109
- package/src/organisms/TestPanel/styles.scss +0 -45
- package/src/pages/SystemView/SystemView.js +0 -68
- package/src/pages/SystemView/styles.scss +0 -81
- package/src/reportWebVitals.js +0 -13
- package/src/sass/bootstrap/_alert.scss +0 -51
- package/src/sass/bootstrap/_badge.scss +0 -47
- package/src/sass/bootstrap/_breadcrumb.scss +0 -38
- package/src/sass/bootstrap/_button-group.scss +0 -166
- package/src/sass/bootstrap/_buttons.scss +0 -143
- package/src/sass/bootstrap/_card.scss +0 -270
- package/src/sass/bootstrap/_carousel.scss +0 -191
- package/src/sass/bootstrap/_close.scss +0 -34
- package/src/sass/bootstrap/_code.scss +0 -56
- package/src/sass/bootstrap/_custom-forms.scss +0 -297
- package/src/sass/bootstrap/_dropdown.scss +0 -131
- package/src/sass/bootstrap/_forms.scss +0 -333
- package/src/sass/bootstrap/_functions.scss +0 -86
- package/src/sass/bootstrap/_grid.scss +0 -52
- package/src/sass/bootstrap/_images.scss +0 -42
- package/src/sass/bootstrap/_input-group.scss +0 -159
- package/src/sass/bootstrap/_jumbotron.scss +0 -16
- package/src/sass/bootstrap/_list-group.scss +0 -115
- package/src/sass/bootstrap/_media.scss +0 -8
- package/src/sass/bootstrap/_mixins.scss +0 -42
- package/src/sass/bootstrap/_modal.scss +0 -168
- package/src/sass/bootstrap/_nav.scss +0 -118
- package/src/sass/bootstrap/_navbar.scss +0 -311
- package/src/sass/bootstrap/_pagination.scss +0 -77
- package/src/sass/bootstrap/_popover.scss +0 -183
- package/src/sass/bootstrap/_print.scss +0 -124
- package/src/sass/bootstrap/_progress.scss +0 -33
- package/src/sass/bootstrap/_reboot.scss +0 -482
- package/src/sass/bootstrap/_root.scss +0 -19
- package/src/sass/bootstrap/_tables.scss +0 -180
- package/src/sass/bootstrap/_tooltip.scss +0 -115
- package/src/sass/bootstrap/_transitions.scss +0 -36
- package/src/sass/bootstrap/_type.scss +0 -125
- package/src/sass/bootstrap/_utilities.scss +0 -14
- package/src/sass/bootstrap/_variables.scss +0 -894
- package/src/sass/bootstrap/bootstrap-grid.scss +0 -32
- package/src/sass/bootstrap/bootstrap-reboot.scss +0 -12
- package/src/sass/bootstrap/bootstrap.scss +0 -42
- package/src/sass/bootstrap/mixins/_alert.scss +0 -13
- package/src/sass/bootstrap/mixins/_background-variant.scss +0 -21
- package/src/sass/bootstrap/mixins/_badge.scss +0 -12
- package/src/sass/bootstrap/mixins/_border-radius.scss +0 -35
- package/src/sass/bootstrap/mixins/_box-shadow.scss +0 -5
- package/src/sass/bootstrap/mixins/_breakpoints.scss +0 -123
- package/src/sass/bootstrap/mixins/_buttons.scss +0 -109
- package/src/sass/bootstrap/mixins/_caret.scss +0 -65
- package/src/sass/bootstrap/mixins/_clearfix.scss +0 -7
- package/src/sass/bootstrap/mixins/_float.scss +0 -11
- package/src/sass/bootstrap/mixins/_forms.scss +0 -137
- package/src/sass/bootstrap/mixins/_gradients.scss +0 -45
- package/src/sass/bootstrap/mixins/_grid-framework.scss +0 -67
- package/src/sass/bootstrap/mixins/_grid.scss +0 -52
- package/src/sass/bootstrap/mixins/_hover.scss +0 -39
- package/src/sass/bootstrap/mixins/_image.scss +0 -36
- package/src/sass/bootstrap/mixins/_list-group.scss +0 -21
- package/src/sass/bootstrap/mixins/_lists.scss +0 -7
- package/src/sass/bootstrap/mixins/_nav-divider.scss +0 -10
- package/src/sass/bootstrap/mixins/_navbar-align.scss +0 -10
- package/src/sass/bootstrap/mixins/_pagination.scss +0 -22
- package/src/sass/bootstrap/mixins/_reset-text.scss +0 -17
- package/src/sass/bootstrap/mixins/_resize.scss +0 -6
- package/src/sass/bootstrap/mixins/_screen-reader.scss +0 -35
- package/src/sass/bootstrap/mixins/_size.scss +0 -6
- package/src/sass/bootstrap/mixins/_table-row.scss +0 -30
- package/src/sass/bootstrap/mixins/_text-emphasis.scss +0 -14
- package/src/sass/bootstrap/mixins/_text-hide.scss +0 -9
- package/src/sass/bootstrap/mixins/_text-truncate.scss +0 -8
- package/src/sass/bootstrap/mixins/_transition.scss +0 -9
- package/src/sass/bootstrap/mixins/_visibility.scss +0 -7
- package/src/sass/bootstrap/utilities/_align.scss +0 -8
- package/src/sass/bootstrap/utilities/_background.scss +0 -19
- package/src/sass/bootstrap/utilities/_borders.scss +0 -59
- package/src/sass/bootstrap/utilities/_clearfix.scss +0 -3
- package/src/sass/bootstrap/utilities/_display.scss +0 -38
- package/src/sass/bootstrap/utilities/_embed.scss +0 -52
- package/src/sass/bootstrap/utilities/_flex.scss +0 -46
- package/src/sass/bootstrap/utilities/_float.scss +0 -9
- package/src/sass/bootstrap/utilities/_position.scss +0 -36
- package/src/sass/bootstrap/utilities/_screenreaders.scss +0 -11
- package/src/sass/bootstrap/utilities/_sizing.scss +0 -12
- package/src/sass/bootstrap/utilities/_spacing.scss +0 -51
- package/src/sass/bootstrap/utilities/_text.scss +0 -52
- package/src/sass/bootstrap/utilities/_visibility.scss +0 -11
- package/src/setupTests.js +0 -5
- /package/{src/assets/fonts/FontsFree-Net-SFMono-Regular.ttf → build/static/media/FontsFree-Net-SFMono-Regular.9647425e.ttf} +0 -0
- /package/{src/assets/fonts/Malkor-Regular.ttf → build/static/media/Malkor-Regular.f55d6a82.ttf} +0 -0
- /package/{src/assets/check.svg → build/static/media/check.c17549c7.svg} +0 -0
- /package/{src/assets/error.svg → build/static/media/error.1d9e99c1.svg} +0 -0
- /package/{src/assets/eval-icon.svg → build/static/media/eval-icon.c95744a8.svg} +0 -0
- /package/{src/assets/loading.gif → build/static/media/loading.10ca842f.gif} +0 -0
- /package/{src/assets/test-icon.svg → build/static/media/test-icon.2b1ada73.svg} +0 -0
- /package/{src/assets/x.svg → build/static/media/x.f680188c.svg} +0 -0
|
@@ -1,369 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import ExpandableSection from "../../molecules/ExpandableSection/ExpandableSection";
|
|
3
|
-
import ValidationInput from "../../molecules/ValidationInput/ValidationInput";
|
|
4
|
-
import ValidationOptions, {
|
|
5
|
-
inputToTypes,
|
|
6
|
-
} from "../../molecules/ValidationInput/ValidationOptions";
|
|
7
|
-
import TypeSelector from "../../atoms/TypeSelector/TypeSelector";
|
|
8
|
-
import { getErrors, defaultValue } from "../../molecules/ValidationInput/validator";
|
|
9
|
-
import Count from "../../atoms/Count";
|
|
10
|
-
import { endsWithArrayIndex } from "./components/test-helpers";
|
|
11
|
-
|
|
12
|
-
const validationCount = (evaluations) =>
|
|
13
|
-
evaluations.reduce((sum, e) => (e.save ? e.validations.length + 1 : 0) + sum, 0);
|
|
14
|
-
export default function Evaluations({ test, updateTests }) {
|
|
15
|
-
const { evaluations, errors } = test;
|
|
16
|
-
const [open, setOpen] = useState(false);
|
|
17
|
-
const [saveAll, setSaveAll] = useState(!test.savedEvaluations.length);
|
|
18
|
-
const [totalValidations, setTotalValidations] = useState(
|
|
19
|
-
validationCount(test.evaluations)
|
|
20
|
-
);
|
|
21
|
-
const toggleExpansion = () => {
|
|
22
|
-
setOpen((state) => !state);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const updateEvaluation = (evaluation) => {
|
|
26
|
-
evaluation.errors = getErrors(evaluation);
|
|
27
|
-
test.addEvaluation(evaluation);
|
|
28
|
-
test.errors = test.getErrors();
|
|
29
|
-
updateTests();
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const addValidation = (x) => {
|
|
33
|
-
const { expected_type } = evaluations[x];
|
|
34
|
-
const input_type = ValidationOptions[expected_type].inputs[0];
|
|
35
|
-
evaluations[x].validations.push({
|
|
36
|
-
name: ValidationOptions[expected_type].values[0],
|
|
37
|
-
value: defaultValue(inputToTypes[input_type]),
|
|
38
|
-
});
|
|
39
|
-
updateEvaluation(evaluations[x]);
|
|
40
|
-
setTotalValidations(validationCount(evaluations));
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const deleteValidation = (x, y) => {
|
|
44
|
-
evaluations[x].validations.splice(y, 1);
|
|
45
|
-
updateEvaluation(evaluations[x]);
|
|
46
|
-
setTotalValidations(validationCount(evaluations));
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const updateValidations = (x, y, p, v) => {
|
|
50
|
-
evaluations[x].validations[y][p] = v;
|
|
51
|
-
updateEvaluation(evaluations[x]);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const updateExpectedType = (x, e) => {
|
|
55
|
-
evaluations[x].expected_type = e.target.value;
|
|
56
|
-
evaluations[x].validations = [];
|
|
57
|
-
updateEvaluation(evaluations[x]);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const updateSaveStatus = (x, save) => {
|
|
61
|
-
evaluations[x].save = save;
|
|
62
|
-
updateEvaluation(evaluations[x]);
|
|
63
|
-
setTotalValidations(validationCount(evaluations));
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const toggleAllSaveStatuses = () => {
|
|
67
|
-
setSaveAll(!saveAll);
|
|
68
|
-
test.evaluations = test.evaluations.map((e) => ({ ...e, save: !saveAll }));
|
|
69
|
-
test.errors = test.getErrors();
|
|
70
|
-
updateTests();
|
|
71
|
-
setTotalValidations(validationCount(evaluations));
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (test.test_end !== null) {
|
|
76
|
-
updateTests(test.evaluations);
|
|
77
|
-
} else {
|
|
78
|
-
updateTests([]);
|
|
79
|
-
}
|
|
80
|
-
if (test.test_end !== null) setTotalValidations(validationCount(test.evaluations));
|
|
81
|
-
}, [test.evaluations, test.test_end]);
|
|
82
|
-
|
|
83
|
-
return (
|
|
84
|
-
<div className={`evaluations evaluations--visible-${evaluations.length > 0}`}>
|
|
85
|
-
<ExpandableSection
|
|
86
|
-
open={open}
|
|
87
|
-
toggleExpansion={toggleExpansion}
|
|
88
|
-
title={
|
|
89
|
-
<>
|
|
90
|
-
<div className={`evaluations__title evaluations--error-${errors.length > 0}`}>
|
|
91
|
-
<span className="evaluations__namespace">
|
|
92
|
-
{errors.length > 0 ? "Test Failed: " : "Test Passed: "}
|
|
93
|
-
</span>
|
|
94
|
-
<span
|
|
95
|
-
className={`evaluations__type evaluations--error-${errors.length > 0}`}
|
|
96
|
-
>
|
|
97
|
-
<Count count={errors.length} type={errors.length && "error"} /> errors
|
|
98
|
-
</span>
|
|
99
|
-
<Count count={totalValidations} />{" "}
|
|
100
|
-
<span className="evaluations__total">Total</span>
|
|
101
|
-
</div>
|
|
102
|
-
<input
|
|
103
|
-
className="evaluations__checkbox"
|
|
104
|
-
type="checkbox"
|
|
105
|
-
checked={saveAll}
|
|
106
|
-
onChange={toggleAllSaveStatuses}
|
|
107
|
-
/>
|
|
108
|
-
</>
|
|
109
|
-
}
|
|
110
|
-
>
|
|
111
|
-
{evaluations.map(
|
|
112
|
-
(
|
|
113
|
-
{ namespace, type, expected_type, save, errors, validations, indexed, value },
|
|
114
|
-
i
|
|
115
|
-
) => {
|
|
116
|
-
return (
|
|
117
|
-
<EvaluationRow
|
|
118
|
-
key={i}
|
|
119
|
-
namespace={namespace}
|
|
120
|
-
type={type}
|
|
121
|
-
expected_type={expected_type}
|
|
122
|
-
errors={errors}
|
|
123
|
-
validations={validations}
|
|
124
|
-
index={i}
|
|
125
|
-
addValidation={addValidation}
|
|
126
|
-
deleteValidation={deleteValidation}
|
|
127
|
-
updateValidations={updateValidations}
|
|
128
|
-
updateExpectedType={updateExpectedType}
|
|
129
|
-
updateSaveStatus={updateSaveStatus}
|
|
130
|
-
updateTests={updateTests}
|
|
131
|
-
save={save}
|
|
132
|
-
test={test}
|
|
133
|
-
indexed={indexed}
|
|
134
|
-
value={value}
|
|
135
|
-
/>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
)}
|
|
139
|
-
</ExpandableSection>
|
|
140
|
-
</div>
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const EvaluationRow = ({
|
|
145
|
-
namespace,
|
|
146
|
-
type,
|
|
147
|
-
expected_type,
|
|
148
|
-
errors,
|
|
149
|
-
validations,
|
|
150
|
-
index,
|
|
151
|
-
addValidation,
|
|
152
|
-
deleteValidation,
|
|
153
|
-
updateValidations,
|
|
154
|
-
updateExpectedType,
|
|
155
|
-
updateSaveStatus,
|
|
156
|
-
updateTests,
|
|
157
|
-
save,
|
|
158
|
-
test,
|
|
159
|
-
indexed,
|
|
160
|
-
value,
|
|
161
|
-
}) => {
|
|
162
|
-
const calcWidth = (text = "") => Math.ceil(text.length / 0.12);
|
|
163
|
-
const [type_width, setWidth] = useState(calcWidth(0));
|
|
164
|
-
const style = { "--type-width": type_width + "px" };
|
|
165
|
-
const [open, setOpen] = useState(errors.length && validations.length);
|
|
166
|
-
|
|
167
|
-
const typeError = !!errors.find(({ name }) => name === "typeError");
|
|
168
|
-
const toggleExpansion = () => {
|
|
169
|
-
setOpen((state) => !state);
|
|
170
|
-
};
|
|
171
|
-
const onSelect = (i, e) => {
|
|
172
|
-
updateExpectedType(i, e);
|
|
173
|
-
setWidth(calcWidth(e.target.value));
|
|
174
|
-
};
|
|
175
|
-
const toggleSave = () => updateSaveStatus(index, !save);
|
|
176
|
-
useEffect(
|
|
177
|
-
() => setWidth(calcWidth(expected_type)),
|
|
178
|
-
|
|
179
|
-
[expected_type, type_width]
|
|
180
|
-
);
|
|
181
|
-
|
|
182
|
-
useEffect(() => {
|
|
183
|
-
if (errors.length && validations.length) setOpen(true);
|
|
184
|
-
}, [errors]);
|
|
185
|
-
return (
|
|
186
|
-
<ExpandableSection
|
|
187
|
-
open={open}
|
|
188
|
-
toggleExpansion={toggleExpansion}
|
|
189
|
-
title={
|
|
190
|
-
<>
|
|
191
|
-
<div className={`evaluations__title`} style={style}>
|
|
192
|
-
{endsWithArrayIndex(namespace) ? (
|
|
193
|
-
<ArrayNamespace
|
|
194
|
-
updateTests={updateTests}
|
|
195
|
-
namespace={namespace}
|
|
196
|
-
test={test}
|
|
197
|
-
indexed={indexed}
|
|
198
|
-
value={value}
|
|
199
|
-
/>
|
|
200
|
-
) : (
|
|
201
|
-
<span
|
|
202
|
-
className={`evaluations__namespace evaluations--error-${
|
|
203
|
-
errors.length > 0
|
|
204
|
-
}`}
|
|
205
|
-
>
|
|
206
|
-
{namespace}:{" "}
|
|
207
|
-
</span>
|
|
208
|
-
)}
|
|
209
|
-
<TypeSelector
|
|
210
|
-
default_type={expected_type}
|
|
211
|
-
onSelect={onSelect.bind(this, index)}
|
|
212
|
-
/>
|
|
213
|
-
<span
|
|
214
|
-
className={`evaluations__type-error-msg
|
|
215
|
-
evaluations__type-error-msg--${typeError}
|
|
216
|
-
evaluations--error-${typeError}`}
|
|
217
|
-
>
|
|
218
|
-
(received {type})
|
|
219
|
-
</span>
|
|
220
|
-
{!!validations.length && <Count count={validations.length} />}
|
|
221
|
-
</div>
|
|
222
|
-
<input
|
|
223
|
-
className="evaluations__checkbox"
|
|
224
|
-
type="checkbox"
|
|
225
|
-
checked={save}
|
|
226
|
-
onChange={toggleSave}
|
|
227
|
-
/>
|
|
228
|
-
</>
|
|
229
|
-
}
|
|
230
|
-
>
|
|
231
|
-
<div className="evaluations__row">
|
|
232
|
-
<span
|
|
233
|
-
className={`evaluations__input evaluations__input--visible-${
|
|
234
|
-
expected_type !== "object" &&
|
|
235
|
-
expected_type !== "null" &&
|
|
236
|
-
expected_type !== "undefined"
|
|
237
|
-
}`}
|
|
238
|
-
>
|
|
239
|
-
<div className="evaluations__add-btn-container">
|
|
240
|
-
<span
|
|
241
|
-
className="evaluations__add-validation-btn btn"
|
|
242
|
-
onClick={addValidation.bind(this, index)}
|
|
243
|
-
>
|
|
244
|
-
+
|
|
245
|
-
</span>
|
|
246
|
-
</div>
|
|
247
|
-
<div className="evaluations__validation-container">
|
|
248
|
-
{validations.map(({ name, value }, i) => {
|
|
249
|
-
const isError = !!errors.find(({ name: errName }) => errName === name);
|
|
250
|
-
return (
|
|
251
|
-
<div className="evaluations__validation" key={i}>
|
|
252
|
-
<ValidationInput
|
|
253
|
-
className={`evaluations--error-${isError} evaluations__validation__input`}
|
|
254
|
-
type={expected_type}
|
|
255
|
-
name={name}
|
|
256
|
-
value={value}
|
|
257
|
-
onSelect={updateValidations.bind(this, index, i, "name")}
|
|
258
|
-
onInputChanged={updateValidations.bind(this, index, i, "value")}
|
|
259
|
-
/>
|
|
260
|
-
<span
|
|
261
|
-
className="evaluations__validation__delete-btn btn"
|
|
262
|
-
onClick={deleteValidation.bind(this, index, i)}
|
|
263
|
-
>
|
|
264
|
-
x
|
|
265
|
-
</span>
|
|
266
|
-
</div>
|
|
267
|
-
);
|
|
268
|
-
})}
|
|
269
|
-
</div>
|
|
270
|
-
</span>
|
|
271
|
-
</div>
|
|
272
|
-
</ExpandableSection>
|
|
273
|
-
);
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
function ArrayNamespace({ namespace, errorCount, updateTests, test, indexed, value }) {
|
|
277
|
-
const [name = "", index = ""] = namespace.split(/(\[\d+\])$/);
|
|
278
|
-
const [open, setOpen] = useState(false);
|
|
279
|
-
const [isIndexed, setIsIndexed] = useState(!!indexed);
|
|
280
|
-
const [testIndex, setIndex] = useState(parseInt(index.substr(1, index.length - 1)));
|
|
281
|
-
|
|
282
|
-
const inputChange = (e) => setIndex(parseInt(e.target.value));
|
|
283
|
-
const add = () => {
|
|
284
|
-
// push ensures that the evaluation namespace is add and not overwritten
|
|
285
|
-
test.savedEvaluations.push({
|
|
286
|
-
namespace: `${name}[${testIndex + 1}]`,
|
|
287
|
-
save: true,
|
|
288
|
-
indexed: true,
|
|
289
|
-
});
|
|
290
|
-
|
|
291
|
-
if (!indexed)
|
|
292
|
-
//add the current index because the test will only use the one
|
|
293
|
-
//saved index, but we need the current index to stay as well
|
|
294
|
-
test.addSavedIndices(namespace, `${name}[${testIndex}]`);
|
|
295
|
-
|
|
296
|
-
test.validate();
|
|
297
|
-
updateTests();
|
|
298
|
-
setOpen(false);
|
|
299
|
-
};
|
|
300
|
-
const show = () => setOpen(true);
|
|
301
|
-
|
|
302
|
-
const hide = () => {
|
|
303
|
-
test.removeSavedIndices(namespace);
|
|
304
|
-
if (isIndexed) {
|
|
305
|
-
test.addSavedIndices(namespace, `${name}[${testIndex}]`);
|
|
306
|
-
} else {
|
|
307
|
-
const e = test.evaluations.find((e) => e.namespace === namespace);
|
|
308
|
-
if (e) {
|
|
309
|
-
e.indexed = false;
|
|
310
|
-
e.expected_type = undefined;
|
|
311
|
-
test.addEvaluation(e);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
test.validate();
|
|
315
|
-
updateTests();
|
|
316
|
-
setOpen(false);
|
|
317
|
-
};
|
|
318
|
-
const handleCheck = (e) => setIsIndexed(e.target.checked);
|
|
319
|
-
|
|
320
|
-
useEffect(() => setIsIndexed(!!indexed), [indexed]);
|
|
321
|
-
useEffect(() => {
|
|
322
|
-
const [name = "", index = ""] = namespace.split(/(\[\d+\])$/);
|
|
323
|
-
setIndex(parseInt(index.substr(1, index.length - 1)));
|
|
324
|
-
}, [namespace]);
|
|
325
|
-
|
|
326
|
-
return (
|
|
327
|
-
<span className={`evaluations__namespace evaluations--error-${errorCount > 0}`}>
|
|
328
|
-
<span>{name}</span>
|
|
329
|
-
{!open ? (
|
|
330
|
-
<span
|
|
331
|
-
onClick={show}
|
|
332
|
-
className={`evaluations__index-button btn evaluations__index-button--indexed-${isIndexed}`}
|
|
333
|
-
>
|
|
334
|
-
{index}
|
|
335
|
-
</span>
|
|
336
|
-
) : (
|
|
337
|
-
<span className={`evaluations__index-button`}>
|
|
338
|
-
<span className="evaluations__brackets">{"["}</span>
|
|
339
|
-
{isIndexed ? (
|
|
340
|
-
<input
|
|
341
|
-
className="evaluations__index-input"
|
|
342
|
-
type={"number"}
|
|
343
|
-
onChange={inputChange}
|
|
344
|
-
min={0}
|
|
345
|
-
//max={value.length}
|
|
346
|
-
value={testIndex}
|
|
347
|
-
/>
|
|
348
|
-
) : (
|
|
349
|
-
<span className="evaluations__random">random</span>
|
|
350
|
-
)}
|
|
351
|
-
<input
|
|
352
|
-
className="evaluations__index-checkbox"
|
|
353
|
-
checked={isIndexed}
|
|
354
|
-
onChange={handleCheck}
|
|
355
|
-
type={"checkbox"}
|
|
356
|
-
/>
|
|
357
|
-
<span onClick={add} className="evaluations__add-index-btn btn">
|
|
358
|
-
+
|
|
359
|
-
</span>
|
|
360
|
-
<span className="evaluations__brackets">{"]"}</span>
|
|
361
|
-
<span onClick={hide} className="evaluations__clear-error btn">
|
|
362
|
-
×
|
|
363
|
-
</span>
|
|
364
|
-
</span>
|
|
365
|
-
)}
|
|
366
|
-
:{" "}
|
|
367
|
-
</span>
|
|
368
|
-
);
|
|
369
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import MultiTestSection from "../../MultiTestSection/MultiTestSection";
|
|
3
|
-
import "./styles.scss";
|
|
4
|
-
|
|
5
|
-
const EventsTest = ({ TestSection, TestController, namespace, FullTest, connection }) => {
|
|
6
|
-
return (
|
|
7
|
-
<MultiTestSection
|
|
8
|
-
dynamic={false}
|
|
9
|
-
TestSection={TestSection}
|
|
10
|
-
TestController={TestController}
|
|
11
|
-
namespace={namespace}
|
|
12
|
-
arg={{ name: "event_name", input_type: "string", FullTest }}
|
|
13
|
-
caption="Events"
|
|
14
|
-
staticArguments={true}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default EventsTest;
|
|
File without changes
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import TestContainer from "../../TestContainer/TestContainer";
|
|
3
|
-
|
|
4
|
-
import "./styles.scss";
|
|
5
|
-
|
|
6
|
-
const MainTest = ({ TestController, TestSection }) => {
|
|
7
|
-
return (
|
|
8
|
-
<section className="current-data-section">
|
|
9
|
-
<TestContainer
|
|
10
|
-
title="Main:"
|
|
11
|
-
open={true}
|
|
12
|
-
test={TestSection[0]}
|
|
13
|
-
testIndex={0}
|
|
14
|
-
TestController={TestController}
|
|
15
|
-
/>
|
|
16
|
-
</section>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export default MainTest;
|
|
File without changes
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
.evaluations {
|
|
2
|
-
background: #25d0a8;
|
|
3
|
-
background: #76b1f7;
|
|
4
|
-
background: #ced8f4;
|
|
5
|
-
|
|
6
|
-
border-radius: 0px 0px 4px 4px;
|
|
7
|
-
overflow-wrap: anywhere;
|
|
8
|
-
padding: 12px 18px;
|
|
9
|
-
font-family: monospace;
|
|
10
|
-
&--visible-false {
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
&__row {
|
|
14
|
-
margin: 4px;
|
|
15
|
-
padding: 8px 5px;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&__title {
|
|
19
|
-
--type-width: auto;
|
|
20
|
-
margin-left: 10px;
|
|
21
|
-
width: 100%;
|
|
22
|
-
& select {
|
|
23
|
-
width: var(--type-width);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&__input {
|
|
28
|
-
& > input {
|
|
29
|
-
width: 100%;
|
|
30
|
-
padding: 6px 9px;
|
|
31
|
-
margin: 8px 0;
|
|
32
|
-
box-sizing: border-box;
|
|
33
|
-
border: none;
|
|
34
|
-
border: 1px solid #383836;
|
|
35
|
-
background: #a5ffda;
|
|
36
|
-
}
|
|
37
|
-
&--visible-false {
|
|
38
|
-
display: none;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
&__add-validation-btn {
|
|
42
|
-
background: #5a77ca;
|
|
43
|
-
padding: 0px 5px 1px 5px;
|
|
44
|
-
border-radius: 16px;
|
|
45
|
-
font-weight: bold;
|
|
46
|
-
color: #ffffff;
|
|
47
|
-
}
|
|
48
|
-
&__validation-container {
|
|
49
|
-
display: inline-grid;
|
|
50
|
-
margin-left: 4px;
|
|
51
|
-
}
|
|
52
|
-
&__add-btn-container {
|
|
53
|
-
display: inline-grid;
|
|
54
|
-
}
|
|
55
|
-
&__validation {
|
|
56
|
-
border-bottom: 1px solid #9797d1;
|
|
57
|
-
&__delete-btn {
|
|
58
|
-
display: inline;
|
|
59
|
-
font-family: system-ui;
|
|
60
|
-
margin-left: 6px;
|
|
61
|
-
font-size: 15px;
|
|
62
|
-
color: #6565a1;
|
|
63
|
-
&:hover {
|
|
64
|
-
color: #c30f0f;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
&__input {
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
&__type-error-msg {
|
|
72
|
-
display: none;
|
|
73
|
-
&--true {
|
|
74
|
-
display: initial;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
&--error-true,
|
|
78
|
-
&--error-true > * {
|
|
79
|
-
color: #cd4343;
|
|
80
|
-
//color: #993939;
|
|
81
|
-
font-weight: bold;
|
|
82
|
-
//font-style: italic;
|
|
83
|
-
}
|
|
84
|
-
&__total {
|
|
85
|
-
color: grey;
|
|
86
|
-
}
|
|
87
|
-
&__checkbox {
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
}
|
|
90
|
-
&__index-button {
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-direction: row;
|
|
93
|
-
align-items: center;
|
|
94
|
-
&.btn:hover {
|
|
95
|
-
font-weight: bold;
|
|
96
|
-
color: #2326fe;
|
|
97
|
-
color: #ff5722;
|
|
98
|
-
color: #c717e5;
|
|
99
|
-
color: #1131df;
|
|
100
|
-
}
|
|
101
|
-
&--indexed-true {
|
|
102
|
-
font-weight: bold;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
&__namespace {
|
|
106
|
-
display: inline-flex;
|
|
107
|
-
flex-wrap: wrap;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&__index-input {
|
|
111
|
-
width: 45px;
|
|
112
|
-
height: 15px;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&__brackets {
|
|
116
|
-
align-self: baseline;
|
|
117
|
-
font-size: 14px;
|
|
118
|
-
color: black;
|
|
119
|
-
font-weight: bold;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&__index-checkbox {
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
}
|
|
125
|
-
&__random {
|
|
126
|
-
align-self: baseline;
|
|
127
|
-
font-weight: bold;
|
|
128
|
-
color: #2b9b2c;
|
|
129
|
-
font-style: italic;
|
|
130
|
-
}
|
|
131
|
-
&__clear-error {
|
|
132
|
-
color: gray;
|
|
133
|
-
font-size: 16px;
|
|
134
|
-
&:hover {
|
|
135
|
-
color: black;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
&__add-index-btn {
|
|
139
|
-
color: #2776ff;
|
|
140
|
-
font-weight: bold;
|
|
141
|
-
font-size: 16px;
|
|
142
|
-
}
|
|
143
|
-
}
|