@truedat/dq 4.53.8 → 4.53.10

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 (43) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/package.json +6 -6
  3. package/src/api/queries.js +76 -16
  4. package/src/components/ExecutionGroups.js +4 -50
  5. package/src/components/ImplementationExecutionFilters.js +79 -0
  6. package/src/components/ImplementationExecutions.js +125 -0
  7. package/src/components/ImplementationsRoutes.js +18 -1
  8. package/src/components/RuleImplementationHistory.js +5 -8
  9. package/src/components/RuleImplementationHistoryRow.js +23 -28
  10. package/src/components/RuleImplementationResultTabs.js +2 -2
  11. package/src/components/RuleImplementationResults.js +24 -149
  12. package/src/components/RuleImplementationSelectedFilters.js +2 -1
  13. package/src/components/RuleImplementationTabs.js +14 -8
  14. package/src/components/RuleResultDecorator.js +10 -9
  15. package/src/components/RuleResultRow.js +9 -15
  16. package/src/components/RuleResultsRoutes.js +2 -2
  17. package/src/components/RuleResultsTable.js +117 -0
  18. package/src/components/__tests__/ImplementationExecutionFilters.spec.js +24 -0
  19. package/src/components/__tests__/ImplementationExecutions.spec.js +32 -0
  20. package/src/components/__tests__/RuleImplementationResults.spec.js +16 -45
  21. package/src/components/__tests__/RuleImplementationTabs.spec.js +1 -18
  22. package/src/components/__tests__/RuleResultDecorator.spec.js +12 -32
  23. package/src/components/__tests__/RuleResultDetails.spec.js +3 -3
  24. package/src/components/__tests__/RuleResultRemediations.spec.js +3 -3
  25. package/src/components/__tests__/RuleResultRoutes.spec.js +5 -5
  26. package/src/components/__tests__/RuleResultRow.spec.js +86 -82
  27. package/src/components/__tests__/RuleResultSegmentRow.spec.js +6 -6
  28. package/src/components/__tests__/RuleResultSegments.spec.js +1 -1
  29. package/src/components/__tests__/__fixtures__/executionMocks.js +80 -0
  30. package/src/components/__tests__/__snapshots__/ExecutionGroups.spec.js.snap +0 -1
  31. package/src/components/__tests__/__snapshots__/ImplementationExecutionFilters.spec.js.snap +37 -0
  32. package/src/components/__tests__/__snapshots__/ImplementationExecutions.spec.js.snap +194 -0
  33. package/src/components/__tests__/__snapshots__/RuleImplementation.spec.js.snap +6 -0
  34. package/src/components/__tests__/__snapshots__/RuleImplementationHistory.spec.js.snap +12 -24
  35. package/src/components/__tests__/__snapshots__/RuleImplementationResults.spec.js.snap +8 -8
  36. package/src/components/__tests__/__snapshots__/RuleImplementationTabs.spec.js.snap +12 -6
  37. package/src/components/__tests__/__snapshots__/RuleResultDecorator.spec.js.snap +4 -4
  38. package/src/functions/selectors.js +12 -4
  39. package/src/messages/en.js +6 -0
  40. package/src/messages/es.js +6 -0
  41. package/src/selectors/getRuleImplementationColumns.js +4 -2
  42. package/src/selectors/index.js +1 -1
  43. package/src/selectors/{getRuleResultsColumns.js → ruleResultsColumnsSelector.js} +1 -1
@@ -0,0 +1,80 @@
1
+ import {
2
+ IMPLEMENTATION_EXECUTIONS_QUERY,
3
+ IMPLEMENTATION_EXECUTION_FILTERS_QUERY,
4
+ } from "../../../api/queries";
5
+
6
+ const executionFilters = [
7
+ {
8
+ field: "status",
9
+ values: ["FAILED", "PENDING", "SUCCEEDED"],
10
+ },
11
+ ];
12
+
13
+ export const implementationExecutionFiltersMock = (variables) => ({
14
+ request: {
15
+ query: IMPLEMENTATION_EXECUTION_FILTERS_QUERY,
16
+ variables,
17
+ },
18
+ result: {
19
+ data: {
20
+ implementation: {
21
+ id: "123",
22
+ executionFilters,
23
+ },
24
+ },
25
+ },
26
+ });
27
+
28
+ export const implementationExecutionsMock = (variables) => ({
29
+ request: {
30
+ query: IMPLEMENTATION_EXECUTIONS_QUERY,
31
+ variables,
32
+ },
33
+ result: {
34
+ data: {
35
+ implementation: {
36
+ id: "123",
37
+ executionFilters,
38
+ executionsConnection: {
39
+ totalCount: 100,
40
+ page: [
41
+ {
42
+ id: "444",
43
+ insertedAt: "2020-01-01T12:34:56.000Z",
44
+ implementation: {
45
+ id: "123",
46
+ version: 2,
47
+ },
48
+ latestEvent: {
49
+ id: "10001",
50
+ insertedAt: "2020-01-01T12:34:56.000Z",
51
+ type: "STARTED",
52
+ message: null,
53
+ },
54
+ },
55
+ {
56
+ id: "445",
57
+ insertedAt: "2020-01-01T12:34:56.000Z",
58
+ implementation: {
59
+ id: "123",
60
+ version: 2,
61
+ },
62
+ latestEvent: {
63
+ id: "10002",
64
+ insertedAt: "2020-01-01T12:34:56.000Z",
65
+ type: "SUCCEEDED",
66
+ message: "Execution succeeded",
67
+ },
68
+ },
69
+ ],
70
+ pageInfo: {
71
+ endCursor: null,
72
+ startCursor: "FOO",
73
+ hasNextPage: false,
74
+ hasPreviousPage: true,
75
+ },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ });
@@ -17,7 +17,6 @@ exports[`<ExecutionGroups /> matches the latest snapshot with a row per executio
17
17
  <div
18
18
  aria-label="Latest"
19
19
  class="disabled item"
20
- to="[object Object]"
21
20
  >
22
21
  «
23
22
  </div>
@@ -0,0 +1,37 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ImplementationExecutionFilters /> matches snapshot with filter links 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui compact pointing secondary menu"
7
+ >
8
+ <a
9
+ class="active link item"
10
+ href="/"
11
+ >
12
+ All
13
+ </a>
14
+ <a
15
+ class="link item"
16
+ href="/?status=FAILED"
17
+ value="FAILED"
18
+ >
19
+ Failed
20
+ </a>
21
+ <a
22
+ class="link item"
23
+ href="/?status=PENDING"
24
+ value="PENDING"
25
+ >
26
+ Pending
27
+ </a>
28
+ <a
29
+ class="link item"
30
+ href="/?status=SUCCEEDED"
31
+ value="SUCCEEDED"
32
+ >
33
+ Succeeded
34
+ </a>
35
+ </div>
36
+ </div>
37
+ `;
@@ -0,0 +1,194 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ImplementationExecutions /> matches snapshot with executions table 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui bottom attached segment"
7
+ >
8
+ <div
9
+ class="ui grid"
10
+ >
11
+ <div
12
+ class="two column row"
13
+ >
14
+ <div
15
+ class="column"
16
+ >
17
+ <div
18
+ class="ui compact pointing secondary menu"
19
+ >
20
+ <a
21
+ class="active link item"
22
+ href="/"
23
+ >
24
+ All
25
+ </a>
26
+ <a
27
+ class="link item"
28
+ href="/?status=FAILED"
29
+ value="FAILED"
30
+ >
31
+ Failed
32
+ </a>
33
+ <a
34
+ class="link item"
35
+ href="/?status=PENDING"
36
+ value="PENDING"
37
+ >
38
+ Pending
39
+ </a>
40
+ <a
41
+ class="link item"
42
+ href="/?status=SUCCEEDED"
43
+ value="SUCCEEDED"
44
+ >
45
+ Succeeded
46
+ </a>
47
+ </div>
48
+ </div>
49
+ <div
50
+ class="right aligned column"
51
+ >
52
+ <div
53
+ class="ui pagination menu"
54
+ role="navigation"
55
+ >
56
+ <div
57
+ aria-label="Latest"
58
+ class="disabled item"
59
+ >
60
+ «
61
+ </div>
62
+ <div
63
+ aria-label="Later"
64
+ class="disabled item"
65
+ >
66
+
67
+ </div>
68
+ <a
69
+ aria-label="Earlier"
70
+ class="link item"
71
+ href="/?before=FOO"
72
+ >
73
+
74
+ </a>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ <table
80
+ class="ui very basic table"
81
+ >
82
+ <thead
83
+ class=""
84
+ >
85
+ <tr
86
+ class=""
87
+ >
88
+ <th
89
+ class="right aligned one wide"
90
+ >
91
+ Version
92
+ </th>
93
+ <th
94
+ class="two wide"
95
+ >
96
+ Execution
97
+ </th>
98
+ <th
99
+ class="two wide"
100
+ >
101
+ Latest event
102
+ </th>
103
+ <th
104
+ class="two wide"
105
+ >
106
+ Event type
107
+ </th>
108
+ <th
109
+ class=""
110
+ >
111
+ Message
112
+ </th>
113
+ </tr>
114
+ </thead>
115
+ <tbody
116
+ class=""
117
+ >
118
+ <tr
119
+ class="warning"
120
+ >
121
+ <td
122
+ class="right aligned one wide"
123
+ >
124
+ 2
125
+ </td>
126
+ <td
127
+ class="two wide"
128
+ >
129
+ <time
130
+ datetime="1577882096000"
131
+ >
132
+ 2020-01-01 12:34
133
+ </time>
134
+ </td>
135
+ <td
136
+ class="two wide"
137
+ >
138
+ <time
139
+ datetime="1577882096000"
140
+ >
141
+ 2020-01-01 12:34
142
+ </time>
143
+ </td>
144
+ <td
145
+ class="two wide"
146
+ >
147
+ Started
148
+ </td>
149
+ <td
150
+ class=""
151
+ />
152
+ </tr>
153
+ <tr
154
+ class="positive"
155
+ >
156
+ <td
157
+ class="right aligned one wide"
158
+ >
159
+ 2
160
+ </td>
161
+ <td
162
+ class="two wide"
163
+ >
164
+ <time
165
+ datetime="1577882096000"
166
+ >
167
+ 2020-01-01 12:34
168
+ </time>
169
+ </td>
170
+ <td
171
+ class="two wide"
172
+ >
173
+ <time
174
+ datetime="1577882096000"
175
+ >
176
+ 2020-01-01 12:34
177
+ </time>
178
+ </td>
179
+ <td
180
+ class="two wide"
181
+ >
182
+ Succeeded
183
+ </td>
184
+ <td
185
+ class=""
186
+ >
187
+ Execution succeeded
188
+ </td>
189
+ </tr>
190
+ </tbody>
191
+ </table>
192
+ </div>
193
+ </div>
194
+ `;
@@ -148,6 +148,12 @@ exports[`<RuleImplementation /> matches the latest snapshot 1`] = `
148
148
  >
149
149
  Results
150
150
  </a>
151
+ <a
152
+ class="item"
153
+ href="/implementations/1/executions"
154
+ >
155
+ Executions
156
+ </a>
151
157
  <a
152
158
  class="item"
153
159
  href="/implementations/1/history"
@@ -54,7 +54,9 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
54
54
  <td
55
55
  class=""
56
56
  >
57
- some implementation key 34
57
+ <a
58
+ href="/implementations/34/history"
59
+ />
58
60
  </td>
59
61
  <td
60
62
  class=""
@@ -68,13 +70,7 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
68
70
  </td>
69
71
  <td
70
72
  class=""
71
- >
72
- <time
73
- datetime="1644506527000"
74
- >
75
- 2022-02-10 15:22
76
- </time>
77
- </td>
73
+ />
78
74
  </tr>
79
75
  <tr
80
76
  class="active"
@@ -82,7 +78,9 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
82
78
  <td
83
79
  class=""
84
80
  >
85
- some implementation key 23
81
+ <a
82
+ href="/implementations/23/history"
83
+ />
86
84
  </td>
87
85
  <td
88
86
  class=""
@@ -96,13 +94,7 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
96
94
  </td>
97
95
  <td
98
96
  class=""
99
- >
100
- <time
101
- datetime="1644506527000"
102
- >
103
- 2022-02-10 15:22
104
- </time>
105
- </td>
97
+ />
106
98
  </tr>
107
99
  <tr
108
100
  class=""
@@ -110,7 +102,9 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
110
102
  <td
111
103
  class=""
112
104
  >
113
- some implementation key 22
105
+ <a
106
+ href="/implementations/22/history"
107
+ />
114
108
  </td>
115
109
  <td
116
110
  class=""
@@ -124,13 +118,7 @@ exports[`<RuleImplementationHistory matches the latest snapshot 1`] = `
124
118
  </td>
125
119
  <td
126
120
  class=""
127
- >
128
- <time
129
- datetime="1644506527000"
130
- >
131
- 2022-02-10 15:22
132
- </time>
133
- </td>
121
+ />
134
122
  </tr>
135
123
  </tbody>
136
124
  </table>
@@ -14,22 +14,22 @@ exports[`<RuleImplementationResults /> matches the latest snapshot 1`] = `
14
14
  <th
15
15
  class=""
16
16
  >
17
- ruleResult.props.date
17
+ Date
18
18
  </th>
19
19
  <th
20
20
  class=""
21
21
  >
22
- ruleResult.props.quality
22
+ Quality
23
23
  </th>
24
24
  <th
25
25
  class=""
26
26
  >
27
- ruleResult.props.records
27
+ Records
28
28
  </th>
29
29
  <th
30
30
  class=""
31
31
  >
32
- ruleResult.props.errors
32
+ Errors
33
33
  </th>
34
34
  <th
35
35
  class=""
@@ -44,12 +44,12 @@ exports[`<RuleImplementationResults /> matches the latest snapshot 1`] = `
44
44
  >
45
45
  <td
46
46
  class=""
47
- colspan="8"
48
47
  >
49
48
  <a
50
49
  class="ui active ribbon label"
50
+ href="/implementations/1"
51
51
  >
52
- ruleImplementations.props.version: undefined
52
+ Version: undefined
53
53
  </a>
54
54
  </td>
55
55
  </tr>
@@ -128,12 +128,12 @@ exports[`<RuleImplementationResults /> matches the latest snapshot 1`] = `
128
128
  >
129
129
  <td
130
130
  class=""
131
- colspan="8"
132
131
  >
133
132
  <a
134
133
  class="ui ribbon label"
134
+ href="/implementations/2"
135
135
  >
136
- ruleImplementations.props.version: undefined
136
+ Version: undefined
137
137
  </a>
138
138
  </td>
139
139
  </tr>
@@ -9,37 +9,43 @@ exports[`<RuleImplementationTabs /> matches the latest snapshot 1`] = `
9
9
  class="item"
10
10
  href="/implementations/1"
11
11
  >
12
- ruleImplementation
12
+ Implementation
13
13
  </a>
14
14
  <a
15
15
  class="item"
16
16
  href="/implementations/1/links/concepts"
17
17
  >
18
- concepts
18
+ Link to concepts
19
19
  </a>
20
20
  <a
21
21
  class="item"
22
22
  href="/implementations/1/structures"
23
23
  >
24
- structures
24
+ Structures
25
25
  </a>
26
26
  <a
27
27
  class="item"
28
28
  href="/implementations/1/results"
29
29
  >
30
- results
30
+ Results
31
+ </a>
32
+ <a
33
+ class="item"
34
+ href="/implementations/1/executions"
35
+ >
36
+ Executions
31
37
  </a>
32
38
  <a
33
39
  class="item"
34
40
  href="/implementations/1/history"
35
41
  >
36
- history
42
+ History
37
43
  </a>
38
44
  <a
39
45
  class="item"
40
46
  href="/implementations/1/events"
41
47
  >
42
- audit
48
+ Audit
43
49
  </a>
44
50
  </div>
45
51
  </div>
@@ -5,7 +5,7 @@ exports[`<RuleResultDecorator /> decorates a percentage result 1`] = `
5
5
  <i
6
6
  aria-hidden="true"
7
7
  class="green circle icon"
8
- title="result_message"
8
+ title="Something happened"
9
9
  />
10
10
  42%
11
11
  </div>
@@ -16,7 +16,7 @@ exports[`<RuleResultDecorator /> decorates an error count result 1`] = `
16
16
  <i
17
17
  aria-hidden="true"
18
18
  class="green circle icon"
19
- title="result_message"
19
+ title="Something happened"
20
20
  />
21
21
  1,234 errors
22
22
  </div>
@@ -27,8 +27,8 @@ exports[`<RuleResultDecorator /> decorates an implementation without result data
27
27
  <i
28
28
  aria-hidden="true"
29
29
  class="grey circle icon"
30
- title="no_data_message"
30
+ title="no_data"
31
31
  />
32
- No data
32
+ No information about quality
33
33
  </div>
34
34
  `;
@@ -1,8 +1,16 @@
1
1
  import _ from "lodash/fp";
2
2
 
3
- export const selectColor = ({ errors, result, minimum, goal, result_type }) => {
3
+ export const selectColor = ({
4
+ errors,
5
+ result,
6
+ minimum,
7
+ goal,
8
+ result_type,
9
+ resultType,
10
+ }) => {
11
+ const type = _.defaultTo(result_type)(resultType);
4
12
  if (_.isNil(errors) && _.isNil(result)) return "grey";
5
- else if (result_type == "percentage") {
13
+ else if (type == "percentage") {
6
14
  if (result < minimum) {
7
15
  return "red";
8
16
  } else if (result < goal) {
@@ -10,7 +18,7 @@ export const selectColor = ({ errors, result, minimum, goal, result_type }) => {
10
18
  } else {
11
19
  return "green";
12
20
  }
13
- } else if (result_type == "errors_number") {
21
+ } else if (type == "errors_number") {
14
22
  if (errors > minimum) {
15
23
  return "red";
16
24
  } else if (errors > goal) {
@@ -18,7 +26,7 @@ export const selectColor = ({ errors, result, minimum, goal, result_type }) => {
18
26
  } else {
19
27
  return "green";
20
28
  }
21
- } else if (result_type == "deviation") {
29
+ } else if (type == "deviation") {
22
30
  if (result > minimum) {
23
31
  return "red";
24
32
  } else if (result > goal) {
@@ -28,6 +28,11 @@ export default {
28
28
  "dataset.form.button.add_structure": "Add Structure",
29
29
  "datasetForm.implementation_key.tooltip":
30
30
  "Leave empty for autogeneration of implementation key after saving implementation",
31
+ "execution": "Execution",
32
+ "execution.insertedAt": "Created",
33
+ "execution.latestEvent.insertedAt": "Latest event",
34
+ "execution.latestEvent.message": "Message",
35
+ "execution.latestEvent.type": "Event type",
31
36
  "executionGroup.failedCount": "Failed",
32
37
  "executionGroup.insertedAt": "Created",
33
38
  "executionGroup.pendingCount": "Pending",
@@ -623,6 +628,7 @@ export default {
623
628
  "tabs.dq.ruleImplementation": "Implementation",
624
629
  "tabs.dq.ruleImplementation.audit": "Audit",
625
630
  "tabs.dq.ruleImplementation.details": "Details",
631
+ "tabs.dq.ruleImplementation.executions": "Executions",
626
632
  "tabs.dq.ruleImplementation.history": "History",
627
633
  "tabs.dq.ruleImplementation.results": "Results",
628
634
  "tabs.dq.ruleImplementationResult.info": "Information",
@@ -28,6 +28,11 @@ export default {
28
28
  "dataset.form.button.add_structure": "Añadir Estructura",
29
29
  "datasetForm.implementation_key.tooltip":
30
30
  "En caso de no introducir clave de implementación, se autogenerará al guardar la implementación",
31
+ "execution": "Ejecución",
32
+ "execution.insertedAt": "Creado",
33
+ "execution.latestEvent.insertedAt": "Evento más reciente",
34
+ "execution.latestEvent.message": "Detalle",
35
+ "execution.latestEvent.type": "Tipo de evento",
31
36
  "executionGroup.failedCount": "Error",
32
37
  "executionGroup.insertedAt": "Creado",
33
38
  "executionGroup.pendingCount": "Pendiente",
@@ -645,6 +650,7 @@ export default {
645
650
  "tabs.dq.ruleImplementation": "Implementación",
646
651
  "tabs.dq.ruleImplementation.audit": "Auditoría",
647
652
  "tabs.dq.ruleImplementation.details": "Detalles",
653
+ "tabs.dq.ruleImplementation.executions": "Ejecuciones",
648
654
  "tabs.dq.ruleImplementation.history": "Historial",
649
655
  "tabs.dq.ruleImplementation.results": "Resultados",
650
656
  "tabs.dq.ruleImplementationResult.info": "Información",
@@ -11,8 +11,10 @@ import RuleLink from "../components/RuleLink";
11
11
  const translateDecorator = (id) =>
12
12
  id ? <FormattedMessage id={id} defaultMessage={id} /> : null;
13
13
 
14
- const resultTypeDecorator = (result, result_type) =>
15
- result_type === "errors_number" ? formatNumber(result) : `${result}%`;
14
+ const resultTypeDecorator = (result, result_type, resultType) =>
15
+ _.defaultTo(result_type)(resultType) === "errors_number"
16
+ ? formatNumber(result)
17
+ : `${result}%`;
16
18
 
17
19
  export const defaultImplementationColumns = [
18
20
  {
@@ -4,7 +4,7 @@ export { getRuleAvailableFilters } from "./getRuleAvailableFilters";
4
4
  export { getRuleSelectedFilters } from "./getRuleSelectedFilters";
5
5
  export { getRuleSelectedFilterActiveValues } from "./getRuleSelectedFilterActiveValues";
6
6
  export { getRuleSelectedFilterValues } from "./getRuleSelectedFilterValues";
7
- export { getRuleResultsColumns } from "./getRuleResultsColumns";
7
+ export { ruleResultsColumnsSelector } from "./ruleResultsColumnsSelector";
8
8
  export {
9
9
  getSystemInRuleDetail,
10
10
  getGroupsInRuleDetail,
@@ -3,7 +3,7 @@ import { createSelector } from "reselect";
3
3
 
4
4
  export const defaultRuleResultsColumns = [];
5
5
 
6
- export const getRuleResultsColumns = createSelector(
6
+ export const ruleResultsColumnsSelector = createSelector(
7
7
  _.prop("ruleResultsColumns"),
8
8
  _.defaultTo(defaultRuleResultsColumns)
9
9
  );