@truedat/qx 8.4.9 → 8.5.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.
Files changed (52) hide show
  1. package/package.json +3 -3
  2. package/src/components/common/expressions/Clauses.js +5 -9
  3. package/src/components/common/expressions/Condition.js +36 -37
  4. package/src/components/common/expressions/__tests__/Clauses.spec.js +87 -0
  5. package/src/components/common/expressions/__tests__/Condition.spec.js +220 -1
  6. package/src/components/common/expressions/__tests__/__snapshots__/Clauses.spec.js.snap +22 -21
  7. package/src/components/common/expressions/__tests__/__snapshots__/Condition.spec.js.snap +212 -214
  8. package/src/components/dataViews/queryableProperties/GroupBy.js +4 -2
  9. package/src/components/dataViews/queryableProperties/__tests__/GroupBy.spec.js +134 -28
  10. package/src/components/qualityControls/ControlProperties.js +32 -16
  11. package/src/components/qualityControls/ControlPropertiesForm.js +3 -3
  12. package/src/components/qualityControls/ControlPropertiesSummary.js +127 -104
  13. package/src/components/qualityControls/ControlPropertiesView.js +48 -74
  14. package/src/components/qualityControls/InformationForm.js +181 -180
  15. package/src/components/qualityControls/ScoreCriteria.js +0 -4
  16. package/src/components/qualityControls/ScoreCriteriaView.js +6 -9
  17. package/src/components/qualityControls/__tests__/ControlProperties.spec.js +47 -16
  18. package/src/components/qualityControls/__tests__/ControlPropertiesForm.spec.js +100 -0
  19. package/src/components/qualityControls/__tests__/ControlPropertiesSummary.spec.js +141 -0
  20. package/src/components/qualityControls/__tests__/ControlPropertiesView.spec.js +102 -11
  21. package/src/components/qualityControls/__tests__/EditQualityControl.spec.js +27 -3
  22. package/src/components/qualityControls/__tests__/InformationForm.spec.js +342 -0
  23. package/src/components/qualityControls/__tests__/NewDraftQualityControl.spec.js +26 -6
  24. package/src/components/qualityControls/__tests__/NewQualityControl.spec.js +66 -20
  25. package/src/components/qualityControls/__tests__/QualityBadge.spec.js +30 -3
  26. package/src/components/qualityControls/__tests__/QualityControlEditor.spec.js +282 -45
  27. package/src/components/qualityControls/__tests__/ScoreCriteria.spec.js +25 -3
  28. package/src/components/qualityControls/__tests__/ScoreCriteriaView.spec.js +19 -3
  29. package/src/components/qualityControls/__tests__/__fixtures__/qualityControlHelper.js +1 -1
  30. package/src/components/qualityControls/__tests__/__snapshots__/ControlProperties.spec.js.snap +13 -1
  31. package/src/components/qualityControls/__tests__/__snapshots__/ControlPropertiesView.spec.js.snap +70 -40
  32. package/src/components/qualityControls/__tests__/__snapshots__/EditQualityControl.spec.js.snap +118 -132
  33. package/src/components/qualityControls/__tests__/__snapshots__/NewDraftQualityControl.spec.js.snap +118 -132
  34. package/src/components/qualityControls/__tests__/__snapshots__/NewQualityControl.spec.js.snap +0 -13
  35. package/src/components/qualityControls/__tests__/__snapshots__/QualityBadge.spec.js.snap +15 -5
  36. package/src/components/qualityControls/__tests__/__snapshots__/QualityControlEditor.spec.js.snap +488 -125
  37. package/src/components/qualityControls/__tests__/__snapshots__/ScoreCriteria.spec.js.snap +13 -5
  38. package/src/components/qualityControls/__tests__/qualityByControlMode.spec.js +65 -14
  39. package/src/components/qualityControls/controlProperties/{Ratio.js → ResourceWithValidation.js} +19 -10
  40. package/src/components/qualityControls/controlProperties/__tests__/ResourceWithValidation.spec.js +192 -0
  41. package/src/components/qualityControls/qualityByControlMode.js +6 -30
  42. package/src/components/qualityControls/scoreCriterias/ErrorCount.js +0 -1
  43. package/src/components/qualityControls/scoreCriterias/__tests__/ErrorCount.spec.js +4 -4
  44. package/src/components/dataViews/queryableProperties/__tests__/__snapshots__/GroupBy.spec.js.snap +0 -604
  45. package/src/components/qualityControls/controlProperties/Count.js +0 -56
  46. package/src/components/qualityControls/controlProperties/__tests__/Count.spec.js +0 -66
  47. package/src/components/qualityControls/controlProperties/__tests__/Ratio.spec.js +0 -95
  48. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Count.spec.js.snap +0 -67
  49. package/src/components/qualityControls/controlProperties/__tests__/__snapshots__/Ratio.spec.js.snap +0 -161
  50. package/src/components/qualityControls/scoreCriterias/Count.js +0 -88
  51. package/src/components/qualityControls/scoreCriterias/__tests__/Count.spec.js +0 -62
  52. package/src/components/qualityControls/scoreCriterias/__tests__/__snapshots__/Count.spec.js.snap +0 -58
@@ -8,20 +8,26 @@ import DataViewSummary from "../dataViews/DataViewSummary";
8
8
  import { useDataViewFetch } from "@truedat/qx/hooks/useDataViews";
9
9
  import { getColorById } from "../dataViews/queryableFunctions";
10
10
 
11
+ const ratioViewProps = {
12
+ resourceKey: "resource",
13
+ resourceLabelId: "quality_control.ratio.resource",
14
+ resourceEmptyLabelId: "quality_control.ratio.resource.empty",
15
+ validationLabelId: "quality_control.ratio.validation",
16
+ validationEmptyLabelId: "quality_control.ratio.validation.empty",
17
+ };
18
+
19
+ const countViewProps = {
20
+ resourceKey: "errors_resource",
21
+ resourceLabelId: "quality_control.count.errors_resource",
22
+ resourceEmptyLabelId: "quality_control.count.errors_resource.empty",
23
+ validationLabelId: "quality_control.count.validation",
24
+ validationEmptyLabelId: "quality_control.count.validation.empty",
25
+ };
26
+
11
27
  export default function ControlPropertiesView({ qualityControl }) {
12
28
  const { control_properties, control_mode } = qualityControl;
13
- const controlPropertiesForMode = {
14
- percentage: (
15
- <ControlPropertiesRatio controlProperties={control_properties} />
16
- ),
17
- deviation: (
18
- <ControlPropertiesRatio controlProperties={control_properties} />
19
- ),
20
- count: <ControlPropertiesCount controlProperties={control_properties} />,
21
- error_count: (
22
- <ControlPropertiesRatio controlProperties={control_properties} />
23
- ),
24
- };
29
+ const viewProps =
30
+ control_mode === "error_count" ? countViewProps : ratioViewProps;
25
31
 
26
32
  return (
27
33
  <>
@@ -33,7 +39,10 @@ export default function ControlPropertiesView({ qualityControl }) {
33
39
  </Header>
34
40
  <Segment>
35
41
  {control_properties ? (
36
- controlPropertiesForMode[control_mode]
42
+ <ResourceWithValidationView
43
+ controlProperties={control_properties}
44
+ {...viewProps}
45
+ />
37
46
  ) : (
38
47
  <FormattedMessage id="quality_control.control_properties.empty" />
39
48
  )}
@@ -42,32 +51,40 @@ export default function ControlPropertiesView({ qualityControl }) {
42
51
  );
43
52
  }
44
53
 
45
- const ControlPropertiesRatio = ({ controlProperties }) => {
46
- const isDataViewResource = controlProperties.resource?.type === "data_view";
47
- const parentResource = { id: 0, embedded: controlProperties.resource?.embedded };
48
- const dataViewId = isDataViewResource ? controlProperties.resource?.id : null;
54
+ const ResourceWithValidationView = ({
55
+ controlProperties,
56
+ resourceKey,
57
+ resourceLabelId,
58
+ resourceEmptyLabelId,
59
+ validationLabelId,
60
+ validationEmptyLabelId,
61
+ }) => {
62
+ const resource = _.prop(resourceKey)(controlProperties);
63
+ const parentResource = { id: 0, embedded: resource?.embedded };
64
+ const isDataViewResource = resource?.type === "data_view";
65
+ const dataViewId = isDataViewResource ? resource?.id : null;
49
66
  const { dataView, loading: dataViewLoading } = useDataViewFetch(dataViewId);
50
67
 
51
68
  return (
52
69
  <List>
53
70
  <List.Item>
54
71
  <List.Header>
55
- <FormattedMessage id="quality_control.ratio.resource" />
72
+ <FormattedMessage id={resourceLabelId} />
56
73
  </List.Header>
57
74
  <List.Content>
58
- {controlProperties.resource ? (
75
+ {resource ? (
59
76
  <List.Description>
60
77
  <Label horizontal>
61
78
  <FormattedMessage
62
- id={`queryables.resource.selector.${controlProperties.resource?.type}`}
79
+ id={`queryables.resource.selector.${resource?.type}`}
63
80
  />
64
81
  </Label>
65
82
  <Label color={getColorById(parentResource?.id)}>
66
- {_.prop("resource.embedded.name")(controlProperties)}
83
+ {_.prop(`${resourceKey}.embedded.name`)(controlProperties)}
67
84
  </Label>
68
85
  </List.Description>
69
86
  ) : (
70
- <FormattedMessage id="quality_control.ratio.resource.empty" />
87
+ <FormattedMessage id={resourceEmptyLabelId} />
71
88
  )}
72
89
  </List.Content>
73
90
  </List.Item>
@@ -87,7 +104,7 @@ const ControlPropertiesRatio = ({ controlProperties }) => {
87
104
  )}
88
105
  <List.Item>
89
106
  <List.Header>
90
- <FormattedMessage id="quality_control.ratio.validation" />
107
+ <FormattedMessage id={validationLabelId} />
91
108
  </List.Header>
92
109
  <List.Content>
93
110
  {controlProperties.validation ? (
@@ -98,7 +115,7 @@ const ControlPropertiesRatio = ({ controlProperties }) => {
98
115
  />
99
116
  </List.Description>
100
117
  ) : (
101
- <FormattedMessage id="quality_control.ratio.validation.empty" />
118
+ <FormattedMessage id={validationEmptyLabelId} />
102
119
  )}
103
120
  </List.Content>
104
121
  </List.Item>
@@ -106,56 +123,13 @@ const ControlPropertiesRatio = ({ controlProperties }) => {
106
123
  );
107
124
  };
108
125
 
109
- const ControlPropertiesCount = ({ controlProperties }) => {
110
- const parentResource = { id: 0, embedded: controlProperties.errors_resource?.embedded };
111
- const isDataViewResource =
112
- controlProperties.errors_resource?.type === "data_view";
113
- const dataViewId = isDataViewResource
114
- ? controlProperties.errors_resource?.id
115
- : null;
116
- const { dataView, loading: dataViewLoading } = useDataViewFetch(dataViewId);
117
-
118
- return (
119
- <List>
120
- <List.Item>
121
- <List.Header>
122
- <FormattedMessage id="quality_control.count.errors_resource" />
123
- </List.Header>
124
- <List.Content>
125
- {controlProperties.errors_resource ? (
126
- <List.Description>
127
- <Label horizontal>
128
- <FormattedMessage
129
- id={`queryables.resource.selector.${controlProperties.errors_resource?.type}`}
130
- />
131
- </Label>
132
- <Label
133
- color={getColorById(parentResource?.id)}
134
- >
135
- {_.prop("errors_resource.embedded.name")(controlProperties)}
136
- </Label>
137
- </List.Description>
138
- ) : (
139
- <FormattedMessage id="quality_control.count.errors_resource.empty" />
140
- )}
141
- </List.Content>
142
- </List.Item>
143
- {isDataViewResource && (
144
- <List.Item>
145
- <List.Header style={{ marginBottom: 8 }}>
146
- <FormattedMessage id="quality_control.data_view_summary" />
147
- </List.Header>
148
- <List.Content>
149
- {dataViewLoading ? (
150
- <Loading />
151
- ) : dataView ? (
152
- <DataViewSummary dataView={dataView} />
153
- ) : null}
154
- </List.Content>
155
- </List.Item>
156
- )}
157
- </List>
158
- );
126
+ ResourceWithValidationView.propTypes = {
127
+ controlProperties: PropTypes.object,
128
+ resourceKey: PropTypes.oneOf(["resource", "errors_resource"]).isRequired,
129
+ resourceLabelId: PropTypes.string.isRequired,
130
+ resourceEmptyLabelId: PropTypes.string.isRequired,
131
+ validationLabelId: PropTypes.string.isRequired,
132
+ validationEmptyLabelId: PropTypes.string.isRequired,
159
133
  };
160
134
 
161
135
  ControlPropertiesView.propTypes = {
@@ -3,200 +3,201 @@ import { lazy, useEffect } from "react";
3
3
  import { useIntl } from "react-intl";
4
4
  import { Divider, Form, Segment } from "semantic-ui-react";
5
5
  import { useFormContext, Controller } from "react-hook-form";
6
- import {
7
- DomainSelector,
8
- FieldLabel,
9
- } from "@truedat/core/components";
6
+ import { DomainSelector, FieldLabel } from "@truedat/core/components";
10
7
  import ScoreCriteria, {
11
- defaultForMode as defaultScoreCriteriaForMode,
8
+ defaultForMode as defaultScoreCriteriaForMode,
12
9
  } from "./ScoreCriteria";
13
- import {
14
- defaultForMode as defaultControlPropertiesForMode,
15
- } from "./ControlProperties";
10
+ import { defaultForMode as defaultControlPropertiesForMode } from "./ControlProperties";
16
11
 
17
12
  const SelectableDynamicForm = lazy(
18
- () => import("@truedat/df/components/SelectableDynamicForm")
13
+ () => import("@truedat/df/components/SelectableDynamicForm"),
19
14
  );
20
15
 
21
16
  const InformationForm = ({
22
- isModification,
23
- setStepInformation,
24
- stepInformation,
25
- setValidDfContent,
17
+ isModification,
18
+ setStepInformation,
19
+ stepInformation,
20
+ setValidDfContent,
26
21
  }) => {
27
- const { formatMessage } = useIntl();
28
- const { control, watch, setValue } = useFormContext();
29
- const fieldNames = [
30
- "active",
31
- "domain_ids",
32
- "name",
33
- "df_type",
34
- "control_mode",
35
- "score_criteria",
36
- ];
22
+ const { formatMessage } = useIntl();
23
+ const { control, watch, setValue } = useFormContext();
24
+ const fieldNames = [
25
+ "active",
26
+ "domain_ids",
27
+ "name",
28
+ "df_type",
29
+ "control_mode",
30
+ "score_criteria",
31
+ ];
37
32
 
38
- const formData = watch();
39
- const { dynamic_content: dfContent, domain_ids: domainIds } = formData;
33
+ const formData = watch();
34
+ const { dynamic_content: dfContent, domain_ids: domainIds } = formData;
40
35
 
41
- const setDfContent = ({ content, valid }) => {
42
- setValue("dynamic_content", content, {
43
- shouldValidate: true,
44
- shouldDirty: true,
45
- });
36
+ const setDfContent = ({ content, valid }) => {
37
+ setValue("dynamic_content", content, {
38
+ shouldValidate: true,
39
+ shouldDirty: true,
40
+ });
46
41
 
47
- setValidDfContent(_.isEmpty(valid));
48
- };
42
+ setValidDfContent(_.isEmpty(valid));
43
+ };
49
44
 
50
- const controlModeOptions = _.map((v) => ({
51
- key: v,
52
- value: v,
53
- text: formatMessage({ id: `quality_control.control_mode.${v}` }),
54
- }))(["percentage", "deviation", "error_count", "count"]);
45
+ const controlModeOptions = _.map((v) => ({
46
+ key: v,
47
+ value: v,
48
+ text: formatMessage({ id: `quality_control.control_mode.${v}` }),
49
+ }))(["percentage", "deviation", "error_count"]);
55
50
 
56
- useEffect(() => {
57
- if (!_.isEqual(stepInformation?.fieldNames, fieldNames))
58
- setStepInformation(0, { ...stepInformation, fieldNames });
59
- }, [stepInformation, fieldNames]);
51
+ useEffect(() => {
52
+ if (!_.isEqual(stepInformation?.fieldNames, fieldNames))
53
+ setStepInformation(0, { ...stepInformation, fieldNames });
54
+ }, [stepInformation, fieldNames]);
60
55
 
61
- return (
62
- <>
63
- <Segment>
64
- <Controller
65
- control={control}
66
- name="active"
67
- render={({ field: { onChange, value } }) => (
68
- <Form.Radio
69
- checked={value}
70
- disabled={isModification}
71
- name="active"
72
- label={formatMessage({
73
- id: "quality_control.form.active",
74
- })}
75
- onChange={(_e, { checked }) => onChange(checked)}
76
- toggle
77
- />
78
- )}
79
- />
80
- <Controller
81
- control={control}
82
- name="domain_ids"
83
- rules={{
84
- required: formatMessage({
85
- id: "form.validation.empty_required",
86
- }),
87
- }}
88
- render={({
89
- field: { onBlur, onChange, value },
90
- fieldState: { error },
91
- }) => (
92
- <FieldLabel
93
- label={formatMessage({
94
- id: "quality_control.form.domain_ids",
95
- })}
96
- required
97
- error={error?.message}
98
- >
99
- <DomainSelector
100
- action="createQualityControls"
101
- value={value}
102
- error={!!error}
103
- multiple
104
- onBlur={onBlur}
105
- disabled={isModification}
106
- onChange={(_e, { value }) => onChange(value)}
107
- labels
108
- />
109
- </FieldLabel>
110
- )}
111
- />
112
- <Controller
113
- control={control}
114
- name="name"
115
- rules={{
116
- required: formatMessage({ id: "form.validation.empty_required" }),
117
- }}
118
- render={({
119
- field: { onBlur, onChange, value },
120
- fieldState: { error },
121
- }) => (
122
- <FieldLabel
123
- label={formatMessage({ id: "quality_control.form.name" })}
124
- required
125
- error={error?.message}
126
- >
127
- <Form.Input
128
- autoComplete="off"
129
- placeholder={formatMessage({ id: "dataViews.form.name" })}
130
- error={!!error}
131
- onBlur={onBlur}
132
- onChange={(_e, { value }) => onChange(value)}
133
- value={value}
134
- />
135
- </FieldLabel>
136
- )}
137
- />
138
- <Controller
139
- control={control}
140
- name="df_type"
141
- rules={{ required: true }}
142
- render={({ field: { onBlur, onChange, value }, fieldState: { error } }) => (
143
- <SelectableDynamicForm
144
- scope="quality_control"
145
- content={dfContent}
146
- domainIds={domainIds}
147
- isModification={isModification}
148
- name={value}
149
- onChange={setDfContent}
150
- onNameChange={onChange}
151
- onBlur={onBlur}
152
- requiredError={!!error}
153
- required
154
- />
155
- )}
156
- />
157
- <Controller
158
- name={"control_mode"}
159
- control={control}
160
- rules={{
161
- required: {
162
- value: true,
163
- message: formatMessage({ id: "quality_control.form.required" }),
164
- }
165
- }}
166
- render={({ field: { onBlur, onChange, value }, fieldState: { error } }) => (
167
- <Form.Field required>
168
- <label>
169
- {formatMessage({ id: "quality_control.control_mode" })}
170
- </label>
171
- <Form.Dropdown
172
- selection
173
- placeholder={formatMessage({
174
- id: "quality_control.control_mode",
175
- })}
176
- onBlur={onBlur}
177
- options={controlModeOptions}
178
- onChange={(_e, { value }) => {
179
- onChange(value);
180
- setValue(
181
- "control_properties",
182
- defaultControlPropertiesForMode(value)
183
- );
184
- setValue(
185
- "score_criteria",
186
- defaultScoreCriteriaForMode(value)
187
- );
188
- }}
189
- error={error?.message}
190
- value={value}
191
- />
192
- </Form.Field>
193
- )}
194
- />
195
- <ScoreCriteria />
196
- </Segment>
197
- <Divider hidden />
198
- </>
199
- );
56
+ return (
57
+ <>
58
+ <Segment>
59
+ <Controller
60
+ control={control}
61
+ name="active"
62
+ render={({ field: { onChange, value } }) => (
63
+ <Form.Radio
64
+ checked={value}
65
+ disabled={isModification}
66
+ name="active"
67
+ label={formatMessage({
68
+ id: "quality_control.form.active",
69
+ })}
70
+ onChange={(_e, { checked }) => onChange(checked)}
71
+ toggle
72
+ />
73
+ )}
74
+ />
75
+ <Controller
76
+ control={control}
77
+ name="domain_ids"
78
+ rules={{
79
+ required: formatMessage({
80
+ id: "form.validation.empty_required",
81
+ }),
82
+ }}
83
+ render={({
84
+ field: { onBlur, onChange, value },
85
+ fieldState: { error },
86
+ }) => (
87
+ <FieldLabel
88
+ label={formatMessage({
89
+ id: "quality_control.form.domain_ids",
90
+ })}
91
+ required
92
+ error={error?.message}
93
+ >
94
+ <DomainSelector
95
+ action="createQualityControls"
96
+ value={value}
97
+ error={!!error}
98
+ multiple
99
+ onBlur={onBlur}
100
+ disabled={isModification}
101
+ onChange={(_e, { value }) => onChange(value)}
102
+ labels
103
+ />
104
+ </FieldLabel>
105
+ )}
106
+ />
107
+ <Controller
108
+ control={control}
109
+ name="name"
110
+ rules={{
111
+ required: formatMessage({ id: "form.validation.empty_required" }),
112
+ }}
113
+ render={({
114
+ field: { onBlur, onChange, value },
115
+ fieldState: { error },
116
+ }) => (
117
+ <FieldLabel
118
+ label={formatMessage({ id: "quality_control.form.name" })}
119
+ required
120
+ error={error?.message}
121
+ >
122
+ <Form.Input
123
+ autoComplete="off"
124
+ placeholder={formatMessage({ id: "dataViews.form.name" })}
125
+ error={!!error}
126
+ onBlur={onBlur}
127
+ onChange={(_e, { value }) => onChange(value)}
128
+ value={value}
129
+ />
130
+ </FieldLabel>
131
+ )}
132
+ />
133
+ <Controller
134
+ control={control}
135
+ name="df_type"
136
+ rules={{ required: true }}
137
+ render={({
138
+ field: { onBlur, onChange, value },
139
+ fieldState: { error },
140
+ }) => (
141
+ <SelectableDynamicForm
142
+ scope="quality_control"
143
+ content={dfContent}
144
+ domainIds={domainIds}
145
+ isModification={isModification}
146
+ name={value}
147
+ onChange={setDfContent}
148
+ onNameChange={onChange}
149
+ onBlur={onBlur}
150
+ requiredError={!!error}
151
+ required
152
+ />
153
+ )}
154
+ />
155
+ <Controller
156
+ name={"control_mode"}
157
+ control={control}
158
+ rules={{
159
+ required: {
160
+ value: true,
161
+ message: formatMessage({ id: "quality_control.form.required" }),
162
+ },
163
+ }}
164
+ render={({
165
+ field: { onBlur, onChange, value },
166
+ fieldState: { error },
167
+ }) => (
168
+ <Form.Field required>
169
+ <label>
170
+ {formatMessage({ id: "quality_control.control_mode" })}
171
+ </label>
172
+ <Form.Dropdown
173
+ selection
174
+ placeholder={formatMessage({
175
+ id: "quality_control.control_mode",
176
+ })}
177
+ onBlur={onBlur}
178
+ options={controlModeOptions}
179
+ onChange={(_e, { value }) => {
180
+ onChange(value);
181
+ setValue(
182
+ "control_properties",
183
+ defaultControlPropertiesForMode(value),
184
+ );
185
+ setValue(
186
+ "score_criteria",
187
+ defaultScoreCriteriaForMode(value),
188
+ );
189
+ }}
190
+ error={error?.message}
191
+ value={value}
192
+ />
193
+ </Form.Field>
194
+ )}
195
+ />
196
+ <ScoreCriteria />
197
+ </Segment>
198
+ <Divider hidden />
199
+ </>
200
+ );
200
201
  };
201
202
 
202
203
  export default InformationForm;
@@ -5,7 +5,6 @@ import QxContext from "@truedat/qx/components/QxContext";
5
5
 
6
6
  import Deviation from "./scoreCriterias/Deviation";
7
7
  import ErrorCount from "./scoreCriterias/ErrorCount";
8
- import Count from "./scoreCriterias/Count";
9
8
  import Percentage from "./scoreCriterias/Percentage";
10
9
 
11
10
  export default function ScoreCriteria() {
@@ -16,7 +15,6 @@ export default function ScoreCriteria() {
16
15
 
17
16
  const scoreCriteriaForMode = {
18
17
  deviation: <Deviation />,
19
- count: <Count />,
20
18
  error_count: <ErrorCount />,
21
19
  percentage: <Percentage />,
22
20
  };
@@ -34,8 +32,6 @@ export const defaultForMode = (controlMode) => {
34
32
  switch (controlMode) {
35
33
  case "deviation":
36
34
  return { goal: null, maximum: null };
37
- case "count":
38
- return { goal: null, maximum: null };
39
35
  case "error_count":
40
36
  return { goal: null, maximum: null };
41
37
  case "percentage":
@@ -11,11 +11,14 @@ export default function ScoreCriteriaView({ qualityControl }) {
11
11
 
12
12
  switch (control_mode) {
13
13
  case "percentage":
14
- return !_.isNil(score_criteria.goal) && !_.isNil(score_criteria.minimum);
14
+ return (
15
+ !_.isNil(score_criteria.goal) && !_.isNil(score_criteria.minimum)
16
+ );
15
17
  case "deviation":
16
18
  case "error_count":
17
- case "count":
18
- return !_.isNil(score_criteria.goal) && !_.isNil(score_criteria.maximum);
19
+ return (
20
+ !_.isNil(score_criteria.goal) && !_.isNil(score_criteria.maximum)
21
+ );
19
22
  default:
20
23
  return false;
21
24
  }
@@ -35,12 +38,6 @@ export default function ScoreCriteriaView({ qualityControl }) {
35
38
  />
36
39
  ),
37
40
  error_count: (
38
- <ScoreCriteriaContent
39
- goal={`${score_criteria?.goal}%`}
40
- threshold={`${score_criteria?.maximum}%`}
41
- />
42
- ),
43
- count: (
44
41
  <ScoreCriteriaContent
45
42
  goal={score_criteria?.goal}
46
43
  threshold={score_criteria?.maximum}