@truedat/ie 7.5.9 → 7.5.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 (106) hide show
  1. package/package.json +42 -67
  2. package/src/ingests/components/EventRow.js +1 -2
  3. package/src/ingests/components/Events.js +3 -4
  4. package/src/ingests/components/FieldGroupTable.js +1 -2
  5. package/src/ingests/components/Ingest.js +1 -2
  6. package/src/ingests/components/IngestActions.js +1 -2
  7. package/src/ingests/components/IngestArchive.js +2 -3
  8. package/src/ingests/components/IngestArchiveLoader.js +16 -38
  9. package/src/ingests/components/IngestArchiveRow.js +5 -6
  10. package/src/ingests/components/IngestCompleteness.js +0 -1
  11. package/src/ingests/components/IngestCrumbs.js +2 -4
  12. package/src/ingests/components/IngestDetails.js +3 -3
  13. package/src/ingests/components/IngestDuplicate.js +5 -8
  14. package/src/ingests/components/IngestEdit.js +5 -8
  15. package/src/ingests/components/IngestExecutions.js +7 -7
  16. package/src/ingests/components/IngestExecutionsLoader.js +2 -2
  17. package/src/ingests/components/IngestFilters.js +5 -6
  18. package/src/ingests/components/IngestForm.js +4 -5
  19. package/src/ingests/components/IngestHeader.js +0 -1
  20. package/src/ingests/components/IngestLoader.js +16 -58
  21. package/src/ingests/components/IngestRoutes.js +272 -231
  22. package/src/ingests/components/IngestRow.js +4 -5
  23. package/src/ingests/components/IngestSelectedFilters.js +10 -10
  24. package/src/ingests/components/IngestSummary.js +0 -2
  25. package/src/ingests/components/IngestTabs.js +13 -13
  26. package/src/ingests/components/Ingests.js +0 -1
  27. package/src/ingests/components/IngestsActions.js +1 -2
  28. package/src/ingests/components/IngestsLabelResults.js +1 -2
  29. package/src/ingests/components/IngestsLoader.js +1 -1
  30. package/src/ingests/components/IngestsSearch.js +0 -1
  31. package/src/ingests/components/IngestsSelector.js +0 -1
  32. package/src/ingests/components/IngestsTable.js +85 -94
  33. package/src/ingests/components/IngestsTabs.js +2 -3
  34. package/src/ingests/components/__tests__/Events.spec.js +10 -10
  35. package/src/ingests/components/__tests__/Ingest.spec.js +16 -5
  36. package/src/ingests/components/__tests__/IngestActions.spec.js +7 -7
  37. package/src/ingests/components/__tests__/IngestArchive.spec.js +7 -7
  38. package/src/ingests/components/__tests__/IngestArchiveLoader.spec.js +70 -69
  39. package/src/ingests/components/__tests__/IngestArchiveRow.spec.js +10 -12
  40. package/src/ingests/components/__tests__/IngestCompleteness.spec.js +0 -1
  41. package/src/ingests/components/__tests__/IngestDetails.spec.js +10 -10
  42. package/src/ingests/components/__tests__/IngestExecutions.spec.js +7 -7
  43. package/src/ingests/components/__tests__/IngestExecutionsLoader.spec.js +38 -47
  44. package/src/ingests/components/__tests__/IngestFilters.spec.js +0 -1
  45. package/src/ingests/components/__tests__/IngestForm.spec.js +18 -40
  46. package/src/ingests/components/__tests__/IngestHeader.spec.js +9 -9
  47. package/src/ingests/components/__tests__/IngestLabelResults.spec.js +0 -1
  48. package/src/ingests/components/__tests__/IngestLoader.spec.js +70 -41
  49. package/src/ingests/components/__tests__/IngestRoutes.spec.js +176 -0
  50. package/src/ingests/components/__tests__/IngestSelectedFilters.spec.js +33 -5
  51. package/src/ingests/components/__tests__/Ingests.spec.js +32 -6
  52. package/src/ingests/components/__tests__/IngestsActions.spec.js +5 -5
  53. package/src/ingests/components/__tests__/IngestsLoader.spec.js +65 -36
  54. package/src/ingests/components/__tests__/IngestsTable.spec.js +16 -7
  55. package/src/ingests/components/__tests__/__snapshots__/Events.spec.js.snap +83 -43
  56. package/src/ingests/components/__tests__/__snapshots__/Ingest.spec.js.snap +27 -14
  57. package/src/ingests/components/__tests__/__snapshots__/IngestActions.spec.js.snap +19 -20
  58. package/src/ingests/components/__tests__/__snapshots__/IngestArchive.spec.js.snap +79 -65
  59. package/src/ingests/components/__tests__/__snapshots__/IngestArchiveLoader.spec.js.snap +1 -1
  60. package/src/ingests/components/__tests__/__snapshots__/IngestArchiveRow.spec.js.snap +30 -30
  61. package/src/ingests/components/__tests__/__snapshots__/IngestDetails.spec.js.snap +30 -13
  62. package/src/ingests/components/__tests__/__snapshots__/IngestExecutions.spec.js.snap +121 -101
  63. package/src/ingests/components/__tests__/__snapshots__/IngestExecutionsLoader.spec.js.snap +1 -1
  64. package/src/ingests/components/__tests__/__snapshots__/IngestFilters.spec.js.snap +1 -1
  65. package/src/ingests/components/__tests__/__snapshots__/IngestForm.spec.js.snap +28 -27
  66. package/src/ingests/components/__tests__/__snapshots__/IngestHeader.spec.js.snap +21 -19
  67. package/src/ingests/components/__tests__/__snapshots__/IngestLabelResults.spec.js.snap +1 -1
  68. package/src/ingests/components/__tests__/__snapshots__/IngestLoader.spec.js.snap +1 -15
  69. package/src/ingests/components/__tests__/__snapshots__/IngestRoutes.spec.js.snap +243 -0
  70. package/src/ingests/components/__tests__/__snapshots__/IngestSelectedFilters.spec.js.snap +22 -16
  71. package/src/ingests/components/__tests__/__snapshots__/Ingests.spec.js.snap +50 -33
  72. package/src/ingests/components/__tests__/__snapshots__/IngestsActions.spec.js.snap +17 -50
  73. package/src/ingests/components/__tests__/__snapshots__/IngestsLoader.spec.js.snap +1 -21
  74. package/src/ingests/components/__tests__/__snapshots__/IngestsTable.spec.js.snap +15 -24
  75. package/src/ingests/components/index.js +1 -1
  76. package/src/ingests/constants/mappings.js +6 -6
  77. package/src/ingests/relations/components/IngestLinkActions.js +0 -1
  78. package/src/ingests/relations/components/IngestLinksActions.js +1 -2
  79. package/src/ingests/relations/components/IngestRelationsRoutes.js +67 -69
  80. package/src/ingests/relations/components/IngestToDataStructureRelations.js +2 -2
  81. package/src/ingests/relations/components/IngestToIngestForm.js +4 -4
  82. package/src/ingests/relations/components/IngestToIngestRelations.js +4 -4
  83. package/src/ingests/relations/components/IngestToStructureForm.js +6 -6
  84. package/src/ingests/relations/components/__tests__/IngestRelationsRoutes.spec.js +80 -4
  85. package/src/ingests/relations/components/__tests__/IngestToIngestForm.spec.js +24 -25
  86. package/src/ingests/relations/components/__tests__/IngestToStructureForm.spec.js +42 -23
  87. package/src/ingests/relations/components/__tests__/__snapshots__/IngestRelationsRoutes.spec.js.snap +49 -23
  88. package/src/ingests/relations/components/__tests__/__snapshots__/IngestToIngestForm.spec.js.snap +85 -27
  89. package/src/ingests/relations/components/__tests__/__snapshots__/IngestToStructureForm.spec.js.snap +30 -35
  90. package/src/ingests/relations/selectors/__tests__/getIngestLinks.spec.js +20 -20
  91. package/src/ingests/relations/selectors/__tests__/getRelations.spec.js +17 -17
  92. package/src/ingests/relations/selectors/getIngestLinks.js +1 -2
  93. package/src/ingests/relations/selectors/getRelations.js +6 -6
  94. package/src/ingests/sagas/fetchIngest.js +1 -1
  95. package/src/ingests/sagas/fetchIngestArchive.js +1 -1
  96. package/src/ingests/sagas/fetchIngestExecutions.js +1 -1
  97. package/src/ingests/selectors/getIngestColumns.js +12 -13
  98. package/src/ingests/selectors/getIngestTemplate.js +1 -1
  99. package/src/ingests/selectors/getParsedEvents.js +15 -15
  100. package/src/ingests/selectors/getTemplateFields.js +3 -3
  101. package/src/ingests/selectors/getTemplateGroups.js +1 -1
  102. package/src/ingests/utils/filterOptions.js +3 -2
  103. package/src/ingests/components/__tests__/IngestDuplicate.spec.js +0 -67
  104. package/src/ingests/components/__tests__/IngestEdit.spec.js +0 -79
  105. package/src/ingests/components/__tests__/__snapshots__/IngestDuplicate.spec.js.snap +0 -85
  106. package/src/ingests/components/__tests__/__snapshots__/IngestEdit.spec.js.snap +0 -80
@@ -1,66 +1,24 @@
1
- import React from "react";
2
- import { withRouter } from "react-router-dom";
3
- import PropTypes from "prop-types";
4
- import { compose } from "redux";
5
- import { connect } from "react-redux";
1
+ import { useEffect } from "react";
2
+ import { useParams } from "react-router";
3
+ import { useDispatch, useSelector } from "react-redux";
6
4
  import { Loading } from "@truedat/core/components";
7
- import { Dimmer, Loader } from "semantic-ui-react";
8
5
  import { fetchIngest, clearIngest } from "../routines";
9
6
 
10
- export class IngestLoader extends React.Component {
11
- static propTypes = {
12
- clearIngest: PropTypes.func,
13
- fetchIngest: PropTypes.func,
14
- match: PropTypes.object,
15
- ingestLoading: PropTypes.bool,
16
- };
7
+ export default function IngestLoader() {
8
+ const dispatch = useDispatch();
9
+ const ingestLoading = useSelector((state) => state.ingestLoading);
10
+ const { id } = useParams();
17
11
 
18
- componentDidMount() {
19
- const { fetchIngest, match } = this.props;
20
- const { id } = match.params;
12
+ useEffect(() => {
21
13
  if (id) {
22
- fetchIngest({ id });
23
- }
24
- }
25
-
26
- componentWillUnmount() {
27
- const { clearIngest } = this.props;
28
- clearIngest();
29
- }
30
-
31
- componentDidUpdate(prevProps) {
32
- const { clearIngest, fetchIngest, match } = this.props;
33
- const { id } = match.params;
34
- if (prevProps.match.params.id !== id) {
35
- if (id) {
36
- fetchIngest({ id });
37
- } else {
38
- clearIngest();
39
- }
40
- }
41
- }
42
-
43
- render() {
44
- const { ingestLoading } = this.props;
45
-
46
- if (ingestLoading) {
47
- return (
48
- <>
49
- <Dimmer active={ingestLoading} inverted>
50
- <Loader size="massive" inverted />
51
- </Dimmer>
52
- <Loading />;
53
- </>
54
- );
14
+ dispatch(fetchIngest({ id }));
55
15
  } else {
56
- return null;
16
+ dispatch(clearIngest());
57
17
  }
58
- }
59
- }
60
18
 
61
- const mapStateToProps = ({ ingestLoading }) => ({ ingestLoading });
62
-
63
- export default compose(
64
- withRouter,
65
- connect(mapStateToProps, { clearIngest, fetchIngest })
66
- )(IngestLoader);
19
+ return () => {
20
+ dispatch(clearIngest());
21
+ };
22
+ }, [id, dispatch]);
23
+ return ingestLoading ? <Loading /> : null;
24
+ }
@@ -1,12 +1,11 @@
1
1
  import _ from "lodash/fp";
2
2
  import React from "react";
3
3
  import PropTypes from "prop-types";
4
- import { Route, Switch } from "react-router-dom";
4
+ import { Routes, Route } from "react-router";
5
5
  import { Segment, Grid } from "semantic-ui-react";
6
6
  import { connect } from "react-redux";
7
7
  import { Comments, CommentsLoader } from "@truedat/core/components";
8
- import { Unauthorized } from "@truedat/core/components";
9
- import { useAuthorized } from "@truedat/core/hooks";
8
+ import { ProtectedRoute, Loader } from "@truedat/core/router";
10
9
  import {
11
10
  INGEST,
12
11
  INGEST_ARCHIVE,
@@ -39,242 +38,284 @@ import IngestSummary from "./IngestSummary";
39
38
  import Ingests from "./Ingests";
40
39
  import IngestsLoader from "./IngestsLoader";
41
40
 
42
- const EventsLoader = React.lazy(() =>
43
- import("@truedat/audit/components/EventsLoader")
41
+ const EventsLoader = React.lazy(
42
+ () => import("@truedat/audit/components/EventsLoader")
44
43
  );
45
- const RelationTagsLoader = React.lazy(() =>
46
- import("@truedat/lm/components/RelationTagsLoader")
44
+ const RelationTagsLoader = React.lazy(
45
+ () => import("@truedat/lm/components/RelationTagsLoader")
47
46
  );
48
- const TemplatesLoader = React.lazy(() =>
49
- import("@truedat/df/templates/components/TemplatesLoader")
47
+ const TemplatesLoader = React.lazy(
48
+ () => import("@truedat/core/components/TemplatesLoader")
50
49
  );
51
50
 
52
51
  const IngestRoutes = ({ ingestLoaded, ingest_id, templatesLoaded }) => {
53
- const authorized = useAuthorized("ingests");
54
52
  return (
55
- <Route
56
- path={INGESTS}
57
- render={() =>
58
- authorized ? (
59
- <>
60
- <Route
61
- exact
62
- path={INGESTS}
63
- component={() => (
64
- <IngestsLoader defaultFilters={{ status: ["published"] }} />
65
- )}
53
+ <Routes>
54
+ <Route
55
+ path={INGESTS}
56
+ element={
57
+ <ProtectedRoute authorization="ingests">
58
+ <Loader
59
+ loaders={
60
+ <>
61
+ <IngestsLoader defaultFilters={{ status: ["published"] }} />
62
+ <IngestFiltersLoader />
63
+ </>
64
+ }
66
65
  />
67
- <Route path={INGESTS} component={IngestFiltersLoader} />
68
- <Route exact path={INGESTS} component={Ingests} />
69
- <Switch>
70
- <Route
71
- exact
72
- path={INGESTS_PENDING}
73
- render={() => (
74
- <>
75
- <IngestsLoader
76
- defaultFilters={{
77
- status: ["draft", "pending_approval", "rejected"],
78
- }}
66
+ </ProtectedRoute>
67
+ }
68
+ >
69
+ <Route index element={<Ingests />} />
70
+
71
+ <Route
72
+ path={INGESTS_PENDING}
73
+ element={
74
+ <Loader
75
+ loaders={
76
+ <>
77
+ <IngestsLoader
78
+ defaultFilters={{
79
+ status: ["draft", "pending_approval", "rejected"],
80
+ }}
81
+ />
82
+ <IngestFiltersLoader />
83
+ </>
84
+ }
85
+ />
86
+ }
87
+ >
88
+ <Route index element={<Ingests />} />
89
+ </Route>
90
+
91
+ <Route
92
+ path={INGESTS_NEW}
93
+ element={
94
+ <Loader loaders={<IngestsLoader />}>
95
+ <IngestCrumbs ingestAction="ingests.actions.create" />
96
+ <IngestForm />
97
+ </Loader>
98
+ }
99
+ />
100
+
101
+ <Route
102
+ path={INGEST}
103
+ element={
104
+ <Loader
105
+ loaders={
106
+ <>
107
+ <IngestLoader />
108
+ <RelationTagsLoader />
109
+ {ingestLoaded && (
110
+ <CommentsLoader
111
+ resource_id={ingest_id}
112
+ resource_type="ingest"
113
+ />
114
+ )}
115
+ </>
116
+ }
117
+ >
118
+ <IngestCrumbs />
119
+ <Grid columns="equal" style={{ marginTop: 0 }}>
120
+ <Grid.Column width={12}>
121
+ <Segment>
122
+ {ingestLoaded && <Ingest />}
123
+ {ingestLoaded && <IngestDetails />}
124
+ </Segment>
125
+ <Segment>{ingestLoaded && <Comments />}</Segment>
126
+ </Grid.Column>
127
+ <Grid.Column width={4}>
128
+ {ingestLoaded && (
129
+ <>
130
+ <IngestSummary />
131
+ <IngestCompleteness />
132
+ </>
133
+ )}
134
+ </Grid.Column>
135
+ </Grid>
136
+ </Loader>
137
+ }
138
+ />
139
+
140
+ <Route
141
+ path={INGEST_EXECUTIONS}
142
+ element={
143
+ <Loader
144
+ loaders={
145
+ <>
146
+ <IngestLoader />
147
+ <RelationTagsLoader />
148
+ <IngestExecutionsLoader />
149
+ </>
150
+ }
151
+ >
152
+ <IngestCrumbs />
153
+ <Grid columns="equal" style={{ marginTop: 0 }}>
154
+ <Grid.Column width={12}>
155
+ <Segment>
156
+ {ingestLoaded && <Ingest />}
157
+ {ingestLoaded && <IngestExecutions />}
158
+ </Segment>
159
+ </Grid.Column>
160
+ <Grid.Column width={4}>
161
+ {ingestLoaded && <IngestSummary />}
162
+ </Grid.Column>
163
+ </Grid>
164
+ </Loader>
165
+ }
166
+ />
167
+
168
+ <Route
169
+ path={INGEST_ARCHIVE}
170
+ element={
171
+ <Loader
172
+ loaders={
173
+ <>
174
+ <IngestLoader />
175
+ <RelationTagsLoader />
176
+ <IngestArchiveLoader />
177
+ </>
178
+ }
179
+ >
180
+ <IngestCrumbs />
181
+ <Grid columns="equal" style={{ marginTop: 0 }}>
182
+ <Grid.Column width={12}>
183
+ <Segment>
184
+ {ingestLoaded && <Ingest />}
185
+ {ingestLoaded && <IngestArchive />}
186
+ </Segment>
187
+ </Grid.Column>
188
+ <Grid.Column width={4}>
189
+ {ingestLoaded && <IngestSummary />}
190
+ </Grid.Column>
191
+ </Grid>
192
+ </Loader>
193
+ }
194
+ />
195
+
196
+ <Route
197
+ path={INGEST_EVENTS}
198
+ element={
199
+ <Loader
200
+ loaders={
201
+ <>
202
+ <IngestLoader />
203
+ <RelationTagsLoader />
204
+ <IngestArchiveLoader />
205
+ {ingestLoaded && (
206
+ <EventsLoader
207
+ resource_id={ingest_id}
208
+ resource_type="ingest"
79
209
  />
80
- <IngestFiltersLoader />
81
- <Ingests />
82
- </>
83
- )}
84
- />
85
- <Route
86
- exact
87
- path={INGESTS_NEW}
88
- render={() => (
89
- <>
90
- <IngestCrumbs ingestAction="ingests.actions.create" />
91
- <IngestsLoader />
92
- <IngestForm />
93
- </>
94
- )}
95
- />
96
- <Route
97
- exact
98
- path={INGEST}
99
- render={() => (
100
- <>
101
- <IngestCrumbs />
102
- <Grid columns="equal" style={{ marginTop: 0 }}>
103
- <Grid.Column width={12}>
104
- <Segment>
105
- <IngestLoader />
106
- <RelationTagsLoader />
107
- {ingestLoaded && <Ingest />}
108
- {ingestLoaded && <IngestDetails />}
109
- {ingestLoaded && (
110
- <CommentsLoader
111
- resource_id={ingest_id}
112
- resource_type="ingest"
113
- />
114
- )}
115
- </Segment>
116
- <Segment>{ingestLoaded && <Comments />}</Segment>
117
- </Grid.Column>
118
- <Grid.Column width={4}>
119
- {ingestLoaded && (
120
- <>
121
- <IngestSummary />
122
- <IngestCompleteness />
123
- </>
124
- )}
125
- </Grid.Column>
126
- </Grid>
127
- </>
128
- )}
129
- />
130
- <Route
131
- exact
132
- path={INGEST_EXECUTIONS}
133
- render={() => (
134
- <>
135
- <IngestCrumbs />
136
- <Grid columns="equal" style={{ marginTop: 0 }}>
137
- <Grid.Column width={12}>
138
- <Segment>
139
- <IngestLoader />
140
- <RelationTagsLoader />
141
- <IngestExecutionsLoader />
142
- {ingestLoaded && <Ingest />}
143
- {ingestLoaded && <IngestExecutions />}
144
- </Segment>
145
- </Grid.Column>
146
- <Grid.Column width={4}>
147
- {ingestLoaded && <IngestSummary />}
148
- </Grid.Column>
149
- </Grid>
150
- </>
151
- )}
152
- />
153
- <Route
154
- exact
155
- path={INGEST_ARCHIVE}
156
- render={() => (
157
- <>
158
- <IngestCrumbs />
159
- <Grid columns="equal" style={{ marginTop: 0 }}>
160
- <Grid.Column width={12}>
161
- <Segment>
162
- <IngestLoader />
163
- <RelationTagsLoader />
164
- <IngestArchiveLoader />
165
- {ingestLoaded && <Ingest />}
166
- {ingestLoaded && <IngestArchive />}
167
- </Segment>
168
- </Grid.Column>
169
- <Grid.Column width={4}>
170
- {ingestLoaded && <IngestSummary />}
171
- </Grid.Column>
172
- </Grid>
173
- </>
174
- )}
175
- />
176
- <Route
177
- exact
178
- path={INGEST_EVENTS}
179
- render={() => (
180
- <>
181
- <IngestCrumbs />
182
- <Grid columns="equal" style={{ marginTop: 0 }}>
183
- <Grid.Column width={12}>
184
- <Segment>
185
- <IngestLoader />
186
- <RelationTagsLoader />
187
- <IngestArchiveLoader />
188
- {ingestLoaded && (
189
- <EventsLoader
190
- resource_id={ingest_id}
191
- resource_type="ingest"
192
- />
193
- )}
194
- {ingestLoaded && <Ingest />}
195
- {ingestLoaded && <Events />}
196
- </Segment>
197
- </Grid.Column>
198
- <Grid.Column width={4}>
199
- {ingestLoaded && <IngestSummary />}
200
- </Grid.Column>
201
- </Grid>
202
- </>
203
- )}
204
- />
205
- <Route
206
- path={INGEST_RELATIONS_STRUCTURES}
207
- render={() => (
208
- <>
209
- <IngestCrumbs />
210
- <Grid columns="equal" style={{ marginTop: 0 }}>
211
- <Grid.Column width={12}>
212
- <Segment>
213
- <IngestLoader />
214
- <RelationTagsLoader />
215
- {ingestLoaded && <Ingest />}
216
- {ingestLoaded && <IngestRelationsRoutes />}
217
- </Segment>
218
- </Grid.Column>
219
- <Grid.Column width={4}>
220
- {ingestLoaded && <IngestSummary />}
221
- </Grid.Column>
222
- </Grid>
223
- </>
224
- )}
225
- />
226
- <Route
227
- path={INGEST_RELATIONS_INGESTS}
228
- render={() => (
229
- <>
230
- <IngestCrumbs />
231
- <Grid columns="equal" style={{ marginTop: 0 }}>
232
- <Grid.Column width={12}>
233
- <Segment>
234
- <IngestLoader />
235
- <RelationTagsLoader />
236
- {ingestLoaded && <Ingest />}
237
- {ingestLoaded && <IngestRelationsRoutes />}
238
- </Segment>
239
- </Grid.Column>
240
- <Grid.Column width={4}>
241
- {ingestLoaded && <IngestSummary />}
242
- </Grid.Column>
243
- </Grid>
244
- </>
245
- )}
246
- />
247
- <Route
248
- exact
249
- path={INGEST_EDIT}
250
- render={() => (
251
- <>
252
- <IngestCrumbs ingestAction="ingests.actions.edit" />
253
- <TemplatesLoader scope="ie" />
254
- <IngestLoader />
255
- {ingestLoaded && templatesLoaded && <IngestEdit />}
256
- </>
257
- )}
258
- />
259
- <Route
260
- exact
261
- path={INGEST_DUPLICATE}
262
- render={() => (
263
- <>
264
- <IngestCrumbs ingestAction="ingests.actions.duplicate" />
265
- <TemplatesLoader scope="ie" />
266
- <IngestLoader />
267
- {ingestLoaded && templatesLoaded && <IngestDuplicate />}
268
- </>
269
- )}
270
- />
271
- </Switch>
272
- </>
273
- ) : (
274
- <Unauthorized />
275
- )
276
- }
277
- />
210
+ )}
211
+ </>
212
+ }
213
+ >
214
+ <IngestCrumbs />
215
+ <Grid columns="equal" style={{ marginTop: 0 }}>
216
+ <Grid.Column width={12}>
217
+ <Segment>
218
+ {ingestLoaded && <Ingest />}
219
+ {ingestLoaded && <Events />}
220
+ </Segment>
221
+ </Grid.Column>
222
+ <Grid.Column width={4}>
223
+ {ingestLoaded && <IngestSummary />}
224
+ </Grid.Column>
225
+ </Grid>
226
+ </Loader>
227
+ }
228
+ />
229
+
230
+ <Route
231
+ path={INGEST_RELATIONS_STRUCTURES}
232
+ element={
233
+ <Loader
234
+ loaders={
235
+ <>
236
+ <IngestLoader />
237
+ <RelationTagsLoader />
238
+ </>
239
+ }
240
+ >
241
+ <IngestCrumbs />
242
+ <Grid columns="equal" style={{ marginTop: 0 }}>
243
+ <Grid.Column width={12}>
244
+ <Segment>
245
+ {ingestLoaded && <Ingest />}
246
+ {ingestLoaded && <IngestRelationsRoutes />}
247
+ </Segment>
248
+ </Grid.Column>
249
+ <Grid.Column width={4}>
250
+ {ingestLoaded && <IngestSummary />}
251
+ </Grid.Column>
252
+ </Grid>
253
+ </Loader>
254
+ }
255
+ />
256
+
257
+ <Route
258
+ path={INGEST_RELATIONS_INGESTS}
259
+ element={
260
+ <Loader
261
+ loaders={
262
+ <>
263
+ <IngestLoader />
264
+ <RelationTagsLoader />
265
+ </>
266
+ }
267
+ >
268
+ <IngestCrumbs />
269
+ <Grid columns="equal" style={{ marginTop: 0 }}>
270
+ <Grid.Column width={12}>
271
+ <Segment>
272
+ {ingestLoaded && <Ingest />}
273
+ {ingestLoaded && <IngestRelationsRoutes />}
274
+ </Segment>
275
+ </Grid.Column>
276
+ <Grid.Column width={4}>
277
+ {ingestLoaded && <IngestSummary />}
278
+ </Grid.Column>
279
+ </Grid>
280
+ </Loader>
281
+ }
282
+ />
283
+
284
+ <Route
285
+ path={INGEST_EDIT}
286
+ element={
287
+ <Loader
288
+ loaders={
289
+ <>
290
+ <TemplatesLoader scope="ie" />
291
+ <IngestLoader />
292
+ </>
293
+ }
294
+ >
295
+ <IngestCrumbs ingestAction="ingests.actions.edit" />
296
+ {ingestLoaded && templatesLoaded && <IngestEdit />}
297
+ </Loader>
298
+ }
299
+ />
300
+
301
+ <Route
302
+ path={INGEST_DUPLICATE}
303
+ element={
304
+ <Loader
305
+ loaders={
306
+ <>
307
+ <TemplatesLoader scope="ie" />
308
+ <IngestLoader />
309
+ </>
310
+ }
311
+ >
312
+ <IngestCrumbs ingestAction="ingests.actions.duplicate" />
313
+ {ingestLoaded && templatesLoaded && <IngestDuplicate />}
314
+ </Loader>
315
+ }
316
+ />
317
+ </Route>
318
+ </Routes>
278
319
  );
279
320
  };
280
321
 
@@ -1,15 +1,14 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
- import { useHistory } from "react-router-dom";
2
+ import { useNavigate } from "react-router";
4
3
  import { Table } from "semantic-ui-react";
5
4
  import { columnDecorator } from "@truedat/core/services";
6
5
  import { linkTo } from "@truedat/core/routes";
7
6
 
8
7
  export const IngestRow = ({ ingest, columns }) => {
9
- const history = useHistory();
8
+ const navigate = useNavigate();
10
9
  const { id } = ingest;
11
10
  return (
12
- <Table.Row key={id} onClick={() => history.push(linkTo.INGEST({ id }))}>
11
+ <Table.Row key={id} onClick={() => navigate(linkTo.INGEST({ id }))}>
13
12
  {columns &&
14
13
  columns.map((column, key) => {
15
14
  return (
@@ -22,7 +21,7 @@ export const IngestRow = ({ ingest, columns }) => {
22
21
 
23
22
  IngestRow.propTypes = {
24
23
  ingest: PropTypes.object,
25
- columns: PropTypes.array
24
+ columns: PropTypes.array,
26
25
  };
27
26
 
28
27
  export default IngestRow;
@@ -1,20 +1,20 @@
1
- import React from "react";
2
- import { Route, Switch } from "react-router-dom";
1
+ import { Route, Routes } from "react-router";
3
2
  import { INGESTS, INGESTS_PENDING } from "@truedat/core/routes";
3
+ import { Loader } from "@truedat/core/router";
4
4
  import IngestSelectedFiltersDefault from "./IngestSelectedFiltersDefault";
5
5
  import IngestSelectedFiltersPending from "./IngestSelectedFiltersPending";
6
6
  import IngestSelectedFiltersPublished from "./IngestSelectedFiltersPublished";
7
7
 
8
8
  export const IngestSelectedFilters = () => (
9
- <Switch>
10
- <Route exact path={INGESTS} component={IngestSelectedFiltersPublished} />
9
+ <Routes>
11
10
  <Route
12
- exact
13
- path={INGESTS_PENDING}
14
- component={IngestSelectedFiltersPending}
15
- />
16
- <Route component={IngestSelectedFiltersDefault} />
17
- </Switch>
11
+ path={INGESTS}
12
+ element={<Loader loaders={<IngestSelectedFiltersDefault />} />}
13
+ >
14
+ <Route index element={<IngestSelectedFiltersPublished />} />
15
+ <Route path="pending" element={<IngestSelectedFiltersPending />} />
16
+ </Route>
17
+ </Routes>
18
18
  );
19
19
 
20
20
  export default IngestSelectedFilters;