@truedat/cx 6.6.6 → 6.7.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.
- package/package.json +4 -4
- package/src/configurations/components/__tests__/Configuration.spec.js +8 -8
- package/src/configurations/components/__tests__/ConfigurationForm.spec.js +1 -1
- package/src/configurations/components/__tests__/EditConfiguration.spec.js +5 -1
- package/src/configurations/reducers/__tests__/configuration.spec.js +4 -4
- package/src/configurations/reducers/__tests__/configurations.spec.js +4 -4
- package/src/configurations/reducers/__tests__/systemConfigurations.spec.js +6 -6
- package/src/configurations/sagas/__tests__/createConfiguration.spec.js +5 -5
- package/src/configurations/sagas/__tests__/fetchConfiguration.spec.js +6 -2
- package/src/configurations/sagas/__tests__/updateConfiguration.spec.js +5 -2
- package/src/sources/components/__tests__/EditSource.spec.js +1 -1
- package/src/sources/components/__tests__/Source.spec.js +1 -1
- package/src/sources/components/__tests__/SourceActions.spec.js +1 -1
- package/src/sources/components/__tests__/SourceForm.spec.js +1 -1
- package/src/sources/components/__tests__/SourceSelector.spec.js +1 -1
- package/src/sources/components/__tests__/SourcesTable.spec.js +24 -6
- package/src/sources/components/__tests__/__snapshots__/EditSource.spec.js.snap +4 -1
- package/src/sources/components/__tests__/__snapshots__/Source.spec.js.snap +8 -2
- package/src/sources/sagas/__tests__/createSource.spec.js +5 -2
- package/src/sources/sagas/__tests__/updateSource.spec.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/cx",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "Truedat Web Connectors",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "6.
|
|
37
|
+
"@truedat/test": "6.7.0",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@apollo/client": "^3.7.1",
|
|
94
|
-
"@truedat/core": "6.
|
|
94
|
+
"@truedat/core": "6.7.0",
|
|
95
95
|
"lodash": "^4.17.21",
|
|
96
96
|
"match-sorter": "^6.3.1",
|
|
97
97
|
"moment": "^2.29.4",
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"react-dom": ">= 16.8.6 < 17",
|
|
113
113
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "6a4284b126a917e396160f1b36c03ca0faf6bac5"
|
|
116
116
|
}
|
|
@@ -6,8 +6,8 @@ describe("<Configuration />", () => {
|
|
|
6
6
|
const props = {
|
|
7
7
|
configuration: {
|
|
8
8
|
external_id: "Micro1",
|
|
9
|
-
config: { a: 1 },
|
|
10
|
-
type: "micro"
|
|
9
|
+
config: { a: { value: 1, origin: "user" } },
|
|
10
|
+
type: "micro",
|
|
11
11
|
},
|
|
12
12
|
template: {
|
|
13
13
|
content: [
|
|
@@ -21,17 +21,17 @@ describe("<Configuration />", () => {
|
|
|
21
21
|
label: "a",
|
|
22
22
|
name: "a",
|
|
23
23
|
type: "string",
|
|
24
|
-
widget: "string"
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
24
|
+
widget: "string",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
28
|
],
|
|
29
29
|
id: 36,
|
|
30
30
|
label: "app-admin",
|
|
31
31
|
name: "micro",
|
|
32
|
-
scope: "ca"
|
|
32
|
+
scope: "ca",
|
|
33
33
|
},
|
|
34
|
-
match: { params: { external_id: "Micro" } }
|
|
34
|
+
match: { params: { external_id: "Micro" } },
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
it("matches the latest snapshot", () => {
|
|
@@ -4,7 +4,11 @@ import EditConfiguration from "../EditConfiguration";
|
|
|
4
4
|
|
|
5
5
|
const renderOpts = {
|
|
6
6
|
state: {
|
|
7
|
-
configuration: {
|
|
7
|
+
configuration: {
|
|
8
|
+
id: 1,
|
|
9
|
+
type: "config",
|
|
10
|
+
content: { field: { value: "foo", origin: "user" } },
|
|
11
|
+
},
|
|
8
12
|
configurationLoading: false,
|
|
9
13
|
},
|
|
10
14
|
};
|
|
@@ -19,13 +19,13 @@ describe("reducers: configuration", () => {
|
|
|
19
19
|
it("should handle the fetchConfiguration.SUCCESS action", () => {
|
|
20
20
|
const configuration_obj = {
|
|
21
21
|
external_id: "Micro1",
|
|
22
|
-
content: { a: 1 },
|
|
23
|
-
type: "micro"
|
|
22
|
+
content: { a: { value: 1, origin: "user" } },
|
|
23
|
+
type: "micro",
|
|
24
24
|
};
|
|
25
25
|
expect(
|
|
26
26
|
configuration(fooState, {
|
|
27
27
|
type: fetchConfiguration.SUCCESS,
|
|
28
|
-
payload: { data: configuration_obj }
|
|
28
|
+
payload: { data: configuration_obj },
|
|
29
29
|
})
|
|
30
30
|
).toMatchObject(configuration_obj);
|
|
31
31
|
});
|
|
@@ -39,7 +39,7 @@ describe("reducers: configuration", () => {
|
|
|
39
39
|
it("should handle the clearConfiguration action", () => {
|
|
40
40
|
expect(
|
|
41
41
|
configuration(fooState, {
|
|
42
|
-
type: clearConfiguration.TRIGGER
|
|
42
|
+
type: clearConfiguration.TRIGGER,
|
|
43
43
|
})
|
|
44
44
|
).toEqual({});
|
|
45
45
|
});
|
|
@@ -8,9 +8,9 @@ describe("reducers: configurations", () => {
|
|
|
8
8
|
const data = [
|
|
9
9
|
{
|
|
10
10
|
external_id: "Micro1",
|
|
11
|
-
content: { a: 1 },
|
|
12
|
-
type: "micro"
|
|
13
|
-
}
|
|
11
|
+
content: { a: { value: 1, origin: "user" } },
|
|
12
|
+
type: "micro",
|
|
13
|
+
},
|
|
14
14
|
];
|
|
15
15
|
|
|
16
16
|
it("should provide the initial state", () => {
|
|
@@ -27,7 +27,7 @@ describe("reducers: configurations", () => {
|
|
|
27
27
|
expect(
|
|
28
28
|
configurations(fooState, {
|
|
29
29
|
type: fetchConfigurations.SUCCESS,
|
|
30
|
-
payload: { data }
|
|
30
|
+
payload: { data },
|
|
31
31
|
})
|
|
32
32
|
).toEqual(data);
|
|
33
33
|
});
|
|
@@ -8,14 +8,14 @@ describe("reducers: systemConfigurations", () => {
|
|
|
8
8
|
const data = [
|
|
9
9
|
{
|
|
10
10
|
external_id: "Micro1",
|
|
11
|
-
content: { a: 1 },
|
|
12
|
-
type: "micro"
|
|
11
|
+
content: { a: { value: 1, origin: "user" } },
|
|
12
|
+
type: "micro",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
external_id: "Micro2",
|
|
16
|
-
content: { b: 1 },
|
|
17
|
-
type: "micro"
|
|
18
|
-
}
|
|
16
|
+
content: { b: { value: 1, origin: "user" } },
|
|
17
|
+
type: "micro",
|
|
18
|
+
},
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
it("should provide the initial state", () => {
|
|
@@ -32,7 +32,7 @@ describe("reducers: systemConfigurations", () => {
|
|
|
32
32
|
expect(
|
|
33
33
|
systemConfigurations(fooState, {
|
|
34
34
|
type: fetchConfigurations.SUCCESS,
|
|
35
|
-
payload: { data }
|
|
35
|
+
payload: { data },
|
|
36
36
|
})
|
|
37
37
|
).toEqual(data);
|
|
38
38
|
});
|
|
@@ -3,7 +3,7 @@ import { testSaga } from "redux-saga-test-plan";
|
|
|
3
3
|
import { apiJsonPost, JSON_OPTS } from "@truedat/core/services/api";
|
|
4
4
|
import {
|
|
5
5
|
createConfigurationRequestSaga,
|
|
6
|
-
createConfigurationSaga
|
|
6
|
+
createConfigurationSaga,
|
|
7
7
|
} from "../createConfiguration";
|
|
8
8
|
import { createConfiguration } from "../../routines";
|
|
9
9
|
import { API_CONFIGURATIONS } from "../../api";
|
|
@@ -33,15 +33,15 @@ describe("sagas: createConfigurationSaga", () => {
|
|
|
33
33
|
configuration: {
|
|
34
34
|
type: "tag1",
|
|
35
35
|
external_id: "Micro1",
|
|
36
|
-
config: { a: 1 }
|
|
37
|
-
}
|
|
36
|
+
config: { a: { value: 1, origin: "user" } },
|
|
37
|
+
},
|
|
38
38
|
};
|
|
39
39
|
const request_data = {
|
|
40
40
|
configuration: {
|
|
41
41
|
type: "tag1",
|
|
42
42
|
external_id: "Micro1",
|
|
43
|
-
config: { a: 1 }
|
|
44
|
-
}
|
|
43
|
+
config: { a: { value: 1, origin: "user" } },
|
|
44
|
+
},
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
it("should put a success action when a response is returned", () => {
|
|
@@ -3,7 +3,7 @@ import { testSaga } from "redux-saga-test-plan";
|
|
|
3
3
|
import { apiJson, JSON_OPTS } from "@truedat/core/services/api";
|
|
4
4
|
import {
|
|
5
5
|
fetchConfigurationRequestSaga,
|
|
6
|
-
fetchConfigurationSaga
|
|
6
|
+
fetchConfigurationSaga,
|
|
7
7
|
} from "../fetchConfiguration";
|
|
8
8
|
import { fetchConfiguration } from "../../routines";
|
|
9
9
|
import { API_CONFIGURATION } from "../../api";
|
|
@@ -33,7 +33,11 @@ describe("sagas: fetchConfigurationSaga", () => {
|
|
|
33
33
|
const external_id = "Micro1";
|
|
34
34
|
const url = compile(API_CONFIGURATION)({ external_id });
|
|
35
35
|
const payload = { external_id };
|
|
36
|
-
const data = {
|
|
36
|
+
const data = {
|
|
37
|
+
type: "Micro",
|
|
38
|
+
external_id: "Micro1",
|
|
39
|
+
config: { a: { value: 1, origin: "user" } },
|
|
40
|
+
};
|
|
37
41
|
|
|
38
42
|
expect(() => {
|
|
39
43
|
testSaga(fetchConfigurationSaga, { payload })
|
|
@@ -3,7 +3,7 @@ import { testSaga } from "redux-saga-test-plan";
|
|
|
3
3
|
import { apiJsonPut, JSON_OPTS } from "@truedat/core/services/api";
|
|
4
4
|
import {
|
|
5
5
|
updateConfigurationRequestSaga,
|
|
6
|
-
updateConfigurationSaga
|
|
6
|
+
updateConfigurationSaga,
|
|
7
7
|
} from "../updateConfiguration";
|
|
8
8
|
import { updateConfiguration } from "../../routines";
|
|
9
9
|
import { API_CONFIGURATION } from "../../api";
|
|
@@ -31,7 +31,10 @@ describe("sagas: updateConfigurationRequestSaga", () => {
|
|
|
31
31
|
describe("sagas: updateConfigurationSaga", () => {
|
|
32
32
|
const external_id = "Micro1";
|
|
33
33
|
const url = compile(API_CONFIGURATION)({ external_id });
|
|
34
|
-
const configuration = {
|
|
34
|
+
const configuration = {
|
|
35
|
+
external_id,
|
|
36
|
+
config: { a: { value: 1, origin: "user" } },
|
|
37
|
+
};
|
|
35
38
|
const payload = { configuration };
|
|
36
39
|
const requestData = { configuration };
|
|
37
40
|
|
|
@@ -24,15 +24,33 @@ describe("<SourcesTable />", () => {
|
|
|
24
24
|
externalId: "con_url",
|
|
25
25
|
type: "a",
|
|
26
26
|
config: {
|
|
27
|
-
a: "aaa",
|
|
28
|
-
lista: ["bbb", "ddd"],
|
|
29
|
-
url_cx:
|
|
27
|
+
a: { value: "aaa", origin: "user" },
|
|
28
|
+
lista: { value: ["bbb", "ddd"], origin: "user" },
|
|
29
|
+
url_cx: {
|
|
30
|
+
value: [{ url_name: "google", url_value: "https://google.es" }],
|
|
31
|
+
origin: "user",
|
|
32
|
+
},
|
|
30
33
|
},
|
|
31
34
|
},
|
|
32
35
|
{ id: 2, externalId: "id1", type: "app-admin", config: {} },
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
{
|
|
37
|
+
id: 3,
|
|
38
|
+
externalId: "id2",
|
|
39
|
+
type: "app-admin",
|
|
40
|
+
config: { a: { value: 1, origin: "user" } },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 4,
|
|
44
|
+
externalId: "id3",
|
|
45
|
+
type: "app-admin",
|
|
46
|
+
config: { a: { value: "yyyyb", origin: "user" } },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 5,
|
|
50
|
+
externalId: "id4",
|
|
51
|
+
type: "a",
|
|
52
|
+
config: { lista: { value: ["codigo6"], origin: "user" } },
|
|
53
|
+
},
|
|
36
54
|
];
|
|
37
55
|
|
|
38
56
|
it("matches the latest snapshot", () => {
|
|
@@ -8,7 +8,10 @@ exports[`<Source /> matches the latest snapshot 1`] = `
|
|
|
8
8
|
source={
|
|
9
9
|
{
|
|
10
10
|
"config": {
|
|
11
|
-
"a":
|
|
11
|
+
"a": {
|
|
12
|
+
"origin": "user",
|
|
13
|
+
"value": 1,
|
|
14
|
+
},
|
|
12
15
|
},
|
|
13
16
|
"external_id": "Micro1",
|
|
14
17
|
"type": "micro",
|
|
@@ -19,7 +22,10 @@ exports[`<Source /> matches the latest snapshot 1`] = `
|
|
|
19
22
|
source={
|
|
20
23
|
{
|
|
21
24
|
"config": {
|
|
22
|
-
"a":
|
|
25
|
+
"a": {
|
|
26
|
+
"origin": "user",
|
|
27
|
+
"value": 1,
|
|
28
|
+
},
|
|
23
29
|
},
|
|
24
30
|
"external_id": "Micro1",
|
|
25
31
|
"type": "micro",
|
|
@@ -33,11 +33,14 @@ describe("sagas: createSourceSaga", () => {
|
|
|
33
33
|
const source = {
|
|
34
34
|
type: "tag1",
|
|
35
35
|
external_id: "Micro1",
|
|
36
|
-
config: { a: 1 },
|
|
36
|
+
config: { a: { value: 1, origin: "user" } },
|
|
37
37
|
};
|
|
38
38
|
const payload = { source };
|
|
39
39
|
const variables = {
|
|
40
|
-
source: {
|
|
40
|
+
source: {
|
|
41
|
+
...source,
|
|
42
|
+
config: { value: "stringified config", origin: "user" },
|
|
43
|
+
},
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
it("should put a success action when a response is returned", () => {
|
|
@@ -29,11 +29,14 @@ describe("sagas: updateSourceSaga", () => {
|
|
|
29
29
|
const source = {
|
|
30
30
|
type: "tag1",
|
|
31
31
|
external_id: "Micro1",
|
|
32
|
-
config: { a: 1 },
|
|
32
|
+
config: { a: { value: 1, origin: "user" } },
|
|
33
33
|
};
|
|
34
34
|
const payload = { source };
|
|
35
35
|
const variables = {
|
|
36
|
-
source: {
|
|
36
|
+
source: {
|
|
37
|
+
...source,
|
|
38
|
+
config: { value: "stringified config", origin: "user" },
|
|
39
|
+
},
|
|
37
40
|
};
|
|
38
41
|
|
|
39
42
|
it("should put a success action when a response is returned", () => {
|