@truedat/dq 4.44.0 → 4.44.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 (82) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/package.json +5 -5
  3. package/src/components/EditRule.js +1 -1
  4. package/src/components/ExecutionForm.js +68 -78
  5. package/src/components/ExecutionPopup.js +10 -6
  6. package/src/components/ImplementationCrumbs.js +91 -0
  7. package/src/components/ImplementationResultBar.js +1 -2
  8. package/src/components/ImplementationStructures.js +1 -3
  9. package/src/components/Implementations.js +9 -2
  10. package/src/components/ImplementationsRoutes.js +386 -17
  11. package/src/components/NewRule.js +1 -1
  12. package/src/components/NewRuleImplementation.js +99 -135
  13. package/src/components/RemediationCrumbs.js +1 -2
  14. package/src/components/RemediationForm.js +32 -43
  15. package/src/components/RuleCrumbs.js +6 -63
  16. package/src/components/RuleForm.js +102 -103
  17. package/src/components/RuleImplementation.js +35 -40
  18. package/src/components/RuleImplementationActions.js +19 -23
  19. package/src/components/RuleImplementationLink.js +2 -3
  20. package/src/components/RuleImplementationProperties.js +13 -14
  21. package/src/components/RuleImplementationResultTabs.js +27 -35
  22. package/src/components/RuleImplementationResults.js +1 -6
  23. package/src/components/RuleImplementationResultsLink.js +3 -9
  24. package/src/components/RuleImplementationTabs.js +13 -18
  25. package/src/components/RuleImplementationsActions.js +48 -2
  26. package/src/components/RuleLink.js +3 -4
  27. package/src/components/RuleResultRow.js +1 -6
  28. package/src/components/RuleResultSegmentRow.js +0 -3
  29. package/src/components/RuleResultSegments.js +2 -6
  30. package/src/components/RuleResultsRoutes.js +45 -60
  31. package/src/components/RuleRoutes.js +41 -334
  32. package/src/components/RulesRoutes.js +0 -5
  33. package/src/components/__tests__/ExecutionForm.spec.js +7 -1
  34. package/src/components/__tests__/ExecutionPopup.spec.js +3 -2
  35. package/src/components/__tests__/ImplementationResultBar.spec.js +44 -63
  36. package/src/components/__tests__/InformationSummary.spec.js +2 -6
  37. package/src/components/__tests__/NewRuleImplementation.spec.js +4 -6
  38. package/src/components/__tests__/RemediationForm.spec.js +47 -58
  39. package/src/components/__tests__/RuleForm.spec.js +80 -207
  40. package/src/components/__tests__/RuleImplementation.spec.js +45 -22
  41. package/src/components/__tests__/RuleImplementationsActions.spec.js +0 -1
  42. package/src/components/__tests__/RuleImplementationsOptions.spec.js +1 -10
  43. package/src/components/__tests__/RuleResultsUpload.spec.js +1 -5
  44. package/src/components/__tests__/RuleSummary.spec.js +6 -11
  45. package/src/components/__tests__/__snapshots__/EditRule.spec.js.snap +1 -1
  46. package/src/components/__tests__/__snapshots__/ExecutionForm.spec.js.snap +1 -2
  47. package/src/components/__tests__/__snapshots__/ImplementationResultBar.spec.js.snap +5 -5
  48. package/src/components/__tests__/__snapshots__/NewRule.spec.js.snap +1 -1
  49. package/src/components/__tests__/__snapshots__/NewRuleImplementation.spec.js.snap +3 -0
  50. package/src/components/__tests__/__snapshots__/RemediationForm.spec.js.snap +2 -3
  51. package/src/components/__tests__/__snapshots__/RuleCrumbs.spec.js.snap +2 -73
  52. package/src/components/__tests__/__snapshots__/RuleForm.spec.js.snap +699 -385
  53. package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +20 -33
  54. package/src/components/__tests__/__snapshots__/RuleImplementationResultTabs.spec.js.snap +1 -1
  55. package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +0 -7
  56. package/src/components/__tests__/__snapshots__/RuleImplementationResultsLink.spec.js.snap +1 -1
  57. package/src/components/__tests__/__snapshots__/RuleImplementationTabs.spec.js.snap +5 -5
  58. package/src/components/__tests__/__snapshots__/RuleImplementationsActions.spec.js.snap +1 -1
  59. package/src/components/index.js +0 -2
  60. package/src/components/ruleImplementationForm/InformationForm.js +51 -74
  61. package/src/components/ruleImplementationForm/RuleImplementationForm.js +52 -47
  62. package/src/components/ruleImplementationForm/RuleImplementationRawForm.js +76 -98
  63. package/src/components/ruleImplementationForm/__tests__/LimitsForm.spec.js +9 -35
  64. package/src/components/ruleImplementationForm/__tests__/RuleImplementationForm.spec.js +26 -51
  65. package/src/components/ruleImplementationForm/__tests__/RuleImplementationRawForm.spec.js +42 -2
  66. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationForm.spec.js.snap +88 -17
  67. package/src/components/ruleImplementationForm/__tests__/__snapshots__/RuleImplementationRawForm.spec.js.snap +12 -1
  68. package/src/messages/en.js +7 -6
  69. package/src/messages/es.js +7 -6
  70. package/src/reducers/__tests__/ruleImplementationRedirect.spec.js +2 -2
  71. package/src/reducers/__tests__/ruleRedirect.spec.js +3 -3
  72. package/src/reducers/ruleImplementation.js +3 -0
  73. package/src/reducers/ruleImplementationRedirect.js +7 -6
  74. package/src/reducers/ruleRedirect.js +4 -2
  75. package/src/reducers/userRulePermissions.js +3 -1
  76. package/src/sagas/__tests__/deleteRuleResult.spec.js +3 -5
  77. package/src/sagas/__tests__/setRuleImplementationStatus.spec.js +7 -4
  78. package/src/sagas/deleteRuleResult.js +2 -7
  79. package/src/sagas/setRuleImplementationStatus.js +7 -1
  80. package/src/components/DynamicRuleForm.js +0 -78
  81. package/src/components/__tests__/DynamicRuleForm.spec.js +0 -51
  82. package/src/components/__tests__/__snapshots__/DynamicRuleForm.spec.js.snap +0 -3
@@ -9,37 +9,60 @@ const state = {
9
9
  rule_id: 1,
10
10
  implementation_key: "impl key",
11
11
  id: 1,
12
+ executable: true,
12
13
  },
13
- userRulePermissions: {
14
- manage_quality_rule_implementations: true,
15
- manage_quality_rules: true,
14
+ };
15
+
16
+ const stateExecutePermission = {
17
+ ...state,
18
+ implementationActions: {
19
+ manage: true,
20
+ link_concept: true,
21
+ execute: true,
16
22
  },
17
- implementationActions: { link_concept: true },
18
23
  };
19
24
 
20
- const renderOpts = {
21
- messages: {
22
- en: {
23
- "quality.result.no.data": "No information about quality",
24
- "ruleImplementation.actions.clone": "clone",
25
- "ruleImplementation.actions.delete.confirmation.content": "confirm",
26
- "ruleImplementation.actions.delete.confirmation.header": "header",
27
- "ruleImplementation.actions.deprecate": "archive",
28
- "ruleImplementation.actions.edit": "edit",
29
- "ruleImplementation.actions.move": "move",
30
- "tabs.dq.implementation.links.concepts": "Related concepts",
31
- "tabs.dq.implementation.structures": "Structures",
32
- "tabs.dq.ruleImplementation.audit": "events",
33
- "tabs.dq.ruleImplementation.results": "results",
34
- "tabs.dq.ruleImplementation": "implementation",
35
- },
25
+ const stateNoExecutePermission = {
26
+ ...state,
27
+ implementationActions: {
28
+ manage: true,
29
+ link_concept: true,
30
+ execute: false,
36
31
  },
37
- state,
32
+ };
33
+
34
+ const renderOptsNoExecutePermission = {
35
+ state: stateNoExecutePermission,
36
+ };
37
+
38
+ const renderOptsExecutePermission = {
39
+ state: stateExecutePermission,
38
40
  };
39
41
 
40
42
  describe("<RuleImplementation />", () => {
41
43
  it("matches the latest snapshot", () => {
42
- const { container } = render(<RuleImplementation />, renderOpts);
44
+ const { container } = render(
45
+ <RuleImplementation />,
46
+ renderOptsExecutePermission
47
+ );
43
48
  expect(container).toMatchSnapshot();
44
49
  });
50
+
51
+ it("presence of execute permissions enables the execute button", () => {
52
+ const { queryByText } = render(
53
+ <RuleImplementation />,
54
+ renderOptsExecutePermission
55
+ );
56
+ const button = queryByText(/execute/i);
57
+ expect(button).toBeInTheDocument();
58
+ });
59
+
60
+ it("lack of execute permissions disables the execute button", () => {
61
+ const { queryByText } = render(
62
+ <RuleImplementation />,
63
+ renderOptsNoExecutePermission
64
+ );
65
+ const button = queryByText(/execute/i);
66
+ expect(button).not.toBeInTheDocument();
67
+ });
45
68
  });
@@ -1,4 +1,3 @@
1
- import _ from "lodash/fp";
2
1
  import React from "react";
3
2
  import { shallow } from "enzyme";
4
3
  import { intl } from "@truedat/test/intl-stub";
@@ -1,22 +1,13 @@
1
1
  import React from "react";
2
2
  import { waitFor } from "@testing-library/react";
3
3
  import { render } from "@truedat/test/render";
4
- import coreEn from "@truedat/core/messages/en";
5
4
  import RuleImplementationsOptions from "../RuleImplementationsOptions";
6
- import en from "../../messages/en";
7
-
8
- const renderOpts = {
9
- messages: { en: { ...coreEn, ...en } },
10
- };
11
5
 
12
6
  const props = { canUploadResults: true };
13
7
 
14
8
  describe("<RuleImplementationsOptions />", () => {
15
9
  it("matches the latest snapshot", async () => {
16
- const { container } = render(
17
- <RuleImplementationsOptions {...props} />,
18
- renderOpts
19
- );
10
+ const { container } = render(<RuleImplementationsOptions {...props} />);
20
11
  await waitFor(() => expect(container).toMatchSnapshot());
21
12
  });
22
13
  });
@@ -1,15 +1,11 @@
1
1
  import React from "react";
2
2
  import { waitFor } from "@testing-library/react";
3
3
  import { render } from "@truedat/test/render";
4
- import coreEn from "@truedat/core/messages/en";
5
4
  import RuleResultsUpload from "../RuleResultsUpload";
6
- import en from "../../messages/en";
7
-
8
- const renderOpts = { messages: { en: { ...coreEn, ...en } } };
9
5
 
10
6
  describe("<RuleResultsUpload />", () => {
11
7
  it("matches the latest snapshot", async () => {
12
- const { container } = render(<RuleResultsUpload />, renderOpts);
8
+ const { container } = render(<RuleResultsUpload />);
13
9
  await waitFor(() => expect(container).toMatchSnapshot());
14
10
  });
15
11
  });
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
- import { render } from "@truedat/test/render";
3
2
  import { fireEvent } from "@testing-library/react";
3
+ import { render } from "@truedat/test/render";
4
4
  import { RuleSummary } from "../RuleSummary";
5
- import messages from "../../messages/en";
6
5
 
7
6
  describe("<RuleSummary />", () => {
8
7
  const implementationLimits = {
@@ -40,15 +39,11 @@ describe("<RuleSummary />", () => {
40
39
  },
41
40
  };
42
41
 
43
- const renderOpts = {
44
- messages: { en: messages },
45
- };
46
-
47
42
  it("render 100% overGoal implementations", () => {
48
43
  const props = {
49
44
  implementations: [overGoalExecution],
50
45
  };
51
- const { container } = render(<RuleSummary {...props} />, renderOpts);
46
+ const { container } = render(<RuleSummary {...props} />);
52
47
  expect(container).toMatchSnapshot();
53
48
  expect(container).toHaveTextContent("100%");
54
49
  });
@@ -61,7 +56,7 @@ describe("<RuleSummary />", () => {
61
56
  underMinimumExecution,
62
57
  ],
63
58
  };
64
- const { container } = render(<RuleSummary {...props} />, renderOpts);
59
+ const { container } = render(<RuleSummary {...props} />);
65
60
  expect(container).toMatchSnapshot();
66
61
  expect(container).toHaveTextContent("33%");
67
62
  });
@@ -70,7 +65,7 @@ describe("<RuleSummary />", () => {
70
65
  const props = {
71
66
  implementations: [notExecuted, failedExecution],
72
67
  };
73
- const { container } = render(<RuleSummary {...props} />, renderOpts);
68
+ const { container } = render(<RuleSummary {...props} />);
74
69
  expect(container).toMatchSnapshot();
75
70
  expect(container).toHaveTextContent("50%");
76
71
  });
@@ -79,7 +74,7 @@ describe("<RuleSummary />", () => {
79
74
  const props = {
80
75
  implementations: [],
81
76
  };
82
- const { container } = render(<RuleSummary {...props} />, renderOpts);
77
+ const { container } = render(<RuleSummary {...props} />);
83
78
  expect(container).toMatchSnapshot();
84
79
  });
85
80
 
@@ -92,7 +87,7 @@ describe("<RuleSummary />", () => {
92
87
  underMinimumExecution,
93
88
  ],
94
89
  };
95
- const { container } = render(<RuleSummary {...props} />, renderOpts);
90
+ const { container } = render(<RuleSummary {...props} />);
96
91
  expect(container).toMatchSnapshot();
97
92
  expect(container.querySelector(".over-goal-color")).toHaveTextContent(
98
93
  "75%"
@@ -20,7 +20,7 @@ exports[`<EditRule /> matches the latest snapshot 1`] = `
20
20
  </Header>
21
21
  <withRouter(injectIntl(Connect(RuleForm)))
22
22
  editMode={true}
23
- handleSubmit={[MockFunction]}
23
+ onSubmit={[MockFunction]}
24
24
  rule={
25
25
  Object {
26
26
  "description": "dd",
@@ -8,8 +8,7 @@ exports[`<ExecutionForm /> matches the latest snapshot 1`] = `
8
8
  header
9
9
  </h2>
10
10
  <form
11
- class="ui form"
12
- style="display: none;"
11
+ class="ui loading form"
13
12
  >
14
13
  <p>
15
14
  content
@@ -8,7 +8,7 @@ exports[`<ImplementationResultBar /> render failed implementation 1`] = `
8
8
  <a
9
9
  as="div"
10
10
  class="rule-summary pointer"
11
- href="/rules/8/implementations/1/results"
11
+ href="/implementations/1/results"
12
12
  >
13
13
  <span
14
14
  class="failed-color"
@@ -33,7 +33,7 @@ exports[`<ImplementationResultBar /> render not executed implementation 1`] = `
33
33
  <a
34
34
  as="div"
35
35
  class="rule-summary pointer"
36
- href="/rules/8/implementations/1/results"
36
+ href="/implementations/1/results"
37
37
  >
38
38
  <span
39
39
  class="not-executed-color"
@@ -58,7 +58,7 @@ exports[`<ImplementationResultBar /> render overGoal implementation 1`] = `
58
58
  <a
59
59
  as="div"
60
60
  class="rule-summary pointer"
61
- href="/rules/8/implementations/1/results"
61
+ href="/implementations/1/results"
62
62
  >
63
63
  <span
64
64
  class="over-goal-color"
@@ -88,7 +88,7 @@ exports[`<ImplementationResultBar /> render underGoal implementation 1`] = `
88
88
  <a
89
89
  as="div"
90
90
  class="rule-summary pointer"
91
- href="/rules/8/implementations/1/results"
91
+ href="/implementations/1/results"
92
92
  >
93
93
  <span
94
94
  class="under-goal-color"
@@ -118,7 +118,7 @@ exports[`<ImplementationResultBar /> render underMinimum implementation 1`] = `
118
118
  <a
119
119
  as="div"
120
120
  class="rule-summary pointer"
121
- href="/rules/8/implementations/1/results"
121
+ href="/implementations/1/results"
122
122
  >
123
123
  <span
124
124
  class="under-minimum-color"
@@ -22,7 +22,7 @@ exports[`<NewRule /> matches the latest snapshot 1`] = `
22
22
  actions="manage_quality_rule"
23
23
  />
24
24
  <withRouter(injectIntl(Connect(RuleForm)))
25
- handleSubmit={[MockFunction]}
25
+ onSubmit={[MockFunction]}
26
26
  />
27
27
  </Container>
28
28
  `;
@@ -926,6 +926,9 @@ exports[`<NewRuleImplementation /> matches the latest snapshot 1`] = `
926
926
  </div>
927
927
  </div>
928
928
  </div>
929
+ <div
930
+ class="field"
931
+ />
929
932
  <div
930
933
  class="ui segment"
931
934
  >
@@ -1,18 +1,17 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`<RemediationForm /> with multiple templates matches the latest snapshot 1`] = `
3
+ exports[`<RemediationForm /> matches the latest snapshot 1`] = `
4
4
  <div>
5
5
  <form
6
6
  aria-label="remediation-form"
7
7
  class="ui form"
8
- style="display: none;"
9
8
  >
10
9
  <button
11
10
  class="ui primary disabled button"
12
11
  disabled=""
13
12
  tabindex="-1"
14
13
  >
15
- actions.create
14
+ Create
16
15
  </button>
17
16
  </form>
18
17
  </div>
@@ -27,58 +27,10 @@ exports[`<RuleCrumbs /> matches a snapshot with resultId 1`] = `
27
27
  <BreadcrumbDivider
28
28
  icon="right angle"
29
29
  />
30
- <BreadcrumbSection
31
- active={false}
32
- as={
33
- Object {
34
- "$$typeof": Symbol(react.forward_ref),
35
- "displayName": "Link",
36
- "propTypes": Object {
37
- "innerRef": [Function],
38
- "onClick": [Function],
39
- "replace": [Function],
40
- "target": [Function],
41
- "to": [Function],
42
- },
43
- "render": [Function],
44
- }
45
- }
46
- to="/rules/1"
47
- >
48
- foo
49
- </BreadcrumbSection>
50
- <BreadcrumbDivider
51
- icon="right angle"
52
- />
53
- <BreadcrumbSection
54
- active={false}
55
- as={
56
- Object {
57
- "$$typeof": Symbol(react.forward_ref),
58
- "displayName": "Link",
59
- "propTypes": Object {
60
- "innerRef": [Function],
61
- "onClick": [Function],
62
- "replace": [Function],
63
- "target": [Function],
64
- "to": [Function],
65
- },
66
- "render": [Function],
67
- }
68
- }
69
- to="/rules/1/implementations/2"
70
- >
71
- ri
72
- </BreadcrumbSection>
73
- <BreadcrumbDivider
74
- icon="right angle"
75
- />
76
30
  <BreadcrumbSection
77
31
  active={true}
78
32
  >
79
- <DateTime
80
- value="2021-10-14 11:57"
81
- />
33
+ foo
82
34
  </BreadcrumbSection>
83
35
  </Breadcrumb>
84
36
  `;
@@ -110,33 +62,10 @@ exports[`<RuleCrumbs /> matches the latest snapshot 1`] = `
110
62
  <BreadcrumbDivider
111
63
  icon="right angle"
112
64
  />
113
- <BreadcrumbSection
114
- active={false}
115
- as={
116
- Object {
117
- "$$typeof": Symbol(react.forward_ref),
118
- "displayName": "Link",
119
- "propTypes": Object {
120
- "innerRef": [Function],
121
- "onClick": [Function],
122
- "replace": [Function],
123
- "target": [Function],
124
- "to": [Function],
125
- },
126
- "render": [Function],
127
- }
128
- }
129
- to="/rules/1"
130
- >
131
- foo
132
- </BreadcrumbSection>
133
- <BreadcrumbDivider
134
- icon="right angle"
135
- />
136
65
  <BreadcrumbSection
137
66
  active={true}
138
67
  >
139
- ri
68
+ foo
140
69
  </BreadcrumbSection>
141
70
  </Breadcrumb>
142
71
  `;