@truedat/dq 4.43.0 → 4.43.3

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/CHANGELOG.md +22 -3
  2. package/package.json +5 -5
  3. package/src/api.js +2 -0
  4. package/src/components/ConditionSummary.js +1 -0
  5. package/src/components/FieldSummary.js +86 -0
  6. package/src/components/ImplementationSummary.js +11 -1
  7. package/src/components/NewRemediation.js +27 -20
  8. package/src/components/NewRuleImplementation.js +42 -6
  9. package/src/components/RemediationPlan.js +47 -78
  10. package/src/components/RuleImplementationProperties.js +2 -1
  11. package/src/components/RuleImplementationResultTabs.js +113 -0
  12. package/src/components/RuleImplementationResults.js +1 -1
  13. package/src/components/RuleResult.js +108 -0
  14. package/src/components/{ExecutionDetails.js → RuleResultDetails.js} +4 -21
  15. package/src/components/RuleResultRemediationLoader.js +44 -0
  16. package/src/components/RuleResultRemediations.js +47 -0
  17. package/src/components/RuleResultRow.js +0 -3
  18. package/src/components/RuleResultSegmentRow.js +83 -0
  19. package/src/components/RuleResultSegments.js +102 -0
  20. package/src/components/RuleResultSegmentsLoader.js +34 -0
  21. package/src/components/RuleResultsRoutes.js +73 -0
  22. package/src/components/RuleRoutes.js +4 -14
  23. package/src/components/RuleSelector.js +5 -2
  24. package/src/components/__test_samples__/NewRuleImplementationProps.js +22 -2
  25. package/src/components/__tests__/ExecutionDetails.spec.js +5 -5
  26. package/src/components/__tests__/NewRuleImplementation.spec.js +27 -7
  27. package/src/components/__tests__/RuleResultSegmentsLoader.spec.js +32 -0
  28. package/src/components/__tests__/__snapshots__/ExecutionDetails.spec.js.snap +2 -30
  29. package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +1211 -1217
  30. package/src/components/__tests__/__snapshots__/RuleImplementationProperties.spec.js.snap +1 -0
  31. package/src/components/index.js +2 -2
  32. package/src/components/ruleImplementationForm/DatasetForm.js +4 -1
  33. package/src/components/ruleImplementationForm/FieldsGrid.js +57 -0
  34. package/src/components/ruleImplementationForm/FieldsGroup.js +107 -0
  35. package/src/components/ruleImplementationForm/RuleImplementationForm.js +45 -0
  36. package/src/components/ruleImplementationForm/SegmentsForm.js +35 -0
  37. package/src/components/ruleImplementationForm/__tests__/DataSetForm.spec.js +0 -1
  38. package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +27 -10
  39. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +315 -91
  40. package/src/messages/en.js +7 -0
  41. package/src/messages/es.js +7 -0
  42. package/src/reducers/__tests__/segmentResult.spec.js +46 -0
  43. package/src/reducers/index.js +2 -0
  44. package/src/reducers/ruleImplementation.js +1 -0
  45. package/src/reducers/segmentResults.js +19 -0
  46. package/src/routines.js +3 -0
  47. package/src/sagas/__tests__/fetchSegmentResults.spec.js +78 -0
  48. package/src/sagas/fetchSegmentResults.js +30 -0
  49. package/src/sagas/index.js +3 -0
  50. package/src/services/encodeRawContent.js +5 -5
  51. package/src/styles/remediationPlan.less +5 -0
  52. package/src/styles/ruleImplementationForm/DatasetForm.less +5 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.43.3] 2022-05-04
4
+
5
+ ### Changed
6
+
7
+ - [TD-3936] Updated `react-hook-form`
8
+
9
+ ## [4.43.2] 2022-05-03
10
+
11
+ ### Fixed
12
+
13
+ - [TD-4709] `DatasetForm` wasn't behaving correctly on implementations with
14
+ no dataset
15
+
16
+ ## [4.43.1] 2022-04-28
17
+
18
+ # Added
19
+
20
+ - [TD-4538] Add Segment configuration and segment results for implementations
21
+
3
22
  ## [4.43.0] 2022-04-26
4
23
 
5
24
  # Added
@@ -8,13 +27,13 @@
8
27
 
9
28
  ## [4.42.3] 2022-04-13
10
29
 
11
- # Fixed
30
+ ### Fixed
12
31
 
13
32
  - [TD-4721] Remove sources error condition in NewRuleImplementation
14
33
 
15
34
  ## [4.42.1] 2022-04-12
16
35
 
17
- # Changed
36
+ ### Changed
18
37
 
19
38
  - [TD-4536] Support rule implementation with multiple populations
20
39
 
@@ -929,7 +948,7 @@ New major version for Truedat 4.0, no changes
929
948
 
930
949
  - [TD-1802] Added individual saga to retrieve filter values
931
950
 
932
- ## [2.19.0]
951
+ ## [2.19.0] 2019-05-16
933
952
 
934
953
  ### Added
935
954
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dq",
3
- "version": "4.43.0",
3
+ "version": "4.43.3",
4
4
  "description": "Truedat Web Data Quality Module",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -31,7 +31,7 @@
31
31
  "@babel/plugin-transform-modules-commonjs": "^7.15.0",
32
32
  "@babel/preset-env": "^7.15.0",
33
33
  "@babel/preset-react": "^7.14.5",
34
- "@truedat/test": "4.43.0",
34
+ "@truedat/test": "4.43.3",
35
35
  "babel-jest": "^27.0.6",
36
36
  "babel-plugin-dynamic-import-node": "^2.3.3",
37
37
  "babel-plugin-lodash": "^3.3.4",
@@ -82,8 +82,8 @@
82
82
  },
83
83
  "dependencies": {
84
84
  "@apollo/client": "^3.4.10",
85
- "@truedat/core": "4.43.0",
86
- "@truedat/df": "4.43.0",
85
+ "@truedat/core": "4.43.3",
86
+ "@truedat/df": "4.43.3",
87
87
  "axios": "^0.19.2",
88
88
  "graphql": "^15.5.3",
89
89
  "path-to-regexp": "^1.7.0",
@@ -103,5 +103,5 @@
103
103
  "react-dom": ">= 16.8.6 < 17",
104
104
  "semantic-ui-react": ">= 0.88.2 < 2.1"
105
105
  },
106
- "gitHead": "ad0f63f2d98ae377883743b839858d9d671d2431"
106
+ "gitHead": "072eb5d04ec38033c17e030c365502484815a96b"
107
107
  }
package/src/api.js CHANGED
@@ -22,6 +22,7 @@ const API_RULE_IMPLEMENTATION_FILTERS_SEARCH =
22
22
  const API_RULE_IMPLEMENTATIONS_UPLOAD = "/api/rule_implementations/upload";
23
23
  const API_RULE_RESULT = "/api/rule_results/:id";
24
24
  const API_RULE_RESULTS = "/api/rule_results";
25
+ const API_SEGMENT_RESULTS = "/api/rule_results/:rule_result_id/segment_results";
25
26
  const API_SUBSCRIPTIONS_SEARCH = "/api/subscriptions/user/me/search";
26
27
  const API_SUBSCRIPTION = "/api/subscriptions/:id";
27
28
  const API_SUBSCRIPTIONS = "/api/subscriptions";
@@ -47,6 +48,7 @@ export {
47
48
  API_RULE_IMPLEMENTATIONS_UPLOAD,
48
49
  API_RULE_RESULT,
49
50
  API_RULE_RESULTS,
51
+ API_SEGMENT_RESULTS,
50
52
  API_SUBSCRIPTIONS_SEARCH,
51
53
  API_SUBSCRIPTION,
52
54
  API_SUBSCRIPTIONS,
@@ -217,6 +217,7 @@ ConditionSummary.propTypes = {
217
217
  icon: PropTypes.string,
218
218
  rows: PropTypes.array,
219
219
  type: PropTypes.string,
220
+ alias: PropTypes.array,
220
221
  };
221
222
 
222
223
  export default ConditionSummary;
@@ -0,0 +1,86 @@
1
+ import _ from "lodash/fp";
2
+ import React from "react";
3
+ import PropTypes from "prop-types";
4
+ import { Header, Icon, Segment, Table } from "semantic-ui-react";
5
+ import { Link } from "react-router-dom";
6
+ import { FormattedMessage } from "react-intl";
7
+ import { linkTo } from "@truedat/core/routes";
8
+
9
+ export const empty = (rows) =>
10
+ rows && _.every((r) => _.isEmpty(r) || _.isNil(r))(rows);
11
+
12
+ const ConditionCell = ({ row, alias }) => {
13
+ const alias_text = _.flow(
14
+ _.find({ index: row.structure?.parent_index }),
15
+ _.propOr(null, "text")
16
+ )(alias);
17
+
18
+ return (
19
+ <Table.Row>
20
+ <Table.Cell width={5}>
21
+ {_.has("structure")(row) && (
22
+ <>
23
+ <Link
24
+ to={linkTo.STRUCTURE({
25
+ id: _.path("structure.id")(row),
26
+ })}
27
+ >
28
+ <span className="highlighted">
29
+ {alias_text && `(${alias_text}).`}{" "}
30
+ {`"${_.pathOr("", "structure.name")(row)}"`}
31
+ </span>
32
+ </Link>
33
+ </>
34
+ )}
35
+ </Table.Cell>
36
+ </Table.Row>
37
+ );
38
+ };
39
+
40
+ ConditionCell.propTypes = {
41
+ row: PropTypes.object,
42
+ alias: PropTypes.array,
43
+ };
44
+
45
+ export const FieldSummary = ({ rows, type, icon, alias }) => {
46
+ const wrappedRows = [rows];
47
+ return empty(rows) ? null : (
48
+ <>
49
+ <Header as="h3">
50
+ <Icon name={icon} size="small" />
51
+ <Header.Content>
52
+ <FormattedMessage
53
+ id={`ruleImplementations.summary.headers.${type}`}
54
+ />
55
+ </Header.Content>
56
+ </Header>
57
+ {wrappedRows.map((rows, i) => (
58
+ <Segment key={i}>
59
+ <Table basic="very">
60
+ <Table.Header>
61
+ <Table.Row>
62
+ <Table.HeaderCell>
63
+ <FormattedMessage id={`ruleImplementation.summary.field`} />
64
+ </Table.HeaderCell>
65
+ </Table.Row>
66
+ </Table.Header>
67
+ <Table.Body>
68
+ {rows.map((row, i) => (
69
+ <ConditionCell key={i} row={row} alias={alias} />
70
+ ))}
71
+ </Table.Body>
72
+ </Table>
73
+ </Segment>
74
+ ))}
75
+ </>
76
+ );
77
+ };
78
+
79
+ FieldSummary.propTypes = {
80
+ icon: PropTypes.string,
81
+ rows: PropTypes.array,
82
+ type: PropTypes.string,
83
+ alias: PropTypes.array,
84
+ };
85
+
86
+ export default FieldSummary;
@@ -6,6 +6,7 @@ import { Link } from "react-router-dom";
6
6
  import { FormattedMessage } from "react-intl";
7
7
  import { linkTo } from "@truedat/core/routes";
8
8
  import ConditionSummary, { empty, path } from "./ConditionSummary";
9
+ import FieldSummary from "./FieldSummary";
9
10
  import InformationSummary from "./InformationSummary";
10
11
  import "../styles/ImplementationSummary.less";
11
12
 
@@ -15,6 +16,7 @@ const defaults = [
15
16
  "dataset",
16
17
  "populations",
17
18
  "validations",
19
+ "segments",
18
20
  ];
19
21
 
20
22
  const FormattedLink = ({ value, operator = {} }) =>
@@ -130,7 +132,7 @@ DatasetSummary.propTypes = {
130
132
 
131
133
  export const ImplementationSummary = ({ ruleImplementation, activeSteps }) => {
132
134
  const steps = _.isEmpty(activeSteps) ? defaults : activeSteps;
133
- const { dataset, populations, validations } =
135
+ const { dataset, populations, validations, segments } =
134
136
  _.pick(steps)(ruleImplementation);
135
137
  const alias = _.map(_.propOr({}, "alias"))(dataset);
136
138
  return (
@@ -158,6 +160,14 @@ export const ImplementationSummary = ({ ruleImplementation, activeSteps }) => {
158
160
  alias={alias}
159
161
  />
160
162
  )}
163
+ {segments && _.includes("segments")(steps) && (
164
+ <FieldSummary
165
+ type="segments"
166
+ icon="grid layout"
167
+ rows={segments}
168
+ alias={alias}
169
+ />
170
+ )}
161
171
  </>
162
172
  );
163
173
  };
@@ -2,11 +2,13 @@ import _ from "lodash/fp";
2
2
  import React, { useState } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
- import { Button, Header, Icon, Segment } from "semantic-ui-react";
5
+ import { Button, Header, Icon, Container, Segment } from "semantic-ui-react";
6
6
  import { FormattedMessage, useIntl } from "react-intl";
7
7
  import { createRemediation, fetchRuleImplementation } from "../routines";
8
8
  import RemediationForm from "./RemediationForm";
9
9
 
10
+ import "../styles/remediationPlan.less";
11
+
10
12
  export const NewRemediation = ({
11
13
  manageRemediations,
12
14
  onSaveRemediation,
@@ -23,25 +25,30 @@ export const NewRemediation = ({
23
25
 
24
26
  return !manageRemediations || _.isEmpty(templates) ? null : (
25
27
  <>
26
- {!isEdit ? (
27
- <Button
28
- primary
29
- onClick={() => setIsEdit(!isEdit)}
30
- content={formatMessage({ id: "remediation.actions.create" })}
31
- />
32
- ) : (
33
- <>
34
- <Header as="h2">
35
- <Icon name="plug" />
36
- <Header.Content>
37
- <FormattedMessage id="remediation.actions.create" />
38
- </Header.Content>
39
- </Header>
40
- <Segment>
41
- <RemediationForm onSave={onSave} latestResultId={latestResultId} />
42
- </Segment>
43
- </>
44
- )}
28
+ <Container className="new-remedation-container" fluid>
29
+ {!isEdit ? (
30
+ <Button
31
+ primary
32
+ onClick={() => setIsEdit(!isEdit)}
33
+ content={formatMessage({ id: "remediation.actions.create" })}
34
+ />
35
+ ) : (
36
+ <>
37
+ <Header as="h2">
38
+ <Icon name="plug" />
39
+ <Header.Content>
40
+ <FormattedMessage id="remediation.actions.create" />
41
+ </Header.Content>
42
+ </Header>
43
+ <Segment>
44
+ <RemediationForm
45
+ onSave={onSave}
46
+ latestResultId={latestResultId}
47
+ />
48
+ </Segment>
49
+ </>
50
+ )}
51
+ </Container>
45
52
  </>
46
53
  );
47
54
  };
@@ -224,8 +224,8 @@ const updateStructureParentIndex = (structures) => (structure) => {
224
224
  return structure;
225
225
  };
226
226
 
227
- const withConditionDefaultAlias = (conditions, structures) =>
228
- _.map((p) => {
227
+ const withConditionDefaultAlias = (conditions, structures) => {
228
+ return _.map((p) => {
229
229
  return {
230
230
  ...p,
231
231
  structure: updateStructureParentIndex(structures)(p.structure),
@@ -235,6 +235,7 @@ const withConditionDefaultAlias = (conditions, structures) =>
235
235
  : p.value,
236
236
  };
237
237
  })(conditions);
238
+ };
238
239
 
239
240
  export const NewRuleImplementation = ({
240
241
  canManageRaw,
@@ -296,6 +297,18 @@ export const NewRuleImplementation = ({
296
297
  ),
297
298
  precalculatedDataset
298
299
  ),
300
+ segments: withConditionDefaultAlias(
301
+ addFieldType(
302
+ ruleImplementationProps,
303
+ structuresFields,
304
+ structuresSiblings,
305
+ "segments",
306
+ "segment",
307
+ { name: "" }
308
+ ),
309
+ precalculatedDataset
310
+ ),
311
+
299
312
  rawContent: {
300
313
  ..._.prop("raw_content")(ruleImplementationProps),
301
314
  },
@@ -313,12 +326,14 @@ export const NewRuleImplementation = ({
313
326
  population: [],
314
327
  populations: [],
315
328
  validations: [{}],
329
+ segments: [{}],
316
330
  rawContent: {
317
331
  database: "",
318
332
  source_id: null,
319
333
  dataset: "",
320
334
  population: "",
321
335
  validations: "",
336
+ segments: "",
322
337
  },
323
338
  dfName: "",
324
339
  dfContent: {},
@@ -380,6 +395,12 @@ export const NewRuleImplementation = ({
380
395
  _.filter((val) => valueInDataset(val))
381
396
  )(ruleImplementation);
382
397
 
398
+ const segments_within_dataset = _.flow(
399
+ _.prop("segments"),
400
+ _.filter((val) => belongsToDataset(_.path("structure.id")(val))),
401
+ _.filter((val) => valueInDataset(val))
402
+ )(ruleImplementation);
403
+
383
404
  const population_within_dataset = _.flow(
384
405
  _.prop("population"),
385
406
  _.filter((val) => belongsToDataset(_.path("structure.id")(val))),
@@ -395,16 +416,15 @@ export const NewRuleImplementation = ({
395
416
  validations: _.isEmpty(validations_within_dataset)
396
417
  ? [{}]
397
418
  : validations_within_dataset,
419
+ segments: _.isEmpty(segments_within_dataset)
420
+ ? []
421
+ : segments_within_dataset,
398
422
  });
399
423
  };
400
424
 
401
425
  const onChange = (prop, value) =>
402
426
  setRuleImplementation({ ...ruleImplementation, [prop]: value });
403
427
 
404
- const setPopulation = (population) => {
405
- setRuleImplementation({ ...ruleImplementation, population });
406
- };
407
-
408
428
  const addPopulation = () => {
409
429
  const populations = _.concat(
410
430
  _.pathOr([], "populations")(ruleImplementation)
@@ -426,6 +446,18 @@ export const NewRuleImplementation = ({
426
446
  setRuleImplementation({ ...ruleImplementation, validations });
427
447
  };
428
448
 
449
+ const addSegments = () => {
450
+ const segments = _.concat(_.pathOr([], "segments")(ruleImplementation))([
451
+ {},
452
+ ]);
453
+ setRuleImplementation({ ...ruleImplementation, segments });
454
+ };
455
+
456
+ const setSegments = (segments) => {
457
+ const newSegments = _.isEqual([{}])(segments) ? [] : segments;
458
+ setRuleImplementation({ ...ruleImplementation, segments: newSegments });
459
+ };
460
+
429
461
  const setImplementationKey = (implementationKey) =>
430
462
  setRuleImplementation({ ...ruleImplementation, implementationKey });
431
463
 
@@ -449,6 +481,7 @@ export const NewRuleImplementation = ({
449
481
  const validations = _.filter(_.negate(_.isEmpty))(
450
482
  ruleImplementation.validations
451
483
  );
484
+ const segments = _.filter(_.negate(_.isEmpty))(ruleImplementation.segments);
452
485
 
453
486
  const dfContent = _.flow(
454
487
  _.prop("dfContent"),
@@ -481,6 +514,7 @@ export const NewRuleImplementation = ({
481
514
  dataset: datasetAttributes(_.prop("dataset")(ruleImplementation)),
482
515
  populations: populationsAttributes(populations),
483
516
  validations: conditionAttributes(validations),
517
+ segments,
484
518
  implementation_key: _.prop("implementationKey")(ruleImplementation),
485
519
  implementation_type:
486
520
  _.prop("implementationType")(ruleImplementation),
@@ -562,6 +596,8 @@ export const NewRuleImplementation = ({
562
596
  addPopulation={addPopulation}
563
597
  setPopulations={setPopulations}
564
598
  setValidations={setValidations}
599
+ addSegments={addSegments}
600
+ setSegments={setSegments}
565
601
  operators={operators}
566
602
  setImplementationKey={setImplementationKey}
567
603
  onChange={onChange}
@@ -4,17 +4,14 @@ import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { useIntl } from "react-intl";
6
6
  import { useParams } from "react-router-dom";
7
- import { Button, Header, Icon, Grid, Segment } from "semantic-ui-react";
7
+ import { Button, Grid, Container } from "semantic-ui-react";
8
8
  import { FormattedMessage } from "react-intl";
9
9
  import { Loading } from "@truedat/core/components";
10
10
  import { ConfirmModal } from "@truedat/core/components";
11
- import {
12
- fetchRemediation,
13
- clearRemediation,
14
- deleteRemediation,
15
- } from "../routines";
11
+ import { deleteRemediation } from "../routines";
16
12
  import NewRemediation from "./NewRemediation";
17
13
  import RemediationForm from "./RemediationForm";
14
+
18
15
  import "../styles/remediationPlan.less";
19
16
 
20
17
  const DynamicFormViewer = React.lazy(() =>
@@ -23,10 +20,7 @@ const DynamicFormViewer = React.lazy(() =>
23
20
 
24
21
  export const RemediationPlan = ({
25
22
  isLoading,
26
- className,
27
23
  deleteRemediation,
28
- fetchRemediation,
29
- clearRemediation,
30
24
  remediation,
31
25
  templates,
32
26
  latestResultId,
@@ -44,17 +38,6 @@ export const RemediationPlan = ({
44
38
  setRuleResultId(paramsRuleResultId || latestResultId);
45
39
  }, [paramsRuleResultId, latestResultId]);
46
40
 
47
- useEffect(() => {
48
- ruleResultId && fetchRemediation({ rule_result_id: ruleResultId });
49
- }, [fetchRemediation, ruleResultId]);
50
-
51
- useEffect(
52
- () => () => {
53
- clearRemediation();
54
- },
55
- [clearRemediation]
56
- );
57
-
58
41
  const onSave = () => {
59
42
  setIsEdit(false);
60
43
  };
@@ -70,67 +53,58 @@ export const RemediationPlan = ({
70
53
  <>
71
54
  {!_.isEmpty(remediation) ? (
72
55
  <>
73
- <Header as="h2">
74
- <Icon circular name="rain" />
75
- <Header.Content>
76
- <FormattedMessage
77
- id={!isEdit ? "remediation" : "remediation.actions.edit"}
56
+ {manageRemediations ? (
57
+ <div className="ui actions remediation">
58
+ <ConfirmModal
59
+ icon="trash"
60
+ trigger={<Button secondary icon="trash" basic color="red" />}
61
+ header={
62
+ <FormattedMessage id="remediation.actions.delete.confirmation.header" />
63
+ }
64
+ content={
65
+ <FormattedMessage
66
+ id="remediation.actions.delete.confirmation.content"
67
+ values={{ ruleResultId: <b>{ruleResultId}</b> }}
68
+ />
69
+ }
70
+ onConfirm={() =>
71
+ deleteRemediation({
72
+ implementation_id: implementationId,
73
+ rule_result_id: ruleResultId,
74
+ })
75
+ }
76
+ />
77
+ <Button
78
+ className="button-edit-remediation"
79
+ primary
80
+ onClick={() => setIsEdit(!isEdit)}
81
+ content={formatMessage({
82
+ id: !isEdit ? "actions.edit" : "actions.cancel",
83
+ })}
78
84
  />
79
- </Header.Content>
80
- </Header>
85
+ </div>
86
+ ) : null}
81
87
 
82
- <Segment className={className}>
83
- {manageRemediations ? (
84
- <div className="ui actions remediation">
85
- <ConfirmModal
86
- icon="trash"
87
- trigger={<Button secondary icon="trash" basic color="red" />}
88
- header={
89
- <FormattedMessage id="remediation.actions.delete.confirmation.header" />
90
- }
91
- content={
92
- <FormattedMessage
93
- id="remediation.actions.delete.confirmation.content"
94
- values={{ ruleResultId: <b>{ruleResultId}</b> }}
95
- />
96
- }
97
- onConfirm={() =>
98
- deleteRemediation({
99
- implementation_id: implementationId,
100
- rule_result_id: ruleResultId,
101
- })
102
- }
103
- />
104
- <Button
105
- className="button-edit-remediation"
106
- primary
107
- onClick={() => setIsEdit(!isEdit)}
108
- content={formatMessage({
109
- id: !isEdit ? "actions.edit" : "actions.cancel",
110
- })}
88
+ <Grid>
89
+ <Grid.Column width={8}>
90
+ {!isEdit && remediation?.df_name ? (
91
+ <DynamicFormViewer
92
+ template={_.find(_.propEq("name", remediation.df_name))(
93
+ templates
94
+ )}
95
+ content={remediation.df_content}
111
96
  />
112
- </div>
113
- ) : null}
114
-
115
- <Grid>
116
- <Grid.Column width={8}>
117
- {!isEdit && remediation?.df_name ? (
118
- <DynamicFormViewer
119
- template={_.find(_.propEq("name", remediation.df_name))(
120
- templates
121
- )}
122
- content={remediation.df_content}
123
- />
124
- ) : (
97
+ ) : (
98
+ <Container className="new-remedation-container" fluid>
125
99
  <RemediationForm
126
100
  onSave={onSave}
127
101
  remediation={remediation}
128
102
  latestResultId={latestResultId}
129
103
  />
130
- )}
131
- </Grid.Column>
132
- </Grid>
133
- </Segment>
104
+ </Container>
105
+ )}
106
+ </Grid.Column>
107
+ </Grid>
134
108
  </>
135
109
  ) : null}
136
110
  </>
@@ -139,10 +113,7 @@ export const RemediationPlan = ({
139
113
 
140
114
  RemediationPlan.propTypes = {
141
115
  isLoading: PropTypes.bool,
142
- className: PropTypes.string,
143
116
  deleteRemediation: PropTypes.func,
144
- clearRemediation: PropTypes.func,
145
- fetchRemediation: PropTypes.func,
146
117
  remediation: PropTypes.object,
147
118
  templates: PropTypes.array,
148
119
  latestResultId: PropTypes.number,
@@ -164,6 +135,4 @@ const mapStateToProps = ({
164
135
 
165
136
  export default connect(mapStateToProps, {
166
137
  deleteRemediation,
167
- fetchRemediation,
168
- clearRemediation,
169
138
  })(RemediationPlan);
@@ -12,7 +12,7 @@ const DynamicFormViewer = React.lazy(() =>
12
12
  import("@truedat/df/components/DynamicFormViewer")
13
13
  );
14
14
 
15
- const summarySteps = ["dataset", "populations", "validations"];
15
+ const summarySteps = ["dataset", "populations", "validations", "segments"];
16
16
 
17
17
  export const RuleImplementationProperties = ({
18
18
  ruleImplementation,
@@ -75,6 +75,7 @@ const mapStateToProps = ({
75
75
  ruleImplementation: _.pick([
76
76
  ...summarySteps,
77
77
  "populations",
78
+ "segments",
78
79
  "executable",
79
80
  "event_type",
80
81
  "event_message",