@truedat/qx 7.0.8 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -4
- package/src/api.js +29 -20
- package/src/components/QxRoutes.js +18 -16
- package/src/components/__tests__/__fixtures__/helper.js +189 -0
- package/src/components/common/TestFormWrapper.js +38 -0
- package/src/components/common/__tests__/ResourceSelector.spec.js +18 -7
- package/src/components/common/__tests__/__snapshots__/ResourceSelector.spec.js.snap +0 -12
- package/src/components/common/expressions/__tests__/Condition.spec.js +4 -1
- package/src/components/common/expressions/__tests__/FunctionArgs.spec.js +18 -5
- package/src/components/common/expressions/__tests__/ShapeSelector.spec.js +10 -4
- package/src/components/common/expressions/__tests__/__snapshots__/FunctionArgs.spec.js.snap +10 -2
- package/src/components/common/resourceSelectors/__tests__/DataStructureSelector.spec.js +6 -3
- package/src/components/common/resourceSelectors/__tests__/__snapshots__/DataStructureSelector.spec.js.snap +0 -12
- package/src/components/dataViews/__tests__/DataViewEditor.spec.js +83 -53
- package/src/components/dataViews/__tests__/DataViews.spec.js +14 -1
- package/src/components/dataViews/__tests__/__snapshots__/DataViewEditor.spec.js.snap +93 -4
- package/src/components/dataViews/queryableProperties/__tests__/SelectField.spec.js +13 -6
- package/src/components/functions/__tests__/FunctionEditor.spec.js +2 -34
- package/src/components/functions/__tests__/FunctionParams.spec.js +4 -17
- package/src/components/functions/__tests__/Functions.spec.js +2 -34
- package/src/components/functions/__tests__/__snapshots__/FunctionEditor.spec.js.snap +48 -48
- package/src/components/functions/__tests__/__snapshots__/FunctionParams.spec.js.snap +4 -4
- package/src/components/functions/__tests__/__snapshots__/Functions.spec.js.snap +4 -4
- package/src/components/qualityControls/ControlProperties.js +43 -0
- package/src/components/qualityControls/ControlPropertiesView.js +109 -0
- package/src/components/qualityControls/EditQualityControl.js +5 -21
- package/src/components/qualityControls/IconPopup.js +28 -0
- package/src/components/qualityControls/NewDraftQualityControl.js +4 -13
- package/src/components/qualityControls/NewQualityControl.js +10 -25
- package/src/components/qualityControls/QualityBadge.js +33 -0
- package/src/components/qualityControls/QualityControl.js +11 -53
- package/src/components/qualityControls/QualityControlActions.js +133 -46
- package/src/components/qualityControls/QualityControlEditor.js +113 -134
- package/src/components/qualityControls/QualityControlHeader.js +29 -7
- package/src/components/qualityControls/QualityControlHistory.js +6 -12
- package/src/components/qualityControls/QualityControlQueryModal.js +8 -5
- package/src/components/qualityControls/QualityControlRoutes.js +51 -96
- package/src/components/qualityControls/QualityControlRow.js +21 -2
- package/src/components/qualityControls/QualityControlScores.js +140 -0
- package/src/components/qualityControls/QualityControlTabs.js +24 -23
- package/src/components/qualityControls/QualityControls.js +142 -59
- package/src/components/qualityControls/QualityControlsLabelResults.js +51 -0
- package/src/components/qualityControls/QualityControlsTable.js +69 -43
- package/src/components/qualityControls/ScoreCriteria.js +40 -0
- package/src/components/qualityControls/{ResultCriteria.js → ScoreCriteriaView.js} +26 -42
- package/src/components/qualityControls/__tests__/ControlProperties.spec.js +86 -0
- package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +86 -0
- package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +219 -0
- package/src/components/qualityControls/__tests__/IconPopup.spec.js +33 -0
- package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +253 -0
- package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +384 -0
- package/src/components/qualityControls/__tests__/QualityBadge.spec.js +30 -0
- package/src/components/qualityControls/__tests__/QualityControl.spec.js +47 -0
- package/src/components/qualityControls/__tests__/QualityControlActions.spec.js +192 -0
- package/src/components/qualityControls/__tests__/QualityControlCrumbs.spec.js +18 -0
- package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +296 -0
- package/src/components/qualityControls/__tests__/QualityControlHeader.spec.js +68 -0
- package/src/components/qualityControls/__tests__/QualityControlHistory.spec.js +21 -0
- package/src/components/qualityControls/__tests__/QualityControlQueryModal.spec.js +77 -0
- package/src/components/qualityControls/__tests__/QualityControlRow.spec.js +91 -0
- package/src/components/qualityControls/__tests__/QualityControlScores.spec.js +139 -0
- package/src/components/qualityControls/__tests__/QualityControlTabs.spec.js +20 -0
- package/src/components/qualityControls/__tests__/QualityControls.spec.js +202 -0
- package/src/components/qualityControls/__tests__/QualityControlsLabelResults.spec.js +83 -0
- package/src/components/qualityControls/__tests__/QualityControlsTable.spec.js +38 -0
- package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +77 -0
- package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +62 -0
- package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +281 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +151 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +290 -0
- package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +672 -0
- package/src/components/qualityControls/__tests__/__snapshots__/IconPopup.spec.js.snap +10 -0
- package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +648 -0
- package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +336 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +11 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControl.spec.js.snap +255 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlActions.spec.js.snap +85 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlCrumbs.spec.js.snap +25 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +930 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHeader.spec.js.snap +127 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlHistory.spec.js.snap +75 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlQueryModal.spec.js.snap +27 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlRow.spec.js.snap +113 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlScores.spec.js.snap +161 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlTabs.spec.js.snap +28 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControls.spec.js.snap +219 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsLabelResults.spec.js.snap +11 -0
- package/src/components/qualityControls/__tests__/__snapshots__/QualityControlsTable.spec.js.snap +121 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteria.spec.js.snap +186 -0
- package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteriaView.spec.js.snap +76 -0
- package/src/components/qualityControls/__tests__/qualityByControlMode.spec.js +248 -0
- package/src/components/qualityControls/controlProperties/ErrorCount.js +56 -0
- package/src/components/qualityControls/controlProperties/Ratio.js +79 -0
- package/src/components/qualityControls/controlProperties/__tests__/ErrorCount.spec.js +82 -0
- package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +115 -0
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/ErrorCount.spec.js.snap +62 -0
- package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +143 -0
- package/src/components/qualityControls/qualityByControlMode.js +62 -0
- package/src/components/qualityControls/qualityControlScoresColumns.js +52 -0
- package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Deviation.js +6 -6
- package/src/components/qualityControls/{resultCriterias/ErrorsNumber.js → scoreCriterias/ErrorCount.js} +7 -7
- package/src/components/qualityControls/{resultCriterias → scoreCriterias}/Percentage.js +6 -6
- package/src/components/qualityControls/scoreCriterias/__tests__/Deviation.spec.js +75 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +63 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/Percentage.spec.js +61 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Deviation.spec.js.snap +58 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/ErrorCount.spec.js.snap +58 -0
- package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Percentage.spec.js.snap +58 -0
- package/src/components/{executions/ExecutionGroupsHeader.js → scores/MyScoreGroups.js} +5 -3
- package/src/components/scores/QualityBar.js +73 -0
- package/src/components/scores/Score.js +32 -0
- package/src/components/scores/ScoreContext.js +3 -0
- package/src/components/scores/ScoreCrumbs.js +40 -0
- package/src/components/scores/ScoreDetails.js +67 -0
- package/src/components/scores/ScoreEvents.js +59 -0
- package/src/components/scores/ScoreGroup.js +83 -0
- package/src/components/scores/ScoreGroupBreadcrumbs.js +25 -0
- package/src/components/{qualityControls/ExecutionForm.js → scores/ScoreGroupForm.js} +11 -13
- package/src/components/scores/ScoreGroupLink.js +18 -0
- package/src/components/scores/ScoreGroupMessage.js +25 -0
- package/src/components/{qualityControls/ExecutionPopup.js → scores/ScoreGroupPopup.js} +13 -22
- package/src/components/scores/ScoreGroupsTable.js +113 -0
- package/src/components/scores/ScoreRoutes.js +32 -0
- package/src/components/{executions/ExecutionStatusDecorator.js → scores/ScoreStatusDecorator.js} +10 -8
- package/src/components/scores/ScoreTabs.js +32 -0
- package/src/components/scores/__tests__/MyScoreGroups.spec.js +31 -0
- package/src/components/scores/__tests__/QualityBar.spec.js +55 -0
- package/src/components/scores/__tests__/Score.spec.js +41 -0
- package/src/components/scores/__tests__/ScoreCrumbs.spec.js +39 -0
- package/src/components/scores/__tests__/ScoreDetails.spec.js +38 -0
- package/src/components/scores/__tests__/ScoreEvents.spec.js +24 -0
- package/src/components/scores/__tests__/ScoreGroup.spec.js +43 -0
- package/src/components/scores/__tests__/ScoreGroupBreadcrumbs.spec.js +16 -0
- package/src/components/scores/__tests__/ScoreGroupForm.spec.js +78 -0
- package/src/components/scores/__tests__/ScoreGroupLink.spec.js +16 -0
- package/src/components/scores/__tests__/ScoreGroupMessage.spec.js +20 -0
- package/src/components/scores/__tests__/ScoreGroupPopup.spec.js +59 -0
- package/src/components/scores/__tests__/ScoreGroupsTable.spec.js +40 -0
- package/src/components/scores/__tests__/ScoreStatusDecorator.spec.js +21 -0
- package/src/components/scores/__tests__/ScoreTabs.spec.js +27 -0
- package/src/components/scores/__tests__/__fixtures__/scoreHelper.js +182 -0
- package/src/components/scores/__tests__/__snapshots__/MyScoreGroups.spec.js.snap +154 -0
- package/src/components/scores/__tests__/__snapshots__/QualityBar.spec.js.snap +24 -0
- package/src/components/scores/__tests__/__snapshots__/Score.spec.js.snap +92 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreCrumbs.spec.js.snap +39 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreDetails.spec.js.snap +156 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreEvents.spec.js.snap +167 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroup.spec.js.snap +103 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupBreadcrumbs.spec.js.snap +29 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupForm.spec.js.snap +145 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupLink.spec.js.snap +15 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupMessage.spec.js.snap +43 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupPopup.spec.js.snap +11 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreGroupsTable.spec.js.snap +147 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreStatusDecorator.spec.js.snap +71 -0
- package/src/components/scores/__tests__/__snapshots__/ScoreTabs.spec.js.snap +43 -0
- package/src/components/scores/index.js +15 -0
- package/src/hooks/useQualityControls.js +3 -9
- package/src/hooks/useScoreGroups.js +23 -0
- package/src/hooks/useScores.js +22 -0
- package/src/styles/Expression.less +16 -0
- package/src/styles/scores.less +63 -0
- package/src/components/executions/ExecutionGroupBreadcrumbs.js +0 -25
- package/src/components/executions/ExecutionGroupContent.js +0 -42
- package/src/components/executions/ExecutionGroupLink.js +0 -18
- package/src/components/executions/ExecutionGroupMessage.js +0 -27
- package/src/components/executions/ExecutionGroupsTable.js +0 -101
- package/src/components/executions/executionGroupDetail.js +0 -87
- package/src/components/qualityControls/ResultType.js +0 -57
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ErrorCount /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="field"
|
|
7
|
+
>
|
|
8
|
+
<label
|
|
9
|
+
class="field-label"
|
|
10
|
+
>
|
|
11
|
+
Goal
|
|
12
|
+
<span>
|
|
13
|
+
*
|
|
14
|
+
</span>
|
|
15
|
+
</label>
|
|
16
|
+
<div
|
|
17
|
+
class="field"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
class="ui input"
|
|
21
|
+
>
|
|
22
|
+
<input
|
|
23
|
+
autocomplete="off"
|
|
24
|
+
placeholder="Goal"
|
|
25
|
+
type="text"
|
|
26
|
+
value=""
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
class="field"
|
|
33
|
+
>
|
|
34
|
+
<label
|
|
35
|
+
class="field-label"
|
|
36
|
+
>
|
|
37
|
+
Threshold
|
|
38
|
+
<span>
|
|
39
|
+
*
|
|
40
|
+
</span>
|
|
41
|
+
</label>
|
|
42
|
+
<div
|
|
43
|
+
class="field"
|
|
44
|
+
>
|
|
45
|
+
<div
|
|
46
|
+
class="ui input"
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
autocomplete="off"
|
|
50
|
+
placeholder="Threshold"
|
|
51
|
+
type="text"
|
|
52
|
+
value=""
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Percentage /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="field"
|
|
7
|
+
>
|
|
8
|
+
<label
|
|
9
|
+
class="field-label"
|
|
10
|
+
>
|
|
11
|
+
Threshold
|
|
12
|
+
<span>
|
|
13
|
+
*
|
|
14
|
+
</span>
|
|
15
|
+
</label>
|
|
16
|
+
<div
|
|
17
|
+
class="field"
|
|
18
|
+
>
|
|
19
|
+
<div
|
|
20
|
+
class="ui input"
|
|
21
|
+
>
|
|
22
|
+
<input
|
|
23
|
+
autocomplete="off"
|
|
24
|
+
placeholder="Threshold"
|
|
25
|
+
type="text"
|
|
26
|
+
value=""
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
class="field"
|
|
33
|
+
>
|
|
34
|
+
<label
|
|
35
|
+
class="field-label"
|
|
36
|
+
>
|
|
37
|
+
Goal
|
|
38
|
+
<span>
|
|
39
|
+
*
|
|
40
|
+
</span>
|
|
41
|
+
</label>
|
|
42
|
+
<div
|
|
43
|
+
class="field"
|
|
44
|
+
>
|
|
45
|
+
<div
|
|
46
|
+
class="ui input"
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
autocomplete="off"
|
|
50
|
+
placeholder="Goal"
|
|
51
|
+
type="text"
|
|
52
|
+
value=""
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
`;
|
|
@@ -3,7 +3,9 @@ import React from "react";
|
|
|
3
3
|
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import { Header, Icon, Grid, Segment } from "semantic-ui-react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import ScoreGroupsTable from "./ScoreGroupsTable";
|
|
7
|
+
|
|
8
|
+
export default function MyScoreGroups() {
|
|
7
9
|
return (
|
|
8
10
|
<Segment>
|
|
9
11
|
<Grid>
|
|
@@ -11,12 +13,12 @@ export default function ExecutionGroupsHeader({ children }) {
|
|
|
11
13
|
<Header as="h2">
|
|
12
14
|
<Icon circular name="tasks" />
|
|
13
15
|
<Header.Content>
|
|
14
|
-
<FormattedMessage id="
|
|
16
|
+
<FormattedMessage id="score_groups.header" />
|
|
15
17
|
</Header.Content>
|
|
16
18
|
</Header>
|
|
17
19
|
</Grid.Column>
|
|
18
20
|
</Grid>
|
|
19
|
-
|
|
21
|
+
<ScoreGroupsTable />
|
|
20
22
|
</Segment>
|
|
21
23
|
);
|
|
22
24
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { Popup } from "semantic-ui-react";
|
|
4
|
+
import { FormattedMessage, useIntl } from "react-intl";
|
|
5
|
+
import qualityByControlMode from "../qualityControls/qualityByControlMode";
|
|
6
|
+
import ScoreContext from "./ScoreContext";
|
|
7
|
+
|
|
8
|
+
export default function QualityBar() {
|
|
9
|
+
const { score } = useContext(ScoreContext);
|
|
10
|
+
const { formatMessage } = useIntl();
|
|
11
|
+
const quality = qualityByControlMode(score);
|
|
12
|
+
|
|
13
|
+
const { color, text } = quality.isFailed
|
|
14
|
+
? {
|
|
15
|
+
color: "failed",
|
|
16
|
+
text: formatMessage({ id: "score.status.failed" }),
|
|
17
|
+
}
|
|
18
|
+
: quality.isEmpty
|
|
19
|
+
? {
|
|
20
|
+
color: "empyDataset",
|
|
21
|
+
text: formatMessage({ id: "score.no_results" }),
|
|
22
|
+
}
|
|
23
|
+
: quality;
|
|
24
|
+
|
|
25
|
+
const propsByColor = {
|
|
26
|
+
red: {
|
|
27
|
+
className: "under-minimum-color",
|
|
28
|
+
tooltip: "not_comply",
|
|
29
|
+
},
|
|
30
|
+
yellow: {
|
|
31
|
+
className: "under-goal-color",
|
|
32
|
+
tooltip: "warning",
|
|
33
|
+
},
|
|
34
|
+
green: {
|
|
35
|
+
className: "over-goal-color",
|
|
36
|
+
tooltip: "comply",
|
|
37
|
+
},
|
|
38
|
+
grey: {
|
|
39
|
+
className: "not-executed-color",
|
|
40
|
+
tooltip: "no_execution",
|
|
41
|
+
},
|
|
42
|
+
empyDataset: {
|
|
43
|
+
className: "empty-dataset-color",
|
|
44
|
+
tooltip: "no_content",
|
|
45
|
+
},
|
|
46
|
+
failed: {
|
|
47
|
+
className: "failed-color",
|
|
48
|
+
tooltip: "failed",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const summaryProps = propsByColor[color];
|
|
52
|
+
return (
|
|
53
|
+
<div className="quality-bar-wrapper">
|
|
54
|
+
<div className="quality-bar">
|
|
55
|
+
<Popup
|
|
56
|
+
position="bottom center"
|
|
57
|
+
basic
|
|
58
|
+
on="hover"
|
|
59
|
+
content={
|
|
60
|
+
<FormattedMessage
|
|
61
|
+
id={`score.result_label.${summaryProps.tooltip}`}
|
|
62
|
+
/>
|
|
63
|
+
}
|
|
64
|
+
trigger={
|
|
65
|
+
<span className={summaryProps.className} style={{ width: "100%" }}>
|
|
66
|
+
<span className="value">{text}</span>
|
|
67
|
+
</span>
|
|
68
|
+
}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useParams } from "react-router-dom";
|
|
4
|
+
import { FormattedMessage } from "react-intl";
|
|
5
|
+
import { Segment, Header, Icon } from "semantic-ui-react";
|
|
6
|
+
import { useScoreShow } from "../../hooks/useScores";
|
|
7
|
+
import ScoreContext from "./ScoreContext";
|
|
8
|
+
import ScoreCrumbs from "./ScoreCrumbs";
|
|
9
|
+
import ScoreTabs from "./ScoreTabs";
|
|
10
|
+
import QualityBar from "./QualityBar";
|
|
11
|
+
|
|
12
|
+
export default function Score({ children }) {
|
|
13
|
+
const { id } = useParams();
|
|
14
|
+
const { data: score } = useScoreShow(id);
|
|
15
|
+
|
|
16
|
+
return score ? (
|
|
17
|
+
<ScoreContext.Provider value={{ score }}>
|
|
18
|
+
<ScoreCrumbs />
|
|
19
|
+
<Segment>
|
|
20
|
+
<Header as="h2">
|
|
21
|
+
<Icon circular name="line graph" />
|
|
22
|
+
<Header.Content>
|
|
23
|
+
<FormattedMessage id={"scores.detail.header"} />
|
|
24
|
+
<QualityBar />
|
|
25
|
+
</Header.Content>
|
|
26
|
+
</Header>
|
|
27
|
+
<ScoreTabs />
|
|
28
|
+
{children}
|
|
29
|
+
</Segment>
|
|
30
|
+
</ScoreContext.Provider>
|
|
31
|
+
) : null;
|
|
32
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { Breadcrumb } from "semantic-ui-react";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { QUALITY_CONTROLS, linkTo } from "@truedat/core/routes";
|
|
7
|
+
import { DateDecorator } from "@truedat/core/services/columnDecorators";
|
|
8
|
+
import ScoreContext from "./ScoreContext";
|
|
9
|
+
|
|
10
|
+
export default function ScoreCrumbs() {
|
|
11
|
+
const { score } = useContext(ScoreContext);
|
|
12
|
+
const qualityControl = _.prop("quality_control")(score);
|
|
13
|
+
const executionTimestamp = _.prop("execution_timestamp")(score);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Breadcrumb>
|
|
17
|
+
<Breadcrumb.Section as={Link} to={QUALITY_CONTROLS} active={false}>
|
|
18
|
+
<FormattedMessage id="quality_controls.header" />
|
|
19
|
+
</Breadcrumb.Section>
|
|
20
|
+
|
|
21
|
+
<Breadcrumb.Divider icon="right angle" />
|
|
22
|
+
|
|
23
|
+
<Breadcrumb.Section
|
|
24
|
+
as={Link}
|
|
25
|
+
to={linkTo.QUALITY_CONTROL_SCORES({ id: qualityControl.id })}
|
|
26
|
+
>
|
|
27
|
+
{qualityControl.name}
|
|
28
|
+
</Breadcrumb.Section>
|
|
29
|
+
<Breadcrumb.Divider icon="right angle" />
|
|
30
|
+
|
|
31
|
+
<Breadcrumb.Section active>
|
|
32
|
+
{executionTimestamp ? (
|
|
33
|
+
<DateDecorator date={executionTimestamp} />
|
|
34
|
+
) : (
|
|
35
|
+
<FormattedMessage id={`score.not_executed`} />
|
|
36
|
+
)}
|
|
37
|
+
</Breadcrumb.Section>
|
|
38
|
+
</Breadcrumb>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
|
+
import { Header, Icon, List, Segment } from "semantic-ui-react";
|
|
5
|
+
import { columnDecorator } from "@truedat/core/services";
|
|
6
|
+
import columns from "../qualityControls/qualityControlScoresColumns";
|
|
7
|
+
import ScoreContext from "./ScoreContext";
|
|
8
|
+
|
|
9
|
+
export default function ScoreDetails() {
|
|
10
|
+
const { score } = useContext(ScoreContext);
|
|
11
|
+
const details = _.prop("details")(score);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Header as="h3">
|
|
16
|
+
<Icon name="info" size="small" />
|
|
17
|
+
<Header.Content>
|
|
18
|
+
<FormattedMessage id="score.information" />
|
|
19
|
+
</Header.Content>
|
|
20
|
+
</Header>
|
|
21
|
+
<Segment>
|
|
22
|
+
<List>
|
|
23
|
+
{columns.map((column, key) => (
|
|
24
|
+
<List.Item key={key}>
|
|
25
|
+
<List.Header>
|
|
26
|
+
<FormattedMessage id={`scores.props.${column.name}`} />
|
|
27
|
+
</List.Header>
|
|
28
|
+
<List.Description>
|
|
29
|
+
{columnDecorator(column)(score)}
|
|
30
|
+
</List.Description>
|
|
31
|
+
</List.Item>
|
|
32
|
+
))}
|
|
33
|
+
</List>
|
|
34
|
+
</Segment>
|
|
35
|
+
{details && !_.isEmpty(details) ? (
|
|
36
|
+
<>
|
|
37
|
+
<Header as="h3">
|
|
38
|
+
<Icon name="tasks" size="small" />
|
|
39
|
+
<Header.Content>
|
|
40
|
+
<FormattedMessage id="score.details" />
|
|
41
|
+
</Header.Content>
|
|
42
|
+
</Header>
|
|
43
|
+
<Segment>
|
|
44
|
+
<List>
|
|
45
|
+
{_.flow(
|
|
46
|
+
_.toPairs,
|
|
47
|
+
_.map(([key, value]) => (
|
|
48
|
+
<List.Item key={key}>
|
|
49
|
+
<List.Content>
|
|
50
|
+
<List.Header>
|
|
51
|
+
<FormattedMessage
|
|
52
|
+
id={`score.detail.label.${key}`}
|
|
53
|
+
defaultMessage={key}
|
|
54
|
+
/>
|
|
55
|
+
</List.Header>
|
|
56
|
+
<List.Description>{`${value}`}</List.Description>
|
|
57
|
+
</List.Content>
|
|
58
|
+
</List.Item>
|
|
59
|
+
))
|
|
60
|
+
)(details)}
|
|
61
|
+
</List>
|
|
62
|
+
</Segment>
|
|
63
|
+
</>
|
|
64
|
+
) : null}
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React, { useContext } from "react";
|
|
3
|
+
import { useIntl, FormattedMessage } from "react-intl";
|
|
4
|
+
import { Table } from "semantic-ui-react";
|
|
5
|
+
import { columnDecorator } from "@truedat/core/services";
|
|
6
|
+
import { DateDecorator } from "@truedat/core/services/columnDecorators";
|
|
7
|
+
|
|
8
|
+
import ScoreContext from "./ScoreContext";
|
|
9
|
+
|
|
10
|
+
const columns = [
|
|
11
|
+
{
|
|
12
|
+
name: "inserted_at",
|
|
13
|
+
fieldSelector: ({ inserted_at }) => ({ date: inserted_at }),
|
|
14
|
+
fieldDecorator: DateDecorator,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: "type",
|
|
18
|
+
fieldDecorator: (type) => (
|
|
19
|
+
<FormattedMessage id={`score.event.type.${type}`} />
|
|
20
|
+
),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "message",
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
export default function ScoreEvents() {
|
|
27
|
+
const { score } = useContext(ScoreContext);
|
|
28
|
+
const { formatMessage } = useIntl();
|
|
29
|
+
|
|
30
|
+
const events = _.prop("events")(score);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Table>
|
|
34
|
+
<Table.Header>
|
|
35
|
+
<Table.Row>
|
|
36
|
+
{columns.map(({ name }, idx) => (
|
|
37
|
+
<Table.HeaderCell
|
|
38
|
+
key={idx}
|
|
39
|
+
content={formatMessage({ id: `scores.event.props.${name}` })}
|
|
40
|
+
/>
|
|
41
|
+
))}
|
|
42
|
+
</Table.Row>
|
|
43
|
+
</Table.Header>
|
|
44
|
+
<Table.Body>
|
|
45
|
+
{events.map((event, rowKey) => (
|
|
46
|
+
<Table.Row key={rowKey}>
|
|
47
|
+
{columns.map((column, key) => (
|
|
48
|
+
<Table.Cell
|
|
49
|
+
key={key}
|
|
50
|
+
textAlign={column.textAlign}
|
|
51
|
+
content={columnDecorator(column)(event)}
|
|
52
|
+
/>
|
|
53
|
+
))}
|
|
54
|
+
</Table.Row>
|
|
55
|
+
))}
|
|
56
|
+
</Table.Body>
|
|
57
|
+
</Table>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _ from "lodash/fp";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { useParams, Link } from "react-router-dom";
|
|
5
|
+
import { Table } from "semantic-ui-react";
|
|
6
|
+
import { columnDecorator } from "@truedat/core/services";
|
|
7
|
+
import { linkTo } from "@truedat/core/routes";
|
|
8
|
+
import { useScoreGroupShow } from "../../hooks/useScoreGroups";
|
|
9
|
+
import ScoreGroupMessage from "./ScoreGroupMessage";
|
|
10
|
+
import ScoreStatusDecorator from "./ScoreStatusDecorator";
|
|
11
|
+
import ScoreGroupBreadcrumbs from "./ScoreGroupBreadcrumbs";
|
|
12
|
+
|
|
13
|
+
const DynamicFormViewer = React.lazy(() =>
|
|
14
|
+
import("@truedat/df/components/DynamicFormViewer")
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const QualityControlLink = ({ id, name }) => (
|
|
18
|
+
<Link to={linkTo.QUALITY_CONTROL({ id })}>{name}</Link>
|
|
19
|
+
);
|
|
20
|
+
const COLUMNS = [
|
|
21
|
+
{
|
|
22
|
+
name: "score.props.status",
|
|
23
|
+
fieldSelector: _.identity,
|
|
24
|
+
fieldDecorator: ScoreStatusDecorator,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "quality_control.props.name",
|
|
28
|
+
fieldSelector: "quality_control",
|
|
29
|
+
fieldDecorator: QualityControlLink,
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
export default function ScoreGroup() {
|
|
34
|
+
const { formatMessage } = useIntl();
|
|
35
|
+
const { id } = useParams();
|
|
36
|
+
|
|
37
|
+
const { data } = useScoreGroupShow(id);
|
|
38
|
+
const scoreGroup = data?.data;
|
|
39
|
+
|
|
40
|
+
const scores = scoreGroup?.scores;
|
|
41
|
+
const count = _.size(scores);
|
|
42
|
+
const pendingCount = _.flow(
|
|
43
|
+
_.reject(({ status }) => _.contains(status)(["SUCCEEDED", "FAILED"])),
|
|
44
|
+
_.size
|
|
45
|
+
)(scores);
|
|
46
|
+
|
|
47
|
+
return _.isEmpty(scoreGroup) ? null : (
|
|
48
|
+
<>
|
|
49
|
+
<ScoreGroupBreadcrumbs timestamp={scoreGroup.inserted_at} />
|
|
50
|
+
<ScoreGroupMessage count={count} pending={pendingCount} />
|
|
51
|
+
<DynamicFormViewer
|
|
52
|
+
template={scoreGroup.df_type}
|
|
53
|
+
content={scoreGroup.dynamic_content}
|
|
54
|
+
/>
|
|
55
|
+
<Table>
|
|
56
|
+
<Table.Header>
|
|
57
|
+
<Table.Row>
|
|
58
|
+
{COLUMNS.map(({ name: id, textAlign }, i) => (
|
|
59
|
+
<Table.HeaderCell
|
|
60
|
+
key={i}
|
|
61
|
+
content={formatMessage({ id })}
|
|
62
|
+
textAlign={textAlign}
|
|
63
|
+
/>
|
|
64
|
+
))}
|
|
65
|
+
</Table.Row>
|
|
66
|
+
</Table.Header>
|
|
67
|
+
<Table.Body>
|
|
68
|
+
{scores?.map((score, i) => (
|
|
69
|
+
<Table.Row key={i}>
|
|
70
|
+
{COLUMNS.map(({ textAlign, ...column }, i) => (
|
|
71
|
+
<Table.Cell
|
|
72
|
+
key={i}
|
|
73
|
+
content={columnDecorator(column)(score)}
|
|
74
|
+
textAlign={textAlign}
|
|
75
|
+
/>
|
|
76
|
+
))}
|
|
77
|
+
</Table.Row>
|
|
78
|
+
))}
|
|
79
|
+
</Table.Body>
|
|
80
|
+
</Table>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Breadcrumb } from "semantic-ui-react";
|
|
4
|
+
import { Link } from "react-router-dom";
|
|
5
|
+
import { FormattedMessage } from "react-intl";
|
|
6
|
+
import { DateTime } from "@truedat/core/components";
|
|
7
|
+
import { SCORE_GROUPS } from "@truedat/core/routes";
|
|
8
|
+
|
|
9
|
+
export default function ScoreGroupBreadcrumbs({ timestamp }) {
|
|
10
|
+
return (
|
|
11
|
+
<Breadcrumb>
|
|
12
|
+
<Breadcrumb.Section as={Link} to={SCORE_GROUPS}>
|
|
13
|
+
<FormattedMessage id="sidemenu.executions" />
|
|
14
|
+
</Breadcrumb.Section>
|
|
15
|
+
<Breadcrumb.Divider icon="right angle" />
|
|
16
|
+
<Breadcrumb.Section active>
|
|
17
|
+
<DateTime value={timestamp} />
|
|
18
|
+
</Breadcrumb.Section>
|
|
19
|
+
</Breadcrumb>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
ScoreGroupBreadcrumbs.propTypes = {
|
|
24
|
+
timestamp: PropTypes.string,
|
|
25
|
+
};
|
|
@@ -10,7 +10,7 @@ const DynamicForm = React.lazy(() =>
|
|
|
10
10
|
import("@truedat/df/components/DynamicForm")
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export default function ScoreGroupForm({ count, onSubmit, onCancel }) {
|
|
14
14
|
const { formatMessage } = useIntl();
|
|
15
15
|
const [content, setContent] = useState({});
|
|
16
16
|
const [template, setTemplate] = useState();
|
|
@@ -25,17 +25,17 @@ export const ExecutionForm = ({ count, onSubmit, onCancel }) => {
|
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const handleTemplateSelected = (
|
|
28
|
+
const handleTemplateSelected = (_e, { template }) => setTemplate(template);
|
|
29
29
|
|
|
30
30
|
const isInvalid = () =>
|
|
31
|
-
template
|
|
31
|
+
!template || !_.isEmpty(validateContent(template)(content));
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<>
|
|
35
35
|
<Header
|
|
36
36
|
as="h2"
|
|
37
37
|
content={formatMessage({
|
|
38
|
-
id: "
|
|
38
|
+
id: "quality_controls.actions.execution.confirmation.header",
|
|
39
39
|
})}
|
|
40
40
|
/>
|
|
41
41
|
<Form loading={templatesLoading}>
|
|
@@ -51,7 +51,7 @@ export const ExecutionForm = ({ count, onSubmit, onCancel }) => {
|
|
|
51
51
|
<Header
|
|
52
52
|
as="h3"
|
|
53
53
|
content={formatMessage({
|
|
54
|
-
id: "
|
|
54
|
+
id: "quality_controls.actions.execution.confirmation.legend",
|
|
55
55
|
})}
|
|
56
56
|
/>
|
|
57
57
|
<div
|
|
@@ -73,10 +73,10 @@ export const ExecutionForm = ({ count, onSubmit, onCancel }) => {
|
|
|
73
73
|
{
|
|
74
74
|
id:
|
|
75
75
|
count === 1
|
|
76
|
-
? "
|
|
77
|
-
: "
|
|
76
|
+
? "quality_control.actions.execution.confirmation.content"
|
|
77
|
+
: "quality_controls.actions.execution.confirmation.content",
|
|
78
78
|
},
|
|
79
|
-
{
|
|
79
|
+
{ count }
|
|
80
80
|
)}
|
|
81
81
|
</p>
|
|
82
82
|
<div className="actions">
|
|
@@ -88,19 +88,17 @@ export const ExecutionForm = ({ count, onSubmit, onCancel }) => {
|
|
|
88
88
|
<Button
|
|
89
89
|
primary
|
|
90
90
|
disabled={isInvalid()}
|
|
91
|
-
onClick={() => onSubmit(content)}
|
|
91
|
+
onClick={() => onSubmit({ content, df_type: template.name })}
|
|
92
92
|
content={formatMessage({ id: "actions.create" })}
|
|
93
93
|
/>
|
|
94
94
|
</div>
|
|
95
95
|
</Form>
|
|
96
96
|
</>
|
|
97
97
|
);
|
|
98
|
-
}
|
|
98
|
+
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
ScoreGroupForm.propTypes = {
|
|
101
101
|
count: PropTypes.number,
|
|
102
102
|
onSubmit: PropTypes.func,
|
|
103
103
|
onCancel: PropTypes.func,
|
|
104
104
|
};
|
|
105
|
-
|
|
106
|
-
export default ExecutionForm;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { Link } from "react-router-dom";
|
|
4
|
+
import { DateTime } from "@truedat/core/components";
|
|
5
|
+
import { linkTo } from "@truedat/core/routes";
|
|
6
|
+
|
|
7
|
+
export default function ScoreGroupLink({ id, inserted_at }) {
|
|
8
|
+
return (
|
|
9
|
+
<Link to={linkTo.SCORE_GROUP({ id })}>
|
|
10
|
+
<DateTime value={inserted_at} />
|
|
11
|
+
</Link>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
ScoreGroupLink.propTypes = {
|
|
16
|
+
id: PropTypes.string,
|
|
17
|
+
inserted_at: PropTypes.string,
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import { Message } from "semantic-ui-react";
|
|
5
|
+
|
|
6
|
+
export default function ScoreGroupMessage({ count, pending }) {
|
|
7
|
+
const { formatMessage } = useIntl();
|
|
8
|
+
return pending ? (
|
|
9
|
+
<Message
|
|
10
|
+
header={formatMessage({ id: "scores.pending.header" })}
|
|
11
|
+
content={formatMessage({ id: "scores.pending.content" }, { pending })}
|
|
12
|
+
/>
|
|
13
|
+
) : (
|
|
14
|
+
<Message
|
|
15
|
+
success
|
|
16
|
+
header={formatMessage({ id: "scores.completed.header" })}
|
|
17
|
+
content={formatMessage({ id: "scores.completed.content" }, { count })}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
ScoreGroupMessage.propTypes = {
|
|
23
|
+
count: PropTypes.number,
|
|
24
|
+
pending: PropTypes.number,
|
|
25
|
+
};
|