@truedat/cx 4.41.3 → 4.41.4
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.
- package/CHANGELOG.md +11 -0
- package/package.json +4 -4
- package/src/jobs/components/Job.js +11 -11
- package/src/jobs/components/JobRoutes.js +2 -2
- package/src/jobs/components/JobRow.js +7 -3
- package/src/jobs/components/Jobs.js +16 -28
- package/src/jobs/components/JobsTable.js +80 -92
- package/src/jobs/components/JobsView.js +23 -0
- package/src/jobs/components/SourceJobs.js +29 -0
- package/src/jobs/components/__tests__/JobRow.spec.js +44 -23
- package/src/jobs/components/__tests__/Jobs.spec.js +33 -8
- package/src/jobs/components/__tests__/JobsTable.spec.js +50 -81
- package/src/jobs/components/__tests__/JobsView.spec.js +39 -0
- package/src/jobs/components/__tests__/SourceJobs.spec.js +38 -0
- package/src/jobs/components/__tests__/__snapshots__/Job.spec.js.snap +3 -4
- package/src/jobs/components/__tests__/__snapshots__/JobRow.spec.js.snap +40 -32
- package/src/jobs/components/__tests__/__snapshots__/Jobs.spec.js.snap +136 -35
- package/src/jobs/components/__tests__/__snapshots__/JobsTable.spec.js.snap +104 -227
- package/src/jobs/components/__tests__/__snapshots__/JobsView.spec.js.snap +167 -0
- package/src/jobs/components/__tests__/__snapshots__/SourceJobs.spec.js.snap +115 -0
- package/src/jobs/components/index.js +1 -3
- package/src/jobs/selectors/index.js +4 -2
- package/src/jobs/selectors/{getJobColumns.js → jobColumnsSelector.js} +11 -27
- package/src/jobs/selectors/jobRowsSelector.js +14 -0
- package/src/jobs/selectors/sourceJobColumnsSelector.js +35 -0
- package/src/messages/en.js +9 -1
- package/src/messages/es.js +9 -1
- package/src/reducers/cxMessage.js +15 -1
- package/src/sources/api/fragments.js +48 -0
- package/src/sources/api/mutations.js +51 -0
- package/src/sources/api/queries.js +52 -0
- package/src/sources/api.js +1 -2
- package/src/sources/components/EditSource.js +5 -29
- package/src/sources/components/JobForm.js +2 -2
- package/src/sources/components/NewJob.js +10 -23
- package/src/sources/components/Source.js +12 -76
- package/src/sources/components/SourceActions.js +13 -21
- package/src/sources/components/SourceBreadcrumbs.js +1 -1
- package/src/sources/components/SourceConfiguration.js +60 -0
- package/src/sources/components/SourceDetail.js +90 -0
- package/src/sources/components/SourceForm.js +50 -53
- package/src/sources/components/SourceHeader.js +29 -0
- package/src/sources/components/SourceRoutes.js +25 -89
- package/src/sources/components/SourceSelector.js +53 -44
- package/src/sources/components/SourceTabs.js +54 -0
- package/src/sources/components/Sources.js +7 -20
- package/src/sources/components/SourcesTable.js +3 -4
- package/src/sources/components/__tests__/EditSource.spec.js +1 -2
- package/src/sources/components/__tests__/Source.spec.js +1 -1
- package/src/sources/components/__tests__/SourceActions.spec.js +3 -1
- package/src/sources/components/__tests__/SourceDetail.spec.js +45 -0
- package/src/sources/components/__tests__/SourceForm.spec.js +16 -31
- package/src/sources/components/__tests__/SourceHeader.spec.js +16 -0
- package/src/sources/components/__tests__/SourceSelector.spec.js +44 -0
- package/src/sources/components/__tests__/SourceTabs.spec.js +21 -0
- package/src/sources/components/__tests__/Sources.spec.js +5 -2
- package/src/sources/components/__tests__/__snapshots__/EditSource.spec.js.snap +12 -35
- package/src/sources/components/__tests__/__snapshots__/NewSource.spec.js.snap +1 -1
- package/src/sources/components/__tests__/__snapshots__/Source.spec.js.snap +23 -65
- package/src/sources/components/__tests__/__snapshots__/SourceActions.spec.js.snap +1 -1
- package/src/sources/components/__tests__/__snapshots__/SourceDetail.spec.js.snap +154 -0
- package/src/sources/components/__tests__/__snapshots__/SourceForm.spec.js.snap +37 -14
- package/src/sources/components/__tests__/__snapshots__/SourceHeader.spec.js.snap +85 -0
- package/src/sources/components/__tests__/__snapshots__/SourceSelector.spec.js.snap +68 -0
- package/src/sources/components/__tests__/__snapshots__/SourceTabs.spec.js.snap +22 -0
- package/src/sources/components/__tests__/__snapshots__/Sources.spec.js.snap +2 -2
- package/src/sources/components/__tests__/__snapshots__/SourcesTable.spec.js.snap +5 -5
- package/src/sources/components/index.js +1 -4
- package/src/sources/reducers/__tests__/sourceRedirect.spec.js +26 -21
- package/src/sources/reducers/__tests__/sourceUpdateStatus.spec.js +9 -9
- package/src/sources/reducers/index.js +1 -12
- package/src/sources/reducers/sourceRedirect.js +20 -10
- package/src/sources/reducers/sourceUpdateStatus.js +5 -5
- package/src/sources/routines.js +0 -3
- package/src/sources/sagas/__tests__/createSource.spec.js +35 -20
- package/src/sources/sagas/__tests__/deleteSource.spec.js +29 -14
- package/src/sources/sagas/__tests__/disableSource.spec.js +2 -8
- package/src/sources/sagas/__tests__/enableSource.spec.js +2 -8
- package/src/sources/sagas/__tests__/updateSource.spec.js +33 -15
- package/src/sources/sagas/createSource.js +24 -14
- package/src/sources/sagas/deleteSource.js +14 -15
- package/src/sources/sagas/disableSource.js +1 -17
- package/src/sources/sagas/enableSource.js +1 -17
- package/src/sources/sagas/index.js +0 -9
- package/src/sources/sagas/updateSource.js +18 -15
- package/src/sources/components/DynamicSourceForm.js +0 -60
- package/src/sources/components/SourceLoader.js +0 -59
- package/src/sources/components/SourcesLoader.js +0 -39
- package/src/sources/components/__tests__/DynamicSourceForm.spec.js +0 -89
- package/src/sources/components/__tests__/SourceLoader.spec.js +0 -54
- package/src/sources/components/__tests__/SourcesLoader.spec.js +0 -53
- package/src/sources/components/__tests__/__snapshots__/DynamicSourceForm.spec.js.snap +0 -8
- package/src/sources/components/__tests__/__snapshots__/SourceLoader.spec.js.snap +0 -3
- package/src/sources/components/__tests__/__snapshots__/SourcesLoader.spec.js.snap +0 -3
- package/src/sources/reducers/__tests__/source.spec.js +0 -44
- package/src/sources/reducers/__tests__/sourceLoading.spec.js +0 -30
- package/src/sources/reducers/__tests__/sources.spec.js +0 -37
- package/src/sources/reducers/__tests__/sourcesLoading.spec.js +0 -30
- package/src/sources/reducers/source.js +0 -35
- package/src/sources/reducers/sourceLoading.js +0 -16
- package/src/sources/reducers/sources.js +0 -28
- package/src/sources/reducers/sourcesLoading.js +0 -16
- package/src/sources/sagas/__tests__/fetchSource.spec.js +0 -71
- package/src/sources/sagas/__tests__/fetchSources.spec.js +0 -69
- package/src/sources/sagas/__tests__/updateSourceConfig.spec.js +0 -73
- package/src/sources/sagas/fetchSource.js +0 -30
- package/src/sources/sagas/fetchSources.js +0 -26
- package/src/sources/sagas/updateSourceConfig.js +0 -29
|
@@ -5,27 +5,12 @@ import { useIntl } from "react-intl";
|
|
|
5
5
|
import { Link } from "react-router-dom";
|
|
6
6
|
import { Button, Header, Icon, Input, Segment } from "semantic-ui-react";
|
|
7
7
|
import { FormattedMessage } from "react-intl";
|
|
8
|
-
import {
|
|
8
|
+
import { useQuery } from "@apollo/client";
|
|
9
|
+
import { Loading } from "@truedat/core/components";
|
|
9
10
|
import { SOURCES_NEW } from "@truedat/core/routes";
|
|
11
|
+
import { SOURCES_QUERY } from "../api/queries";
|
|
10
12
|
import SourcesTable from "./SourcesTable";
|
|
11
13
|
|
|
12
|
-
export const SOURCES = gql`
|
|
13
|
-
query SOURCES {
|
|
14
|
-
sources {
|
|
15
|
-
id
|
|
16
|
-
externalId
|
|
17
|
-
active
|
|
18
|
-
type
|
|
19
|
-
events(limit: 1) {
|
|
20
|
-
id
|
|
21
|
-
type
|
|
22
|
-
message
|
|
23
|
-
insertedAt
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
14
|
const lowerDeburrTrim = _.flow(_.toLower, _.deburr, _.trim);
|
|
30
15
|
|
|
31
16
|
const sortByExternalId = _.sortBy(({ externalId }) =>
|
|
@@ -35,8 +20,10 @@ const sortByExternalId = _.sortBy(({ externalId }) =>
|
|
|
35
20
|
export const Sources = () => {
|
|
36
21
|
const [searchTerm, setSearchTerm] = useState("");
|
|
37
22
|
const { formatMessage } = useIntl();
|
|
38
|
-
const { loading, error, data } = useQuery(
|
|
39
|
-
|
|
23
|
+
const { loading, error, data } = useQuery(SOURCES_QUERY);
|
|
24
|
+
if (error) return null;
|
|
25
|
+
if (loading) return <Loading />;
|
|
26
|
+
const items = data?.sources;
|
|
40
27
|
const sources =
|
|
41
28
|
searchTerm === ""
|
|
42
29
|
? sortByExternalId(items)
|
|
@@ -27,7 +27,7 @@ export const HeaderRow = () => {
|
|
|
27
27
|
);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
export const SourceRow = ({ active, externalId, type, events }) => {
|
|
30
|
+
export const SourceRow = ({ active, externalId, id, type, events }) => {
|
|
31
31
|
const event = _.head(events);
|
|
32
32
|
const disabled = !active;
|
|
33
33
|
const positive = event?.type === "SUCCEEDED";
|
|
@@ -35,9 +35,7 @@ export const SourceRow = ({ active, externalId, type, events }) => {
|
|
|
35
35
|
return (
|
|
36
36
|
<Table.Row>
|
|
37
37
|
<Table.Cell>
|
|
38
|
-
<Link to={linkTo.SOURCE({
|
|
39
|
-
{externalId}
|
|
40
|
-
</Link>
|
|
38
|
+
<Link to={linkTo.SOURCE({ sourceId: id })}>{externalId}</Link>
|
|
41
39
|
</Table.Cell>
|
|
42
40
|
<Table.Cell disabled={disabled}>{type}</Table.Cell>
|
|
43
41
|
<Table.Cell disabled={disabled}>
|
|
@@ -59,6 +57,7 @@ export const SourceRow = ({ active, externalId, type, events }) => {
|
|
|
59
57
|
SourceRow.propTypes = {
|
|
60
58
|
active: PropTypes.bool,
|
|
61
59
|
externalId: PropTypes.string,
|
|
60
|
+
id: PropTypes.number,
|
|
62
61
|
type: PropTypes.string,
|
|
63
62
|
events: PropTypes.arrayOf(PropTypes.object),
|
|
64
63
|
};
|
|
@@ -15,8 +15,7 @@ describe("<EditSource />", () => {
|
|
|
15
15
|
type: "micro",
|
|
16
16
|
};
|
|
17
17
|
const formatMessage = jest.fn();
|
|
18
|
-
const
|
|
19
|
-
const props = { source, sourceLoading, updateSource, formatMessage };
|
|
18
|
+
const props = { source, updateSource, formatMessage };
|
|
20
19
|
|
|
21
20
|
it("matches the latest snapshot", () => {
|
|
22
21
|
const wrapper = shallow(<EditSource {...props} />);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { Suspense } from "react";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
4
|
+
import en from "../../../messages/en";
|
|
5
|
+
import SourceDetail from "../SourceDetail";
|
|
6
|
+
|
|
7
|
+
const jobs = [
|
|
8
|
+
{
|
|
9
|
+
external_id: "job1",
|
|
10
|
+
source_id: 123,
|
|
11
|
+
end_date: "2022-02-02T00:00:00.000Z",
|
|
12
|
+
type: "catalog",
|
|
13
|
+
status: "SUCCESS",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
external_id: "job2",
|
|
17
|
+
source_id: 123,
|
|
18
|
+
end_date: "2020-02-01T00:00:00.000Z",
|
|
19
|
+
type: "catalog",
|
|
20
|
+
status: "FAILED",
|
|
21
|
+
message: "Something went wrong",
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const source = {
|
|
26
|
+
externalId: "foo",
|
|
27
|
+
id: 123,
|
|
28
|
+
};
|
|
29
|
+
const renderOpts = {
|
|
30
|
+
messages: { en },
|
|
31
|
+
routes: ["/sources/123/jobs"],
|
|
32
|
+
state: { jobs, jobCount: 42 },
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
describe("<SourceDetail />", () => {
|
|
36
|
+
it("matches the latest snapshot (jobs tab)", async () => {
|
|
37
|
+
const { container } = render(
|
|
38
|
+
<Suspense fallback={null}>
|
|
39
|
+
<SourceDetail source={source} />
|
|
40
|
+
</Suspense>,
|
|
41
|
+
renderOpts
|
|
42
|
+
);
|
|
43
|
+
await waitFor(() => expect(container).toMatchSnapshot());
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -3,13 +3,13 @@ import { shallowWithIntl } from "@truedat/test/intl-stub";
|
|
|
3
3
|
import { SourceForm } from "../SourceForm";
|
|
4
4
|
|
|
5
5
|
describe("<SourceForm />", () => {
|
|
6
|
-
const applyTemplate = x => x;
|
|
6
|
+
const applyTemplate = (x) => x;
|
|
7
7
|
const selectTemplate = jest.fn();
|
|
8
8
|
const templatesLoaded = true;
|
|
9
9
|
const source = {
|
|
10
10
|
external_id: "Micro1",
|
|
11
11
|
config: { a: 1 },
|
|
12
|
-
type: "micro"
|
|
12
|
+
type: "micro",
|
|
13
13
|
};
|
|
14
14
|
const template = {
|
|
15
15
|
content: [
|
|
@@ -20,13 +20,13 @@ describe("<SourceForm />", () => {
|
|
|
20
20
|
label: "a",
|
|
21
21
|
name: "a",
|
|
22
22
|
type: "string",
|
|
23
|
-
widget: "string"
|
|
24
|
-
}
|
|
23
|
+
widget: "string",
|
|
24
|
+
},
|
|
25
25
|
],
|
|
26
26
|
id: 36,
|
|
27
27
|
label: "app-admin",
|
|
28
28
|
name: "micro",
|
|
29
|
-
scope: "cx"
|
|
29
|
+
scope: "cx",
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
const templates = [
|
|
@@ -39,13 +39,13 @@ describe("<SourceForm />", () => {
|
|
|
39
39
|
label: "a",
|
|
40
40
|
name: "a",
|
|
41
41
|
type: "string",
|
|
42
|
-
widget: "string"
|
|
43
|
-
}
|
|
42
|
+
widget: "string",
|
|
43
|
+
},
|
|
44
44
|
],
|
|
45
45
|
id: 36,
|
|
46
46
|
label: "app-admin",
|
|
47
47
|
name: "micro",
|
|
48
|
-
scope: "cx"
|
|
48
|
+
scope: "cx",
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
content: [
|
|
@@ -56,7 +56,7 @@ describe("<SourceForm />", () => {
|
|
|
56
56
|
label: "url",
|
|
57
57
|
name: "url_cx",
|
|
58
58
|
type: "url",
|
|
59
|
-
widget: "pair_list"
|
|
59
|
+
widget: "pair_list",
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
cardinality: "?",
|
|
@@ -65,7 +65,7 @@ describe("<SourceForm />", () => {
|
|
|
65
65
|
label: "a",
|
|
66
66
|
name: "a",
|
|
67
67
|
type: "string",
|
|
68
|
-
widget: "string"
|
|
68
|
+
widget: "string",
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
cardinality: "+",
|
|
@@ -74,47 +74,32 @@ describe("<SourceForm />", () => {
|
|
|
74
74
|
label: "lista",
|
|
75
75
|
name: "lista",
|
|
76
76
|
type: "string",
|
|
77
|
-
widget: "string"
|
|
78
|
-
}
|
|
77
|
+
widget: "string",
|
|
78
|
+
},
|
|
79
79
|
],
|
|
80
80
|
id: 35,
|
|
81
81
|
label: "a",
|
|
82
82
|
name: "a",
|
|
83
|
-
scope: "cx"
|
|
84
|
-
}
|
|
83
|
+
scope: "cx",
|
|
84
|
+
},
|
|
85
85
|
];
|
|
86
86
|
|
|
87
87
|
const props = {
|
|
88
88
|
applyTemplate,
|
|
89
|
-
selectTemplate,
|
|
90
89
|
templatesLoaded,
|
|
91
90
|
source,
|
|
92
91
|
template,
|
|
93
|
-
templates
|
|
92
|
+
templates,
|
|
94
93
|
};
|
|
95
94
|
|
|
96
95
|
describe("with multiple templates", () => {
|
|
97
96
|
const wrapper = shallowWithIntl(
|
|
98
|
-
<SourceForm
|
|
99
|
-
templates={templates}
|
|
100
|
-
selectTemplate={selectTemplate}
|
|
101
|
-
{...props}
|
|
102
|
-
/>
|
|
97
|
+
<SourceForm templates={templates} {...props} />
|
|
103
98
|
);
|
|
104
99
|
|
|
105
100
|
it("matches the latest snapshot", () => {
|
|
106
101
|
expect(wrapper).toMatchSnapshot();
|
|
107
102
|
});
|
|
108
|
-
|
|
109
|
-
it("dispatches selectTemplate when template is selected", () => {
|
|
110
|
-
const value = 35;
|
|
111
|
-
expect(selectTemplate.mock.calls.length).toBe(0);
|
|
112
|
-
wrapper
|
|
113
|
-
.find("FormDropdown")
|
|
114
|
-
.last()
|
|
115
|
-
.simulate("change", {}, { value });
|
|
116
|
-
expect(selectTemplate.mock.calls.length).toBe(1);
|
|
117
|
-
});
|
|
118
103
|
});
|
|
119
104
|
|
|
120
105
|
describe("content changes", () => {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import en from "../../../messages/en";
|
|
4
|
+
import SourceHeader from "../SourceHeader";
|
|
5
|
+
|
|
6
|
+
const source = { externalId: "foo", id: 123 };
|
|
7
|
+
const renderOpts = {
|
|
8
|
+
messages: { en },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe("<SourceHeader />", () => {
|
|
12
|
+
it("matches the latest snapshot", () => {
|
|
13
|
+
const { container } = render(<SourceHeader source={source} />, renderOpts);
|
|
14
|
+
expect(container).toMatchSnapshot();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { render } from "@truedat/test/render";
|
|
4
|
+
import { SOURCE_OPTIONS_QUERY } from "../../api/queries";
|
|
5
|
+
import { SourceSelector } from "../SourceSelector";
|
|
6
|
+
|
|
7
|
+
const messages = {
|
|
8
|
+
en: { "source.search.placeholder": "Search source..." },
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
describe("<Sources />", () => {
|
|
12
|
+
const props = {
|
|
13
|
+
loading: false,
|
|
14
|
+
sources: [],
|
|
15
|
+
};
|
|
16
|
+
const config = { databases: ["db1", "db2"] };
|
|
17
|
+
const source1 = {
|
|
18
|
+
id: 123,
|
|
19
|
+
externalId: "aaaa",
|
|
20
|
+
config,
|
|
21
|
+
};
|
|
22
|
+
const source2 = {
|
|
23
|
+
id: 456,
|
|
24
|
+
externalId: "bbbb",
|
|
25
|
+
config: null,
|
|
26
|
+
};
|
|
27
|
+
const sources = [source1, source2];
|
|
28
|
+
const sourcesMock = {
|
|
29
|
+
request: { query: SOURCE_OPTIONS_QUERY },
|
|
30
|
+
result: { data: { sources } },
|
|
31
|
+
};
|
|
32
|
+
const renderOpts = { mocks: [sourcesMock], messages };
|
|
33
|
+
|
|
34
|
+
it("matches the latest snapshot", async () => {
|
|
35
|
+
const { container, getByRole } = render(
|
|
36
|
+
<SourceSelector {...props} />,
|
|
37
|
+
renderOpts
|
|
38
|
+
);
|
|
39
|
+
await waitFor(() => {
|
|
40
|
+
expect(getByRole("option", { name: /aaaa/i })).toBeTruthy();
|
|
41
|
+
});
|
|
42
|
+
expect(container).toMatchSnapshot();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import en from "../../../messages/en";
|
|
4
|
+
import SourceTabs from "../SourceTabs";
|
|
5
|
+
|
|
6
|
+
jest.mock("react-router-dom", () => ({
|
|
7
|
+
...jest.requireActual("react-router-dom"),
|
|
8
|
+
useRouteMatch: () => ({ path: "/sources/123" }),
|
|
9
|
+
}));
|
|
10
|
+
|
|
11
|
+
const source = { externalId: "foo", id: 123 };
|
|
12
|
+
const renderOpts = {
|
|
13
|
+
messages: { en },
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
describe("<SourceTabs />", () => {
|
|
17
|
+
it("matches the latest snapshot", () => {
|
|
18
|
+
const { container } = render(<SourceTabs source={source} />, renderOpts);
|
|
19
|
+
expect(container).toMatchSnapshot();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import userEvent from "@testing-library/user-event";
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
|
-
import {
|
|
4
|
+
import { SOURCES_QUERY } from "../../api/queries";
|
|
5
|
+
import { Sources } from "../Sources";
|
|
5
6
|
|
|
6
7
|
const messages = {
|
|
7
8
|
en: {
|
|
@@ -31,6 +32,7 @@ describe("<Sources />", () => {
|
|
|
31
32
|
insertedAt: "2020-01-01T12:34:56.000Z",
|
|
32
33
|
};
|
|
33
34
|
const source1 = {
|
|
35
|
+
__typename: "Source",
|
|
34
36
|
id: 123,
|
|
35
37
|
externalId: "aaaa",
|
|
36
38
|
active: true,
|
|
@@ -38,6 +40,7 @@ describe("<Sources />", () => {
|
|
|
38
40
|
events: [event],
|
|
39
41
|
};
|
|
40
42
|
const source2 = {
|
|
43
|
+
__typename: "Source",
|
|
41
44
|
id: 456,
|
|
42
45
|
externalId: "bbbb",
|
|
43
46
|
active: true,
|
|
@@ -46,7 +49,7 @@ describe("<Sources />", () => {
|
|
|
46
49
|
};
|
|
47
50
|
const sources = [source1, source2];
|
|
48
51
|
const sourcesMock = {
|
|
49
|
-
request: { query:
|
|
52
|
+
request: { query: SOURCES_QUERY },
|
|
50
53
|
result: { data: { sources } },
|
|
51
54
|
};
|
|
52
55
|
const renderOpts = { mocks: [sourcesMock], messages };
|
|
@@ -1,39 +1,16 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<EditSource /> matches the latest snapshot 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
as="i"
|
|
17
|
-
name="plug"
|
|
18
|
-
/>
|
|
19
|
-
<HeaderContent>
|
|
20
|
-
<MemoizedFormattedMessage
|
|
21
|
-
id="source.actions.edit"
|
|
22
|
-
/>
|
|
23
|
-
</HeaderContent>
|
|
24
|
-
</Header>
|
|
25
|
-
<injectIntl(Connect(SourceForm))
|
|
26
|
-
onSubmit={[MockFunction]}
|
|
27
|
-
source={
|
|
28
|
-
Object {
|
|
29
|
-
"config": Object {
|
|
30
|
-
"a": 1,
|
|
31
|
-
},
|
|
32
|
-
"external_id": "Micro1",
|
|
33
|
-
"type": "micro",
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/>
|
|
37
|
-
</Container>
|
|
38
|
-
</Fragment>
|
|
4
|
+
<injectIntl(SourceFormLoader)
|
|
5
|
+
onSubmit={[MockFunction]}
|
|
6
|
+
source={
|
|
7
|
+
Object {
|
|
8
|
+
"config": Object {
|
|
9
|
+
"a": 1,
|
|
10
|
+
},
|
|
11
|
+
"external_id": "Micro1",
|
|
12
|
+
"type": "micro",
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/>
|
|
39
16
|
`;
|
|
@@ -2,72 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<Source /> matches the latest snapshot 1`] = `
|
|
4
4
|
<Fragment>
|
|
5
|
-
<SourceBreadcrumbs
|
|
6
|
-
text="Micro1"
|
|
7
|
-
/>
|
|
5
|
+
<SourceBreadcrumbs />
|
|
8
6
|
<Segment>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
width={8}
|
|
32
|
-
>
|
|
33
|
-
<Connect(SourceActions) />
|
|
34
|
-
</GridColumn>
|
|
35
|
-
<GridColumn
|
|
36
|
-
width={8}
|
|
37
|
-
>
|
|
38
|
-
<lazy
|
|
39
|
-
editFunctions={
|
|
40
|
-
Object {
|
|
41
|
-
"editingField": undefined,
|
|
42
|
-
"onCancel": [Function],
|
|
43
|
-
"onChange": [Function],
|
|
44
|
-
"onSubmit": [Function],
|
|
45
|
-
"setEditingField": [Function],
|
|
46
|
-
"updateStatus": undefined,
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
template={
|
|
50
|
-
Object {
|
|
51
|
-
"content": Array [
|
|
52
|
-
Object {
|
|
53
|
-
"cardinality": "1",
|
|
54
|
-
"disabled": true,
|
|
55
|
-
"group": "New Group 1",
|
|
56
|
-
"label": "a",
|
|
57
|
-
"name": "a",
|
|
58
|
-
"type": "string",
|
|
59
|
-
"widget": "string",
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
"id": 36,
|
|
63
|
-
"label": "app-admin",
|
|
64
|
-
"name": "micro",
|
|
65
|
-
"scope": "cx",
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
/>
|
|
69
|
-
</GridColumn>
|
|
70
|
-
</Grid>
|
|
7
|
+
<SourceHeader
|
|
8
|
+
source={
|
|
9
|
+
Object {
|
|
10
|
+
"config": Object {
|
|
11
|
+
"a": 1,
|
|
12
|
+
},
|
|
13
|
+
"external_id": "Micro1",
|
|
14
|
+
"type": "micro",
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/>
|
|
18
|
+
<SourceDetail
|
|
19
|
+
source={
|
|
20
|
+
Object {
|
|
21
|
+
"config": Object {
|
|
22
|
+
"a": 1,
|
|
23
|
+
},
|
|
24
|
+
"external_id": "Micro1",
|
|
25
|
+
"type": "micro",
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
71
29
|
</Segment>
|
|
72
30
|
</Fragment>
|
|
73
31
|
`;
|