@truedat/cx 7.5.9 → 7.5.11

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 (110) hide show
  1. package/package.json +40 -70
  2. package/src/configurations/components/Configuration.js +3 -3
  3. package/src/configurations/components/ConfigurationActions.js +1 -2
  4. package/src/configurations/components/ConfigurationBreadcrumbs.js +2 -3
  5. package/src/configurations/components/ConfigurationCards.js +1 -2
  6. package/src/configurations/components/ConfigurationForm.js +6 -11
  7. package/src/configurations/components/ConfigurationLoader.js +1 -2
  8. package/src/configurations/components/ConfigurationRoutes.js +61 -72
  9. package/src/configurations/components/ConfigurationTokenLoader.js +0 -1
  10. package/src/configurations/components/Configurations.js +2 -2
  11. package/src/configurations/components/ConfigurationsLoader.js +0 -1
  12. package/src/configurations/components/DynamicConfigurationForm.js +5 -7
  13. package/src/configurations/components/EditConfiguration.js +0 -1
  14. package/src/configurations/components/NewConfiguration.js +0 -1
  15. package/src/configurations/components/__tests__/Configuration.spec.js +17 -10
  16. package/src/configurations/components/__tests__/ConfigurationCards.spec.js +22 -13
  17. package/src/configurations/components/__tests__/ConfigurationForm.spec.js +5 -5
  18. package/src/configurations/components/__tests__/ConfigurationLoader.spec.js +44 -36
  19. package/src/configurations/components/__tests__/ConfigurationTokenLoader.spec.js +46 -45
  20. package/src/configurations/components/__tests__/Configurations.spec.js +20 -22
  21. package/src/configurations/components/__tests__/ConfigurationsLoader.spec.js +32 -33
  22. package/src/configurations/components/__tests__/EditConfiguration.spec.js +5 -5
  23. package/src/configurations/components/__tests__/NewConfiguration.spec.js +0 -1
  24. package/src/configurations/components/__tests__/__snapshots__/Configuration.spec.js.snap +122 -57
  25. package/src/configurations/components/__tests__/__snapshots__/ConfigurationCards.spec.js.snap +160 -361
  26. package/src/configurations/components/__tests__/__snapshots__/ConfigurationForm.spec.js.snap +7 -6
  27. package/src/configurations/components/__tests__/__snapshots__/ConfigurationLoader.spec.js.snap +5 -31
  28. package/src/configurations/components/__tests__/__snapshots__/ConfigurationTokenLoader.spec.js.snap +5 -9
  29. package/src/configurations/components/__tests__/__snapshots__/Configurations.spec.js.snap +91 -72
  30. package/src/configurations/components/__tests__/__snapshots__/ConfigurationsLoader.spec.js.snap +5 -27
  31. package/src/configurations/components/__tests__/__snapshots__/EditConfiguration.spec.js.snap +12 -10
  32. package/src/configurations/components/__tests__/__snapshots__/NewConfiguration.spec.js.snap +11 -9
  33. package/src/configurations/components/index.js +1 -1
  34. package/src/configurations/reducers/configurationRedirect.js +1 -1
  35. package/src/configurations/reducers/configurations.js +1 -1
  36. package/src/configurations/reducers/index.js +1 -1
  37. package/src/configurations/reducers/systemConfigurations.js +1 -1
  38. package/src/configurations/sagas/signConfiguration.js +3 -1
  39. package/src/jobs/components/Job.js +0 -1
  40. package/src/jobs/components/JobBreadcrumbs.js +2 -3
  41. package/src/jobs/components/JobLoader.js +2 -2
  42. package/src/jobs/components/JobRoutes.js +28 -40
  43. package/src/jobs/components/JobRow.js +4 -4
  44. package/src/jobs/components/Jobs.js +5 -4
  45. package/src/jobs/components/JobsLabelResults.js +2 -3
  46. package/src/jobs/components/JobsSearch.js +0 -1
  47. package/src/jobs/components/JobsTable.js +3 -3
  48. package/src/jobs/components/JobsView.js +0 -1
  49. package/src/jobs/components/SourceJobs.js +0 -1
  50. package/src/jobs/components/__tests__/Job.spec.js +9 -11
  51. package/src/jobs/components/__tests__/JobBreadcrumbs.spec.js +5 -5
  52. package/src/jobs/components/__tests__/JobLoader.spec.js +12 -12
  53. package/src/jobs/components/__tests__/JobRow.spec.js +21 -20
  54. package/src/jobs/components/__tests__/Jobs.spec.js +1 -7
  55. package/src/jobs/components/__tests__/JobsLoader.spec.js +9 -9
  56. package/src/jobs/components/__tests__/JobsTable.spec.js +33 -28
  57. package/src/jobs/components/__tests__/JobsView.spec.js +1 -7
  58. package/src/jobs/components/__tests__/SourceJobs.spec.js +1 -7
  59. package/src/jobs/components/__tests__/__snapshots__/Job.spec.js.snap +143 -36
  60. package/src/jobs/components/__tests__/__snapshots__/JobBreadcrumbs.spec.js.snap +20 -30
  61. package/src/jobs/components/__tests__/__snapshots__/Jobs.spec.js.snap +10 -23
  62. package/src/jobs/components/__tests__/__snapshots__/JobsTable.spec.js.snap +7 -7
  63. package/src/jobs/components/__tests__/__snapshots__/JobsView.spec.js.snap +12 -24
  64. package/src/jobs/components/__tests__/__snapshots__/SourceJobs.spec.js.snap +8 -21
  65. package/src/jobs/reducers/jobActiveFilters.js +1 -1
  66. package/src/jobs/sagas/fetchJob.js +1 -1
  67. package/src/jobs/selectors/jobColumnsSelector.js +0 -1
  68. package/src/jobs/selectors/sourceJobColumnsSelector.js +0 -1
  69. package/src/sources/components/EditSource.js +0 -1
  70. package/src/sources/components/JobForm.js +1 -1
  71. package/src/sources/components/NewJob.js +0 -1
  72. package/src/sources/components/NewSource.js +0 -1
  73. package/src/sources/components/Source.js +0 -1
  74. package/src/sources/components/SourceActions.js +1 -2
  75. package/src/sources/components/SourceBreadcrumbs.js +1 -2
  76. package/src/sources/components/SourceConfiguration.js +3 -3
  77. package/src/sources/components/SourceDetail.js +46 -50
  78. package/src/sources/components/SourceForm.js +4 -7
  79. package/src/sources/components/SourceHeader.js +0 -1
  80. package/src/sources/components/SourceRoutes.js +30 -23
  81. package/src/sources/components/SourceSelector.js +0 -1
  82. package/src/sources/components/SourceTabs.js +14 -7
  83. package/src/sources/components/Sources.js +2 -2
  84. package/src/sources/components/SourcesTable.js +1 -2
  85. package/src/sources/components/__tests__/EditSource.spec.js +10 -12
  86. package/src/sources/components/__tests__/NewSource.spec.js +5 -10
  87. package/src/sources/components/__tests__/Source.spec.js +19 -27
  88. package/src/sources/components/__tests__/SourceActions.spec.js +1 -2
  89. package/src/sources/components/__tests__/SourceBreadcrumbs.spec.js +0 -1
  90. package/src/sources/components/__tests__/SourceDetail.spec.js +62 -38
  91. package/src/sources/components/__tests__/SourceForm.spec.js +109 -86
  92. package/src/sources/components/__tests__/SourceHeader.spec.js +1 -2
  93. package/src/sources/components/__tests__/SourceRoutes.spec.js +79 -7
  94. package/src/sources/components/__tests__/SourceSelector.spec.js +0 -1
  95. package/src/sources/components/__tests__/SourceTabs.spec.js +3 -4
  96. package/src/sources/components/__tests__/Sources.spec.js +24 -39
  97. package/src/sources/components/__tests__/SourcesTable.spec.js +48 -65
  98. package/src/sources/components/__tests__/__snapshots__/EditSource.spec.js.snap +134 -15
  99. package/src/sources/components/__tests__/__snapshots__/NewSource.spec.js.snap +36 -23
  100. package/src/sources/components/__tests__/__snapshots__/Source.spec.js.snap +28 -31
  101. package/src/sources/components/__tests__/__snapshots__/SourceActions.spec.js.snap +1 -1
  102. package/src/sources/components/__tests__/__snapshots__/SourceBreadcrumbs.spec.js.snap +2 -1
  103. package/src/sources/components/__tests__/__snapshots__/SourceDetail.spec.js.snap +13 -172
  104. package/src/sources/components/__tests__/__snapshots__/SourceForm.spec.js.snap +132 -106
  105. package/src/sources/components/__tests__/__snapshots__/SourceHeader.spec.js.snap +4 -4
  106. package/src/sources/components/__tests__/__snapshots__/SourceRoutes.spec.js.snap +47 -5
  107. package/src/sources/components/__tests__/__snapshots__/SourceTabs.spec.js.snap +5 -3
  108. package/src/sources/components/__tests__/__snapshots__/Sources.spec.js.snap +14 -11
  109. package/src/sources/components/__tests__/__snapshots__/SourcesTable.spec.js.snap +17 -12
  110. package/src/jobs/components/ConfigurationRoutes.js +0 -31
@@ -1,78 +1,97 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<Configurations /> 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
- {
11
- "$$typeof": Symbol(react.forward_ref),
12
- "displayName": "Link",
13
- "propTypes": {
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="configurations.actions.create"
26
- />
27
- }
28
- floated="right"
29
- primary={true}
30
- to="/configurations/new"
31
- />
32
- <Icon
33
- as="i"
34
- circular={true}
35
- name="plug"
36
- />
37
- <HeaderContent>
38
- <MemoizedFormattedMessage
39
- id="configurations.header"
8
+ <h2
9
+ class="ui header"
10
+ >
11
+ <a
12
+ class="ui primary right floated button"
13
+ data-discover="true"
14
+ href="/configurations/new"
15
+ role="button"
16
+ >
17
+ configurations.actions.create
18
+ </a>
19
+ <i
20
+ aria-hidden="true"
21
+ class="plug circular icon"
40
22
  />
41
- <HeaderSubheader>
42
- <MemoizedFormattedMessage
43
- id="configurations.subheader"
44
- />
45
- </HeaderSubheader>
46
- </HeaderContent>
47
- </Header>
48
- <Grid
49
- centered={true}
50
- columns={1}
51
- >
52
- <GridColumn>
53
- <Input
54
- icon={
55
- {
56
- "link": true,
57
- "name": "search",
58
- }
59
- }
60
- onChange={[Function]}
61
- placeholder="configurations.search.placeholder"
62
- type="text"
63
- value=""
64
- />
65
- </GridColumn>
66
- </Grid>
67
- <Connect(ConfigurationCards)
68
- configurations={
69
- [
70
- {
71
- "external_id": "eid1",
72
- "id": 1,
73
- },
74
- ]
75
- }
76
- />
77
- </Segment>
23
+ <div
24
+ class="content"
25
+ >
26
+ configurations.header
27
+ <div
28
+ class="sub header"
29
+ >
30
+ configurations.subheader
31
+ </div>
32
+ </div>
33
+ </h2>
34
+ <div
35
+ class="ui centered one column grid"
36
+ >
37
+ <div
38
+ class="column"
39
+ >
40
+ <div
41
+ class="ui icon input"
42
+ >
43
+ <input
44
+ placeholder="configurations.search.placeholder"
45
+ type="text"
46
+ value=""
47
+ />
48
+ <i
49
+ aria-hidden="true"
50
+ class="search link icon"
51
+ />
52
+ </div>
53
+ </div>
54
+ </div>
55
+ <div
56
+ class="ui cards"
57
+ >
58
+ <div
59
+ class="ui card"
60
+ >
61
+ <div
62
+ class="content"
63
+ >
64
+ <a
65
+ class="header"
66
+ data-discover="true"
67
+ href="/configurations/eid1"
68
+ >
69
+ eid1
70
+ </a>
71
+ <div
72
+ class="description"
73
+ >
74
+ test
75
+ </div>
76
+ </div>
77
+ <div
78
+ class="extra content"
79
+ >
80
+ <div
81
+ class="ui actions"
82
+ >
83
+ <button
84
+ class="ui red basic icon button"
85
+ >
86
+ <i
87
+ aria-hidden="true"
88
+ class="red trash alternate outline icon"
89
+ />
90
+ </button>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </div>
78
97
  `;
@@ -1,31 +1,9 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`<ConfigurationsLoader /> matches the latest snapshot 1`] = `
4
- <ConfigurationsLoader
5
- clearConfigurations={[MockFunction]}
6
- configurationsLoading={true}
7
- fetchConfigurations={
8
- [MockFunction] {
9
- "calls": [
10
- [],
11
- ],
12
- "results": [
13
- {
14
- "type": "return",
15
- "value": undefined,
16
- },
17
- ],
18
- }
19
- }
20
- >
21
- <Loading>
22
- <Loader
23
- active={true}
24
- >
25
- <div
26
- className="ui active loader"
27
- />
28
- </Loader>
29
- </Loading>
30
- </ConfigurationsLoader>
4
+ <div>
5
+ <div
6
+ class="ui active loader"
7
+ />
8
+ </div>
31
9
  `;
@@ -7,9 +7,10 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
7
7
  >
8
8
  <a
9
9
  class="section"
10
+ data-discover="true"
10
11
  href="/configurations"
11
12
  >
12
- Configurations
13
+ navigation.admin.configurations
13
14
  </a>
14
15
  <i
15
16
  aria-hidden="true"
@@ -18,7 +19,7 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
18
19
  <div
19
20
  class="active section"
20
21
  >
21
- Update Configuration
22
+ configurations.actions.update
22
23
  </div>
23
24
  </div>
24
25
  <div
@@ -34,7 +35,7 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
34
35
  <div
35
36
  class="content"
36
37
  >
37
- Update Configuration
38
+ configurations.actions.update
38
39
  </div>
39
40
  </h2>
40
41
  <form
@@ -44,11 +45,11 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
44
45
  class="required field"
45
46
  >
46
47
  <label>
47
- Id Externo
48
+ configuration.props.external_id
48
49
  <div
49
50
  class="ui left pointing label"
50
51
  >
51
- Empty required field
52
+ template.form.validation.empty_required
52
53
  </div>
53
54
  </label>
54
55
  <div
@@ -70,7 +71,7 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
70
71
  class="required field"
71
72
  >
72
73
  <label>
73
- Type
74
+ type.selector.label
74
75
  </label>
75
76
  <div
76
77
  class="disabled required field"
@@ -97,7 +98,7 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
97
98
  class="divider default text"
98
99
  role="alert"
99
100
  >
100
- Source type (template)
101
+ type.selector.placeholder
101
102
  </div>
102
103
  <i
103
104
  aria-hidden="true"
@@ -122,7 +123,7 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
122
123
  <label
123
124
  class="label"
124
125
  >
125
- Content
126
+ configuration.content.label
126
127
  </label>
127
128
  </div>
128
129
  <div
@@ -130,17 +131,18 @@ exports[`<EditConfiguration /> matches the latest snapshot 1`] = `
130
131
  >
131
132
  <a
132
133
  class="ui secondary button"
134
+ data-discover="true"
133
135
  href="/"
134
136
  role="button"
135
137
  >
136
- Cancel
138
+ actions.cancel
137
139
  </a>
138
140
  <button
139
141
  class="ui primary disabled button"
140
142
  disabled=""
141
143
  tabindex="-1"
142
144
  >
143
- Save
145
+ actions.save
144
146
  </button>
145
147
  </div>
146
148
  </form>
@@ -7,9 +7,10 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
7
7
  >
8
8
  <a
9
9
  class="section"
10
+ data-discover="true"
10
11
  href="/configurations"
11
12
  >
12
- Configurations
13
+ navigation.admin.configurations
13
14
  </a>
14
15
  <i
15
16
  aria-hidden="true"
@@ -18,7 +19,7 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
18
19
  <div
19
20
  class="active section"
20
21
  >
21
- Create
22
+ configurations.actions.create
22
23
  </div>
23
24
  </div>
24
25
  <div
@@ -34,7 +35,7 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
34
35
  <div
35
36
  class="content"
36
37
  >
37
- Create
38
+ configurations.actions.create
38
39
  </div>
39
40
  </h2>
40
41
  <form
@@ -44,11 +45,11 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
44
45
  class="required field"
45
46
  >
46
47
  <label>
47
- Id Externo
48
+ configuration.props.external_id
48
49
  <div
49
50
  class="ui left pointing label"
50
51
  >
51
- Empty required field
52
+ template.form.validation.empty_required
52
53
  </div>
53
54
  </label>
54
55
  <div
@@ -68,7 +69,7 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
68
69
  class="required field"
69
70
  >
70
71
  <label>
71
- Type
72
+ type.selector.label
72
73
  </label>
73
74
  <div
74
75
  class="required field"
@@ -95,7 +96,7 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
95
96
  class="divider default text"
96
97
  role="alert"
97
98
  >
98
- Source type (template)
99
+ type.selector.placeholder
99
100
  </div>
100
101
  <i
101
102
  aria-hidden="true"
@@ -119,17 +120,18 @@ exports[`<NewConfiguration /> matches the latest snapshot 1`] = `
119
120
  >
120
121
  <a
121
122
  class="ui secondary button"
123
+ data-discover="true"
122
124
  href="/"
123
125
  role="button"
124
126
  >
125
- Cancel
127
+ actions.cancel
126
128
  </a>
127
129
  <button
128
130
  class="ui primary disabled button"
129
131
  disabled=""
130
132
  tabindex="-1"
131
133
  >
132
- Create
134
+ actions.create
133
135
  </button>
134
136
  </div>
135
137
  </form>
@@ -9,5 +9,5 @@ export {
9
9
  ConfigurationCards,
10
10
  ConfigurationRoutes,
11
11
  ConfigurationsLoader,
12
- ConfigurationTokenLoader
12
+ ConfigurationTokenLoader,
13
13
  };
@@ -3,7 +3,7 @@ import { clearRedirect } from "@truedat/core/routines";
3
3
  import {
4
4
  createConfiguration,
5
5
  deleteConfiguration,
6
- updateConfiguration
6
+ updateConfiguration,
7
7
  } from "../routines";
8
8
 
9
9
  const initialState = "";
@@ -15,7 +15,7 @@ const configurations = (state = initialState, { type, payload }) => {
15
15
  const data = _.propOr({}, "data")(payload);
16
16
  return _.flow(
17
17
  _.map(pickFields),
18
- _.sortBy(s => _.deburr(s.external_id))
18
+ _.sortBy((s) => _.deburr(s.external_id))
19
19
  )(data);
20
20
  }
21
21
  case fetchConfigurations.FAILURE:
@@ -15,5 +15,5 @@ export {
15
15
  configurationTokenLoading,
16
16
  configurationRedirect,
17
17
  configurationToken,
18
- systemConfigurations
18
+ systemConfigurations,
19
19
  };
@@ -13,7 +13,7 @@ const systemConfigurations = (state = initialState, { type, payload }) => {
13
13
  return _.flow(
14
14
  _.propOr({}, "data"),
15
15
  _.map(pickFields),
16
- _.sortBy(s => _.deburr(s.external_id))
16
+ _.sortBy((s) => _.deburr(s.external_id))
17
17
  )(payload);
18
18
  }
19
19
  case fetchConfigurations.FAILURE:
@@ -7,7 +7,9 @@ import { API_CONFIGURATION_SIGN } from "../api";
7
7
  export function* signConfigurationSaga({ payload }) {
8
8
  try {
9
9
  const { external_id, params } = payload;
10
- const url = compile(API_CONFIGURATION_SIGN)({ external_id });
10
+ const url = compile(API_CONFIGURATION_SIGN)({
11
+ external_id: `${external_id}`,
12
+ });
11
13
  const requestData = { payload: params };
12
14
  yield put(signConfiguration.request());
13
15
  const { data } = yield call(apiJsonPost, url, requestData, JSON_OPTS);
@@ -1,5 +1,4 @@
1
1
  import { isEmpty, sortBy } from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
3
  import { useIntl } from "react-intl";
5
4
  import Moment from "react-moment";
@@ -1,7 +1,6 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { Breadcrumb } from "semantic-ui-react";
4
- import { Link } from "react-router-dom";
3
+ import { Link } from "react-router";
5
4
  import { FormattedMessage } from "react-intl";
6
5
  import { connect } from "react-redux";
7
6
  import { JOBS } from "@truedat/core/routes";
@@ -18,7 +17,7 @@ export const JobBreadcrumbs = ({ job }) =>
18
17
  ) : null;
19
18
 
20
19
  JobBreadcrumbs.propTypes = {
21
- job: PropTypes.object
20
+ job: PropTypes.object,
22
21
  };
23
22
 
24
23
  export const mapStateToProps = ({ job }) => ({ job });
@@ -1,7 +1,7 @@
1
1
  import { useEffect } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { connect } from "react-redux";
4
- import { useParams } from "react-router-dom";
4
+ import { useParams } from "react-router";
5
5
  import { clearJob, fetchJob } from "../routines";
6
6
 
7
7
  export const JobLoader = ({ clearJob, fetchJob }) => {
@@ -19,7 +19,7 @@ export const JobLoader = ({ clearJob, fetchJob }) => {
19
19
 
20
20
  JobLoader.propTypes = {
21
21
  clearJob: PropTypes.func,
22
- fetchJob: PropTypes.func
22
+ fetchJob: PropTypes.func,
23
23
  };
24
24
 
25
25
  const mapDispatchToProps = { clearJob, fetchJob };
@@ -1,7 +1,5 @@
1
- import React from "react";
2
- import { Route, Switch } from "react-router-dom";
3
- import { Unauthorized } from "@truedat/core/components";
4
- import { useAuthorized } from "@truedat/core/hooks";
1
+ import { Route, Routes } from "react-router";
2
+ import { ProtectedRoute } from "@truedat/core/router";
5
3
  import { JOB, JOBS } from "@truedat/core/routes";
6
4
  import Job from "./Job";
7
5
  import JobBreadcrumbs from "./JobBreadcrumbs";
@@ -10,41 +8,31 @@ import JobLoader from "./JobLoader";
10
8
  import JobsView from "./JobsView";
11
9
  import JobsLoader from "./JobsLoader";
12
10
 
13
- export const JobRoutes = () => {
14
- const authorized = useAuthorized();
11
+ export default function JobRoutes() {
15
12
  return (
16
- <Route
17
- path={JOBS}
18
- render={() => (
19
- <Switch>
20
- <Route
21
- exact
22
- path={JOB}
23
- render={() => (
24
- <>
25
- <JobLoader />
26
- <JobBreadcrumbs />
27
- <Job />
28
- </>
29
- )}
30
- />
31
- <Route
32
- render={() =>
33
- authorized ? (
34
- <>
35
- <JobsLoader />
36
- <JobFiltersLoader />
37
- <JobsView />
38
- </>
39
- ) : (
40
- <Unauthorized />
41
- )
42
- }
43
- />
44
- </Switch>
45
- )}
46
- />
13
+ <Routes>
14
+ <Route path={JOBS}>
15
+ <Route
16
+ index
17
+ element={
18
+ <ProtectedRoute>
19
+ <JobsLoader />
20
+ <JobFiltersLoader />
21
+ <JobsView />
22
+ </ProtectedRoute>
23
+ }
24
+ />
25
+ <Route
26
+ path=":id"
27
+ element={
28
+ <>
29
+ <JobLoader />
30
+ <JobBreadcrumbs />
31
+ <Job />
32
+ </>
33
+ }
34
+ />
35
+ </Route>
36
+ </Routes>
47
37
  );
48
- };
49
-
50
- export default JobRoutes;
38
+ }
@@ -1,20 +1,20 @@
1
1
  import _ from "lodash/fp";
2
- import React from "react";
3
2
  import PropTypes from "prop-types";
4
- import { useHistory } from "react-router-dom";
3
+ import { useNavigate } from "react-router";
5
4
  import { Table } from "semantic-ui-react";
6
5
  import { columnDecorator } from "@truedat/core/services";
7
6
  import { linkTo } from "@truedat/core/routes";
8
7
 
9
8
  export const JobRow = ({ job, columns }) => {
10
- const history = useHistory();
9
+ const navigate = useNavigate();
11
10
  const id = job?.externalId || job?.external_id;
12
11
  const sourceId = job?.source_id;
13
12
  const url = sourceId
14
13
  ? linkTo.SOURCE_JOB({ sourceId, id })
15
14
  : linkTo.JOB({ id });
15
+
16
16
  return _.isEmpty(columns) || _.isEmpty(job) ? null : (
17
- <Table.Row key={id} onClick={() => history.push(url)}>
17
+ <Table.Row key={id} onClick={() => navigate(url)}>
18
18
  {columns.map((column, i) => (
19
19
  <Table.Cell
20
20
  key={i}
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { connect } from "react-redux";
4
3
  import { Dimmer, Loader } from "semantic-ui-react";
@@ -13,9 +12,11 @@ export const Jobs = ({ columns, jobsLoading }) => (
13
12
  <JobsSearch />
14
13
  <JobSelectedFilters />
15
14
  <Dimmer.Dimmable dimmed={jobsLoading}>
16
- <Dimmer active={jobsLoading} inverted>
17
- <Loader />
18
- </Dimmer>
15
+ {jobsLoading ? (
16
+ <Dimmer active inverted>
17
+ <Loader />
18
+ </Dimmer>
19
+ ) : null}
19
20
  </Dimmer.Dimmable>
20
21
  <JobsLabelResults />
21
22
  <JobsTable columns={columns} />
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { connect } from "react-redux";
4
3
  import { FormattedMessage } from "react-intl";
@@ -19,12 +18,12 @@ export const JobsLabelResults = ({ jobCount, jobsLoading }) => (
19
18
 
20
19
  JobsLabelResults.propTypes = {
21
20
  jobCount: PropTypes.number,
22
- jobsLoading: PropTypes.bool
21
+ jobsLoading: PropTypes.bool,
23
22
  };
24
23
 
25
24
  const mapStateToProps = ({ jobCount, jobsLoading }) => ({
26
25
  jobCount,
27
- jobsLoading
26
+ jobsLoading,
28
27
  });
29
28
 
30
29
  export default connect(mapStateToProps)(JobsLabelResults);
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { connect } from "react-redux";
4
3
  import { Input } from "semantic-ui-react";
@@ -1,5 +1,5 @@
1
1
  import _ from "lodash/fp";
2
- import React, { useEffect } from "react";
2
+ import { useState, useEffect } from "react";
3
3
  import PropTypes from "prop-types";
4
4
  import { connect } from "react-redux";
5
5
  import { Table, Header, Icon } from "semantic-ui-react";
@@ -16,8 +16,8 @@ export const JobsTable = ({
16
16
  jobsSorting,
17
17
  sortJobs,
18
18
  }) => {
19
- const [sortBy, setSortBy] = React.useState(null);
20
- const [direction, setDirection] = React.useState(null);
19
+ const [sortBy, setSortBy] = useState(null);
20
+ const [direction, setDirection] = useState(null);
21
21
  useEffect(() => {
22
22
  const { column, direction } = getSortInfo(jobsSorting);
23
23
  setSortBy(column);
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Header, Icon, Segment } from "semantic-ui-react";
3
2
  import { FormattedMessage, useIntl } from "react-intl";
4
3
  import Jobs from "./Jobs";
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import PropTypes from "prop-types";
3
2
  import { connect } from "react-redux";
4
3
  import { sourceJobColumnsSelector } from "../selectors";