@truedat/dq 4.50.4 → 4.51.0

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 (31) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/package.json +4 -4
  3. package/src/api/queries.js +33 -0
  4. package/src/components/ExecutionGroup.js +28 -22
  5. package/src/components/ExecutionGroupBreadcrumbs.js +25 -0
  6. package/src/components/ExecutionGroupContent.js +42 -0
  7. package/src/components/ExecutionGroupLink.js +18 -0
  8. package/src/components/ExecutionGroupLoader.js +1 -2
  9. package/src/components/ExecutionGroupMessage.js +1 -1
  10. package/src/components/ExecutionGroups.js +80 -0
  11. package/src/components/ExecutionGroupsTable.js +61 -0
  12. package/src/components/QualityRoutes.js +20 -12
  13. package/src/components/__tests__/ExecutionGroup.spec.js +44 -47
  14. package/src/components/__tests__/ExecutionGroupBreadcrumbs.spec.js +11 -0
  15. package/src/components/__tests__/ExecutionGroupContent.spec.js +30 -0
  16. package/src/components/__tests__/ExecutionGroupLink.spec.js +11 -0
  17. package/src/components/__tests__/ExecutionGroups.spec.js +51 -0
  18. package/src/components/__tests__/ExecutionGroupsTable.spec.js +30 -0
  19. package/src/components/__tests__/__snapshots__/ExecutionGroup.spec.js.snap +136 -100
  20. package/src/components/__tests__/__snapshots__/ExecutionGroupBreadcrumbs.spec.js.snap +29 -0
  21. package/src/components/__tests__/__snapshots__/ExecutionGroupContent.spec.js.snap +37 -0
  22. package/src/components/__tests__/__snapshots__/ExecutionGroupLink.spec.js.snap +15 -0
  23. package/src/components/__tests__/__snapshots__/ExecutionGroups.spec.js.snap +155 -0
  24. package/src/components/__tests__/__snapshots__/ExecutionGroupsTable.spec.js.snap +84 -0
  25. package/src/messages/en.js +106 -96
  26. package/src/messages/es.js +178 -168
  27. package/src/reducers/executionGroup.js +7 -1
  28. package/src/reducers/executionGroupLoading.js +9 -1
  29. package/src/selectors/__tests__/executionGroupsColumnsSelector.spec.js +19 -0
  30. package/src/selectors/executionGroupsColumnsSelector.js +41 -0
  31. package/src/selectors/index.js +1 -0
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import { waitFor } from "@testing-library/react";
3
+ import { render } from "@truedat/test/render";
4
+ import { MY_EXECUTION_GROUPS_QUERY } from "../../api/queries";
5
+ import ExecutionGroups from "../ExecutionGroups";
6
+
7
+ const group = {
8
+ id: "123",
9
+ insertedAt: "2022-02-02T12:22:25Z",
10
+ statusCounts: {
11
+ PENDING: 1,
12
+ STARTED: 2,
13
+ SUCCEEDED: 3,
14
+ FAILED: 4,
15
+ },
16
+ dfContent: null,
17
+ };
18
+
19
+ const executionGroupsConnection = {
20
+ totalCount: 123,
21
+ pageInfo: {
22
+ endCursor: null,
23
+ hasNextPage: null,
24
+ hasPreviousPage: true,
25
+ startCursor: "xyz",
26
+ },
27
+ page: [group, group],
28
+ };
29
+
30
+ const executionGroupsMock = {
31
+ request: { query: MY_EXECUTION_GROUPS_QUERY, variables: { last: 20 } },
32
+ result: { data: { me: { id: "123", executionGroupsConnection } } },
33
+ };
34
+
35
+ const renderOpts = {
36
+ state: {},
37
+ mocks: [executionGroupsMock],
38
+ };
39
+
40
+ describe("<ExecutionGroups />", () => {
41
+ it("matches the latest snapshot with a row per execution group", async () => {
42
+ const { container, queryByText, queryAllByRole } = render(
43
+ <ExecutionGroups />,
44
+ renderOpts
45
+ );
46
+ await waitFor(() => expect(queryByText(/pending/i)).toBeInTheDocument());
47
+
48
+ expect(container).toMatchSnapshot();
49
+ expect(queryAllByRole("row")).toHaveLength(3); // 2 rows + header
50
+ });
51
+ });
@@ -0,0 +1,30 @@
1
+ import React from "react";
2
+ import { render } from "@truedat/test/render";
3
+ import ExecutionGroupsTable from "../ExecutionGroupsTable";
4
+
5
+ const renderOpts = {
6
+ state: {},
7
+ };
8
+
9
+ const executionGroup = {
10
+ id: "123",
11
+ insertedAt: "2022-02-02T12:22:25Z",
12
+ statusCounts: {
13
+ PENDING: 1,
14
+ STARTED: 2,
15
+ SUCCEEDED: 3,
16
+ FAILED: 4,
17
+ },
18
+ };
19
+
20
+ describe("<ExecutionGroupsTable />", () => {
21
+ const props = { page: [executionGroup] };
22
+
23
+ it("matches the latest snapshot", () => {
24
+ const { container } = render(
25
+ <ExecutionGroupsTable {...props} />,
26
+ renderOpts
27
+ );
28
+ expect(container).toMatchSnapshot();
29
+ });
30
+ });
@@ -1,108 +1,144 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<ExecutionGroup /> matches the latest snapshot 1`] = `
4
- <Fragment>
5
- <ExecutionGroupMessage
6
- count={1}
7
- error={1}
8
- pending={-1}
9
- />
10
- <Table
11
- as="table"
4
+ <div>
5
+ <div
6
+ class="ui breadcrumb"
12
7
  >
13
- <TableHeader
14
- as="thead"
8
+ <a
9
+ class="section"
10
+ href="/executionGroups"
15
11
  >
16
- <TableRow
17
- as="tr"
18
- cellAs="td"
12
+ My Executions
13
+ </a>
14
+ <i
15
+ aria-hidden="true"
16
+ class="right angle icon divider"
17
+ />
18
+ <div
19
+ class="active section"
20
+ />
21
+ </div>
22
+ <div
23
+ class="ui message"
24
+ >
25
+ <div
26
+ class="content"
27
+ >
28
+ <div
29
+ class="header"
30
+ >
31
+ Executions scheduled
32
+ </div>
33
+ <p>
34
+ There are 1 executions pending, please check again later.
35
+ </p>
36
+ </div>
37
+ </div>
38
+ <table
39
+ class="ui table"
40
+ >
41
+ <thead
42
+ class=""
43
+ >
44
+ <tr
45
+ class=""
19
46
  >
20
- <TableHeaderCell
21
- as="th"
22
- content="ruleImplementations.props.status"
23
- key="ruleImplementations.props.status"
24
- />
25
- <TableHeaderCell
26
- as="th"
27
- content="ruleImplementations.props.implementation_key"
28
- key="ruleImplementations.props.implementation_key"
29
- />
30
- <TableHeaderCell
31
- as="th"
32
- content="rule.props.name"
33
- key="rule.props.name"
34
- />
35
- <TableHeaderCell
36
- as="th"
37
- content="ruleResult.props.date"
38
- key="ruleResult.props.date"
39
- textAlign="center"
40
- />
41
- <TableHeaderCell
42
- as="th"
43
- content="ruleResult.props.records"
44
- key="ruleResult.props.records"
45
- textAlign="right"
46
- />
47
- <TableHeaderCell
48
- as="th"
49
- content="ruleResult.props.errors"
50
- key="ruleResult.props.errors"
51
- textAlign="right"
52
- />
53
- <TableHeaderCell
54
- as="th"
55
- content="ruleResult.props.quality"
56
- key="ruleResult.props.quality"
57
- />
58
- </TableRow>
59
- </TableHeader>
60
- <TableBody
61
- as="tbody"
47
+ <th
48
+ class=""
49
+ >
50
+ Status
51
+ </th>
52
+ <th
53
+ class=""
54
+ >
55
+ Identifier
56
+ </th>
57
+ <th
58
+ class=""
59
+ >
60
+ Name
61
+ </th>
62
+ <th
63
+ class="center aligned"
64
+ >
65
+ Date
66
+ </th>
67
+ <th
68
+ class="right aligned"
69
+ >
70
+ Records
71
+ </th>
72
+ <th
73
+ class="right aligned"
74
+ >
75
+ Errors
76
+ </th>
77
+ <th
78
+ class=""
79
+ >
80
+ Quality
81
+ </th>
82
+ </tr>
83
+ </thead>
84
+ <tbody
85
+ class=""
62
86
  >
63
- <ExecutionRow
64
- execution={
65
- Object {
66
- "_embedded": Object {
67
- "implementation": Object {
68
- "goal": 20,
69
- "id": 1,
70
- "implementation_key": "foo",
71
- "minimum": 10,
72
- "result_type": "percentage",
73
- "rule_id": 1,
74
- },
75
- "quality_events": Array [
76
- Object {
77
- "execution_id": 1,
78
- "id": 1,
79
- "inserted_at": "2020-01-01 00:00:00Z",
80
- "message": "",
81
- "type": "SUCCESS",
82
- },
83
- ],
84
- "result": Object {
85
- "date": "2020-01-01 00:00:00Z",
86
- "errors": 30,
87
- "goal": 20,
88
- "id": 1,
89
- "implementation_key": "foo",
90
- "minimum": 10,
91
- "records": 100,
92
- "result": 30,
93
- "result_type": "percentage",
94
- },
95
- "rule": Object {
96
- "id": 1,
97
- "name": "rule_name",
98
- },
99
- },
100
- "id": 1,
101
- }
102
- }
103
- key="0"
104
- />
105
- </TableBody>
106
- </Table>
107
- </Fragment>
87
+ <tr
88
+ class=""
89
+ >
90
+ <td
91
+ class=""
92
+ >
93
+ <i
94
+ aria-hidden="true"
95
+ class="question circle outline large icon"
96
+ />
97
+ </td>
98
+ <td
99
+ class=""
100
+ >
101
+ <a
102
+ href="/implementations/1/results"
103
+ >
104
+ foo
105
+ </a>
106
+ </td>
107
+ <td
108
+ class=""
109
+ >
110
+ rule_name
111
+ </td>
112
+ <td
113
+ class="center aligned"
114
+ >
115
+ <time
116
+ datetime="1577836800000"
117
+ >
118
+ 2020-01-01 00:00
119
+ </time>
120
+ </td>
121
+ <td
122
+ class="right aligned"
123
+ >
124
+ 100
125
+ </td>
126
+ <td
127
+ class="right aligned"
128
+ >
129
+ 30
130
+ </td>
131
+ <td
132
+ class=""
133
+ >
134
+ <i
135
+ aria-hidden="true"
136
+ class="green circle icon"
137
+ />
138
+ 30%
139
+ </td>
140
+ </tr>
141
+ </tbody>
142
+ </table>
143
+ </div>
108
144
  `;
@@ -0,0 +1,29 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ExecutionGroupBreadcrumbs /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui breadcrumb"
7
+ >
8
+ <a
9
+ class="section"
10
+ href="/executionGroups"
11
+ >
12
+ My Executions
13
+ </a>
14
+ <i
15
+ aria-hidden="true"
16
+ class="right angle icon divider"
17
+ />
18
+ <div
19
+ class="active section"
20
+ >
21
+ <time
22
+ datetime="1643805296789"
23
+ >
24
+ 2022-02-02 12:34
25
+ </time>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ `;
@@ -0,0 +1,37 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ExecutionGroupContent /> matches the latest snapshot and renders dynamic content 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui horizontal divider"
7
+ >
8
+ <h3>
9
+ g1
10
+ </h3>
11
+ </div>
12
+ <div
13
+ class="ui big very relaxed list"
14
+ role="list"
15
+ >
16
+ <div
17
+ class="item"
18
+ role="listitem"
19
+ >
20
+ <div
21
+ class="header dynamic-field-header"
22
+ >
23
+ field1
24
+ </div>
25
+ <div
26
+ class="description"
27
+ >
28
+ <div
29
+ class="default-value"
30
+ >
31
+ foo
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ `;
@@ -0,0 +1,15 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ExecutionGroupLink /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <a
6
+ href="/executionGroups/123"
7
+ >
8
+ <time
9
+ datetime="1643805296789"
10
+ >
11
+ 2022-02-02 12:34
12
+ </time>
13
+ </a>
14
+ </div>
15
+ `;
@@ -0,0 +1,155 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ExecutionGroups /> matches the latest snapshot with a row per execution group 1`] = `
4
+ <div>
5
+ <div
6
+ class="ui segment"
7
+ >
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ My Executions
12
+ </h2>
13
+ <div
14
+ class="ui pagination menu"
15
+ role="navigation"
16
+ >
17
+ <div
18
+ aria-label="Latest"
19
+ class="disabled item"
20
+ to="[object Object]"
21
+ >
22
+ «
23
+ </div>
24
+ <div
25
+ aria-label="Later"
26
+ class="disabled item"
27
+ >
28
+
29
+ </div>
30
+ <a
31
+ aria-label="Earlier"
32
+ class="link item"
33
+ href="/?before=xyz"
34
+ >
35
+
36
+ </a>
37
+ </div>
38
+ <table
39
+ class="ui table"
40
+ >
41
+ <thead
42
+ class=""
43
+ >
44
+ <tr
45
+ class=""
46
+ >
47
+ <th
48
+ class=""
49
+ >
50
+ Created
51
+ </th>
52
+ <th
53
+ class="right aligned"
54
+ >
55
+ Pending
56
+ </th>
57
+ <th
58
+ class="right aligned"
59
+ >
60
+ Started
61
+ </th>
62
+ <th
63
+ class="right aligned"
64
+ >
65
+ Succeeded
66
+ </th>
67
+ <th
68
+ class="right aligned"
69
+ >
70
+ Failed
71
+ </th>
72
+ </tr>
73
+ </thead>
74
+ <tbody
75
+ class=""
76
+ >
77
+ <tr
78
+ class=""
79
+ >
80
+ <td
81
+ class=""
82
+ >
83
+ <a
84
+ href="/executionGroups/123"
85
+ >
86
+ <time
87
+ datetime="1643804545000"
88
+ >
89
+ 2022-02-02 12:22
90
+ </time>
91
+ </a>
92
+ </td>
93
+ <td
94
+ class="right aligned"
95
+ >
96
+ 1
97
+ </td>
98
+ <td
99
+ class="right aligned"
100
+ >
101
+ 2
102
+ </td>
103
+ <td
104
+ class="right aligned"
105
+ >
106
+ 3
107
+ </td>
108
+ <td
109
+ class="right aligned"
110
+ >
111
+ 4
112
+ </td>
113
+ </tr>
114
+ <tr
115
+ class=""
116
+ >
117
+ <td
118
+ class=""
119
+ >
120
+ <a
121
+ href="/executionGroups/123"
122
+ >
123
+ <time
124
+ datetime="1643804545000"
125
+ >
126
+ 2022-02-02 12:22
127
+ </time>
128
+ </a>
129
+ </td>
130
+ <td
131
+ class="right aligned"
132
+ >
133
+ 1
134
+ </td>
135
+ <td
136
+ class="right aligned"
137
+ >
138
+ 2
139
+ </td>
140
+ <td
141
+ class="right aligned"
142
+ >
143
+ 3
144
+ </td>
145
+ <td
146
+ class="right aligned"
147
+ >
148
+ 4
149
+ </td>
150
+ </tr>
151
+ </tbody>
152
+ </table>
153
+ </div>
154
+ </div>
155
+ `;
@@ -0,0 +1,84 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<ExecutionGroupsTable /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <table
6
+ class="ui table"
7
+ >
8
+ <thead
9
+ class=""
10
+ >
11
+ <tr
12
+ class=""
13
+ >
14
+ <th
15
+ class=""
16
+ >
17
+ Created
18
+ </th>
19
+ <th
20
+ class="right aligned"
21
+ >
22
+ Pending
23
+ </th>
24
+ <th
25
+ class="right aligned"
26
+ >
27
+ Started
28
+ </th>
29
+ <th
30
+ class="right aligned"
31
+ >
32
+ Succeeded
33
+ </th>
34
+ <th
35
+ class="right aligned"
36
+ >
37
+ Failed
38
+ </th>
39
+ </tr>
40
+ </thead>
41
+ <tbody
42
+ class=""
43
+ >
44
+ <tr
45
+ class=""
46
+ >
47
+ <td
48
+ class=""
49
+ >
50
+ <a
51
+ href="/executionGroups/123"
52
+ >
53
+ <time
54
+ datetime="1643804545000"
55
+ >
56
+ 2022-02-02 12:22
57
+ </time>
58
+ </a>
59
+ </td>
60
+ <td
61
+ class="right aligned"
62
+ >
63
+ 1
64
+ </td>
65
+ <td
66
+ class="right aligned"
67
+ >
68
+ 2
69
+ </td>
70
+ <td
71
+ class="right aligned"
72
+ >
73
+ 3
74
+ </td>
75
+ <td
76
+ class="right aligned"
77
+ >
78
+ 4
79
+ </td>
80
+ </tr>
81
+ </tbody>
82
+ </table>
83
+ </div>
84
+ `;