@truedat/cx 6.6.5 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/cx",
3
- "version": "6.6.5",
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.6.5",
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.6.5",
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": "875dcb0716cc64d30974106dc64c861d4306fcd6"
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", () => {
@@ -39,7 +39,7 @@ describe("<ConfigurationForm />", () => {
39
39
  external_id: "ext1",
40
40
  type: "test_config",
41
41
  content: {
42
- new_field: "value",
42
+ new_field: { value: "value", origin: "user" },
43
43
  },
44
44
  };
45
45
  const props = { onSubmit, configuration };
@@ -4,7 +4,11 @@ import EditConfiguration from "../EditConfiguration";
4
4
 
5
5
  const renderOpts = {
6
6
  state: {
7
- configuration: { id: 1, type: "config", content: { field: "foo" } },
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 = { type: "Micro", external_id: "Micro1", config: { a: 1 } };
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 = { external_id, config: { a: 1 } };
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
 
@@ -11,7 +11,7 @@ describe("<EditSource />", () => {
11
11
  const updateSource = jest.fn();
12
12
  const source = {
13
13
  external_id: "Micro1",
14
- config: { a: 1 },
14
+ config: { a: { value: 1, origin: "user" } },
15
15
  type: "micro",
16
16
  };
17
17
  const formatMessage = jest.fn();
@@ -7,7 +7,7 @@ describe("<Source />", () => {
7
7
  updateSource: jest.fn(),
8
8
  source: {
9
9
  external_id: "Micro1",
10
- config: { a: 1 },
10
+ config: { a: { value: 1, origin: "user" } },
11
11
  type: "micro",
12
12
  },
13
13
  template: {
@@ -24,7 +24,7 @@ describe("<SourceActions />", () => {
24
24
  __typename: "Source",
25
25
  id: 123,
26
26
  externalId: "Micro1",
27
- config: { a: 1 },
27
+ config: { a: { value: 1, origin: "user" } },
28
28
  type: "micro",
29
29
  };
30
30
  const props = {
@@ -7,7 +7,7 @@ describe("<SourceForm />", () => {
7
7
  const templatesLoaded = true;
8
8
  const source = {
9
9
  external_id: "Micro1",
10
- config: { a: 1 },
10
+ config: { a: { value: 1, origin: "user" } },
11
11
  type: "micro",
12
12
  };
13
13
  const template = {
@@ -13,7 +13,7 @@ describe("<Sources />", () => {
13
13
  loading: false,
14
14
  sources: [],
15
15
  };
16
- const config = { databases: ["db1", "db2"] };
16
+ const config = { databases: { value: ["db1", "db2"], origin: "user" } };
17
17
  const source1 = {
18
18
  id: 123,
19
19
  externalId: "aaaa",
@@ -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: [{ url_name: "google", url_value: "https://google.es" }],
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
- { id: 3, externalId: "id2", type: "app-admin", config: { a: 1 } },
34
- { id: 4, externalId: "id3", type: "app-admin", config: { a: "yyyyb" } },
35
- { id: 5, externalId: "id4", type: "a", config: { lista: ["codigo6"] } },
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", () => {
@@ -6,7 +6,10 @@ exports[`<EditSource /> matches the latest snapshot 1`] = `
6
6
  source={
7
7
  {
8
8
  "config": {
9
- "a": 1,
9
+ "a": {
10
+ "origin": "user",
11
+ "value": 1,
12
+ },
10
13
  },
11
14
  "external_id": "Micro1",
12
15
  "type": "micro",
@@ -8,7 +8,10 @@ exports[`<Source /> matches the latest snapshot 1`] = `
8
8
  source={
9
9
  {
10
10
  "config": {
11
- "a": 1,
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": 1,
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: { ...source, config: "stringified config" },
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: { ...source, config: "stringified config" },
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", () => {