@truedat/cx 4.36.7 → 4.37.1

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 (39) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +7 -6
  3. package/src/configurations/components/ConfigurationActions.js +1 -1
  4. package/src/configurations/components/ConfigurationCards.js +1 -1
  5. package/src/configurations/components/__tests__/__snapshots__/ConfigurationCards.spec.js.snap +5 -5
  6. package/src/messages/en.js +32 -25
  7. package/src/messages/es.js +32 -25
  8. package/src/sources/components/EditSource.js +3 -3
  9. package/src/sources/components/NewSource.js +1 -1
  10. package/src/sources/components/Source.js +3 -3
  11. package/src/sources/components/SourceActions.js +107 -79
  12. package/src/sources/components/SourceForm.js +15 -24
  13. package/src/sources/components/SourceRoutes.js +8 -18
  14. package/src/sources/components/{SourcesSelector.js → SourceSelector.js} +0 -0
  15. package/src/sources/components/Sources.js +53 -47
  16. package/src/sources/components/SourcesTable.js +88 -0
  17. package/src/sources/components/__tests__/SourceActions.spec.js +27 -6
  18. package/src/sources/components/__tests__/Sources.spec.js +68 -18
  19. package/src/sources/components/__tests__/SourcesTable.spec.js +59 -0
  20. package/src/sources/components/__tests__/__snapshots__/EditSource.spec.js.snap +3 -3
  21. package/src/sources/components/__tests__/__snapshots__/NewSource.spec.js.snap +1 -1
  22. package/src/sources/components/__tests__/__snapshots__/Source.spec.js.snap +1 -1
  23. package/src/sources/components/__tests__/__snapshots__/SourceActions.spec.js.snap +53 -65
  24. package/src/sources/components/__tests__/__snapshots__/SourceForm.spec.js.snap +10 -8
  25. package/src/sources/components/__tests__/__snapshots__/Sources.spec.js.snap +170 -62
  26. package/src/sources/components/__tests__/__snapshots__/SourcesTable.spec.js.snap +217 -0
  27. package/src/sources/components/index.js +3 -3
  28. package/src/sources/reducers/__tests__/sourceRedirect.spec.js +28 -5
  29. package/src/sources/reducers/source.js +4 -3
  30. package/src/sources/reducers/sourceRedirect.js +7 -1
  31. package/src/sources/routines.js +6 -4
  32. package/src/sources/sagas/__tests__/disableSource.spec.js +82 -0
  33. package/src/sources/sagas/__tests__/enableSource.spec.js +82 -0
  34. package/src/sources/sagas/disableSource.js +39 -0
  35. package/src/sources/sagas/enableSource.js +39 -0
  36. package/src/sources/sagas/index.js +13 -7
  37. package/src/sources/components/SourceCards.js +0 -115
  38. package/src/sources/components/__tests__/SourceCards.spec.js +0 -45
  39. package/src/sources/components/__tests__/__snapshots__/SourceCards.spec.js.snap +0 -421
@@ -1,69 +1,57 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<SourceActions /> matches the latest snapshot 1`] = `
4
- <Fragment>
5
- <GroupActions
6
- availableActions={
7
- Array [
8
- Object {
9
- "active": false,
10
- "as": Object {
11
- "$$typeof": Symbol(react.forward_ref),
12
- "displayName": "Link",
13
- "propTypes": Object {
14
- "innerRef": [Function],
15
- "onClick": [Function],
16
- "replace": [Function],
17
- "target": [Function],
18
- "to": [Function],
19
- },
20
- "render": [Function],
21
- },
22
- "icon": "edit",
23
- "key": "edit",
24
- "selected": false,
25
- "text": <Memo(MemoizedFormattedMessage)
26
- defaultMessage="edit"
27
- id="sources.actions.edit"
28
- />,
29
- "to": "/sources/Micro1/edit",
30
- "value": "edit",
31
- },
32
- Object {
33
- "active": false,
34
- "as": [Function],
35
- "deleteSource": [MockFunction],
36
- "external_id": "Micro1",
37
- "icon": "trash",
38
- "key": "delete",
39
- "name": "",
40
- "selected": false,
41
- "value": "delete",
42
- },
43
- Object {
44
- "active": false,
45
- "as": Object {
46
- "$$typeof": Symbol(react.forward_ref),
47
- "displayName": "Link",
48
- "propTypes": Object {
49
- "innerRef": [Function],
50
- "onClick": [Function],
51
- "replace": [Function],
52
- "target": [Function],
53
- "to": [Function],
54
- },
55
- "render": [Function],
56
- },
57
- "icon": "play",
58
- "key": "run",
59
- "selected": false,
60
- "text": "Run",
61
- "to": "/sources/Micro1/jobs/new",
62
- "value": "run",
63
- },
64
- ]
65
- }
66
- direction="left"
67
- />
68
- </Fragment>
4
+ <div>
5
+ <div
6
+ aria-expanded="false"
7
+ class="ui floating dropdown button icon group-actions"
8
+ role="listbox"
9
+ tabindex="0"
10
+ >
11
+ <i
12
+ aria-hidden="true"
13
+ class="ellipsis vertical icon"
14
+ />
15
+ <div
16
+ class="left menu transition"
17
+ >
18
+ <a
19
+ aria-checked="false"
20
+ aria-selected="true"
21
+ class="selected item"
22
+ href="/sources/Micro1/edit"
23
+ role="option"
24
+ style="pointer-events: all;"
25
+ >
26
+ <i
27
+ aria-hidden="true"
28
+ class="edit icon"
29
+ />
30
+ <span
31
+ class="text"
32
+ >
33
+ edit
34
+ </span>
35
+ </a>
36
+ <button
37
+ class="ui button"
38
+ >
39
+ <i
40
+ aria-hidden="true"
41
+ class="play icon"
42
+ />
43
+ enable
44
+ </button>
45
+ <button
46
+ class="ui button"
47
+ >
48
+ <i
49
+ aria-hidden="true"
50
+ class="trash icon"
51
+ />
52
+ delete
53
+ </button>
54
+ </div>
55
+ </div>
56
+ </div>
69
57
  `;
@@ -8,7 +8,9 @@ exports[`<SourceForm /> with multiple templates matches the latest snapshot 1`]
8
8
  required={true}
9
9
  >
10
10
  <label>
11
- source.props.external_id
11
+ <MemoizedFormattedMessage
12
+ id="source.external_id"
13
+ />
12
14
  </label>
13
15
  <FormInput
14
16
  as={[Function]}
@@ -23,7 +25,9 @@ exports[`<SourceForm /> with multiple templates matches the latest snapshot 1`]
23
25
  required={true}
24
26
  >
25
27
  <label>
26
- type.selector.label
28
+ <MemoizedFormattedMessage
29
+ id="type.selector.label"
30
+ />
27
31
  </label>
28
32
  <FormDropdown
29
33
  as={[Function]}
@@ -57,7 +61,9 @@ exports[`<SourceForm /> with multiple templates matches the latest snapshot 1`]
57
61
  <label
58
62
  className="label"
59
63
  >
60
- source.config.label
64
+ <MemoizedFormattedMessage
65
+ id="source.config.label"
66
+ />
61
67
  </label>
62
68
  <Connect(DynamicSourceForm)
63
69
  dfContent={Object {}}
@@ -73,11 +79,7 @@ exports[`<SourceForm /> with multiple templates matches the latest snapshot 1`]
73
79
  />
74
80
  <Button
75
81
  as="button"
76
- content={
77
- <Memo(MemoizedFormattedMessage)
78
- id="actions.save"
79
- />
80
- }
82
+ content="actions.save"
81
83
  disabled={false}
82
84
  onClick={[Function]}
83
85
  primary={true}
@@ -1,71 +1,179 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<Sources /> matches the latest snapshot 1`] = `
4
- <Segment>
5
- <Header
6
- as="h2"
4
+ <div>
5
+ <div
6
+ class="ui segment"
7
7
  >
8
- <Button
9
- as={
10
- Object {
11
- "$$typeof": Symbol(react.forward_ref),
12
- "displayName": "Link",
13
- "propTypes": Object {
14
- "innerRef": [Function],
15
- "onClick": [Function],
16
- "replace": [Function],
17
- "target": [Function],
18
- "to": [Function],
19
- },
20
- "render": [Function],
21
- }
22
- }
23
- content={
24
- <Memo(MemoizedFormattedMessage)
25
- id="sources.actions.create"
26
- />
27
- }
28
- floated="right"
29
- primary={true}
30
- to="/sources/new"
31
- />
32
- <Icon
33
- as="i"
34
- circular={true}
35
- name="plug"
36
- />
37
- <HeaderContent>
38
- <MemoizedFormattedMessage
39
- id="sources.header"
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ <a
12
+ class="ui primary right floated button"
13
+ href="/sources/new"
14
+ role="button"
15
+ >
16
+ create
17
+ </a>
18
+ <i
19
+ aria-hidden="true"
20
+ class="plug circular icon"
40
21
  />
41
- <HeaderSubheader>
42
- <MemoizedFormattedMessage
43
- id="sources.subheader"
44
- />
45
- </HeaderSubheader>
46
- </HeaderContent>
47
- </Header>
48
- <Grid
49
- centered={true}
50
- columns={1}
51
- >
52
- <GridColumn>
53
- <Input
54
- icon={
55
- Object {
56
- "link": true,
57
- "name": "search",
58
- }
59
- }
60
- onChange={[Function]}
61
- placeholder="sources.search.placeholder"
22
+ <div
23
+ class="content"
24
+ >
25
+ header
26
+ <div
27
+ class="sub header"
28
+ >
29
+ subheader
30
+ </div>
31
+ </div>
32
+ </h2>
33
+ <div
34
+ class="ui icon input"
35
+ >
36
+ <input
37
+ placeholder="search"
62
38
  type="text"
63
39
  value=""
64
40
  />
65
- </GridColumn>
66
- </Grid>
67
- <Connect(SourceCards)
68
- sources={Array []}
69
- />
70
- </Segment>
41
+ <i
42
+ aria-hidden="true"
43
+ class="search link icon"
44
+ />
45
+ </div>
46
+ <table
47
+ class="ui table"
48
+ >
49
+ <caption
50
+ class="text-right"
51
+ >
52
+ 2 sources found
53
+ </caption>
54
+ <thead
55
+ class=""
56
+ >
57
+ <tr
58
+ class=""
59
+ >
60
+ <th
61
+ class=""
62
+ >
63
+ external_id
64
+ </th>
65
+ <th
66
+ class=""
67
+ >
68
+ type
69
+ </th>
70
+ <th
71
+ class=""
72
+ >
73
+ status
74
+ </th>
75
+ <th
76
+ class=""
77
+ >
78
+ insertedAt
79
+ </th>
80
+ <th
81
+ class=""
82
+ >
83
+ type
84
+ </th>
85
+ <th
86
+ class=""
87
+ >
88
+ message
89
+ </th>
90
+ </tr>
91
+ </thead>
92
+ <tbody
93
+ class=""
94
+ >
95
+ <tr
96
+ class=""
97
+ >
98
+ <td
99
+ class=""
100
+ >
101
+ <a
102
+ href="/sources/aaaa"
103
+ >
104
+ aaaa
105
+ </a>
106
+ </td>
107
+ <td
108
+ class=""
109
+ >
110
+ sourceType1
111
+ </td>
112
+ <td
113
+ class=""
114
+ />
115
+ <td
116
+ class=""
117
+ >
118
+ <time
119
+ datetime="1577882096000"
120
+ >
121
+ 2020-01-01 12:34
122
+ </time>
123
+ </td>
124
+ <td
125
+ class=""
126
+ >
127
+ eventType
128
+ </td>
129
+ <td
130
+ class=""
131
+ >
132
+ eventMessage
133
+ </td>
134
+ </tr>
135
+ <tr
136
+ class=""
137
+ >
138
+ <td
139
+ class=""
140
+ >
141
+ <a
142
+ href="/sources/bbbb"
143
+ >
144
+ bbbb
145
+ </a>
146
+ </td>
147
+ <td
148
+ class=""
149
+ >
150
+ sourceType2
151
+ </td>
152
+ <td
153
+ class=""
154
+ />
155
+ <td
156
+ class=""
157
+ >
158
+ <time
159
+ datetime="1577882096000"
160
+ >
161
+ 2020-01-01 12:34
162
+ </time>
163
+ </td>
164
+ <td
165
+ class=""
166
+ >
167
+ eventType
168
+ </td>
169
+ <td
170
+ class=""
171
+ >
172
+ eventMessage
173
+ </td>
174
+ </tr>
175
+ </tbody>
176
+ </table>
177
+ </div>
178
+ </div>
71
179
  `;
@@ -0,0 +1,217 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`<SourcesTable /> matches the latest snapshot 1`] = `
4
+ <div>
5
+ <table
6
+ class="ui table"
7
+ >
8
+ <caption
9
+ class="text-right"
10
+ >
11
+ 5 sources found
12
+ </caption>
13
+ <thead
14
+ class=""
15
+ >
16
+ <tr
17
+ class=""
18
+ >
19
+ <th
20
+ class=""
21
+ >
22
+ external_id
23
+ </th>
24
+ <th
25
+ class=""
26
+ >
27
+ type
28
+ </th>
29
+ <th
30
+ class=""
31
+ >
32
+ status
33
+ </th>
34
+ <th
35
+ class=""
36
+ >
37
+ eventInsertedAt
38
+ </th>
39
+ <th
40
+ class=""
41
+ >
42
+ eventType
43
+ </th>
44
+ <th
45
+ class=""
46
+ >
47
+ eventMessage
48
+ </th>
49
+ </tr>
50
+ </thead>
51
+ <tbody
52
+ class=""
53
+ >
54
+ <tr
55
+ class=""
56
+ >
57
+ <td
58
+ class=""
59
+ >
60
+ <a
61
+ href="/sources/con_url"
62
+ >
63
+ con_url
64
+ </a>
65
+ </td>
66
+ <td
67
+ class="disabled"
68
+ >
69
+ a
70
+ </td>
71
+ <td
72
+ class="disabled"
73
+ >
74
+ disabled
75
+ </td>
76
+ <td
77
+ class="disabled"
78
+ />
79
+ <td
80
+ class="disabled"
81
+ />
82
+ <td
83
+ class="disabled"
84
+ />
85
+ </tr>
86
+ <tr
87
+ class=""
88
+ >
89
+ <td
90
+ class=""
91
+ >
92
+ <a
93
+ href="/sources/id1"
94
+ >
95
+ id1
96
+ </a>
97
+ </td>
98
+ <td
99
+ class="disabled"
100
+ >
101
+ app-admin
102
+ </td>
103
+ <td
104
+ class="disabled"
105
+ >
106
+ disabled
107
+ </td>
108
+ <td
109
+ class="disabled"
110
+ />
111
+ <td
112
+ class="disabled"
113
+ />
114
+ <td
115
+ class="disabled"
116
+ />
117
+ </tr>
118
+ <tr
119
+ class=""
120
+ >
121
+ <td
122
+ class=""
123
+ >
124
+ <a
125
+ href="/sources/id2"
126
+ >
127
+ id2
128
+ </a>
129
+ </td>
130
+ <td
131
+ class="disabled"
132
+ >
133
+ app-admin
134
+ </td>
135
+ <td
136
+ class="disabled"
137
+ >
138
+ disabled
139
+ </td>
140
+ <td
141
+ class="disabled"
142
+ />
143
+ <td
144
+ class="disabled"
145
+ />
146
+ <td
147
+ class="disabled"
148
+ />
149
+ </tr>
150
+ <tr
151
+ class=""
152
+ >
153
+ <td
154
+ class=""
155
+ >
156
+ <a
157
+ href="/sources/id3"
158
+ >
159
+ id3
160
+ </a>
161
+ </td>
162
+ <td
163
+ class="disabled"
164
+ >
165
+ app-admin
166
+ </td>
167
+ <td
168
+ class="disabled"
169
+ >
170
+ disabled
171
+ </td>
172
+ <td
173
+ class="disabled"
174
+ />
175
+ <td
176
+ class="disabled"
177
+ />
178
+ <td
179
+ class="disabled"
180
+ />
181
+ </tr>
182
+ <tr
183
+ class=""
184
+ >
185
+ <td
186
+ class=""
187
+ >
188
+ <a
189
+ href="/sources/id4"
190
+ >
191
+ id4
192
+ </a>
193
+ </td>
194
+ <td
195
+ class="disabled"
196
+ >
197
+ a
198
+ </td>
199
+ <td
200
+ class="disabled"
201
+ >
202
+ disabled
203
+ </td>
204
+ <td
205
+ class="disabled"
206
+ />
207
+ <td
208
+ class="disabled"
209
+ />
210
+ <td
211
+ class="disabled"
212
+ />
213
+ </tr>
214
+ </tbody>
215
+ </table>
216
+ </div>
217
+ `;
@@ -1,6 +1,6 @@
1
1
  import SourceRoutes from "./SourceRoutes";
2
- import SourcesLoader from "./SourcesLoader";
3
2
  import Sources from "./Sources";
4
- import SourceCards from "./SourceCards";
3
+ import SourcesLoader from "./SourcesLoader";
4
+ import SourcesTable from "./SourcesTable";
5
5
 
6
- export { Sources, SourceCards, SourceRoutes, SourcesLoader };
6
+ export { Sources, SourcesLoader, SourcesTable, SourceRoutes };
@@ -1,6 +1,11 @@
1
1
  import { SOURCES } from "@truedat/core/routes";
2
2
  import { clearRedirect } from "@truedat/core/routines";
3
- import { createSource, deleteSource } from "../../routines";
3
+ import {
4
+ createSource,
5
+ deleteSource,
6
+ disableSource,
7
+ enableSource,
8
+ } from "../../routines";
4
9
  import { sourceRedirect } from "..";
5
10
 
6
11
  describe("reducers: sourceRedirect", () => {
@@ -17,20 +22,38 @@ describe("reducers: sourceRedirect", () => {
17
22
  );
18
23
  });
19
24
 
20
- it("should handle the createRelationTag.SUCCESS action", () => {
25
+ it("should handle the createSource.SUCCESS action", () => {
21
26
  expect(
22
27
  sourceRedirect("foo", {
23
28
  type: createSource.SUCCESS,
24
- meta: { redirectUrl: SOURCES }
29
+ meta: { redirectUrl: SOURCES },
25
30
  })
26
31
  ).toEqual(SOURCES);
27
32
  });
28
33
 
29
- it("should handle the deleteRelationTag.SUCCESS action", () => {
34
+ it("should handle the deleteSource.SUCCESS action", () => {
30
35
  expect(
31
36
  sourceRedirect("foo", {
32
37
  type: deleteSource.SUCCESS,
33
- meta: { redirectUrl: SOURCES }
38
+ meta: { redirectUrl: SOURCES },
39
+ })
40
+ ).toEqual(SOURCES);
41
+ });
42
+
43
+ it("should handle the disableSource.SUCCESS action", () => {
44
+ expect(
45
+ sourceRedirect("foo", {
46
+ type: disableSource.SUCCESS,
47
+ meta: { redirectUrl: SOURCES },
48
+ })
49
+ ).toEqual(SOURCES);
50
+ });
51
+
52
+ it("should handle the enableSource.SUCCESS action", () => {
53
+ expect(
54
+ sourceRedirect("foo", {
55
+ type: enableSource.SUCCESS,
56
+ meta: { redirectUrl: SOURCES },
34
57
  })
35
58
  ).toEqual(SOURCES);
36
59
  });