@truedat/dd 4.36.0 → 4.36.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.36.3] 2022-01-18
4
+
5
+ ### Added
6
+
7
+ - [TD-4100] Allow partial loads for notes in case that there are errors on the file
8
+
3
9
  ## [4.36.0] 2022-01-13
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "4.36.0",
3
+ "version": "4.36.4",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -84,9 +84,9 @@
84
84
  ]
85
85
  },
86
86
  "dependencies": {
87
- "@truedat/auth": "4.36.0",
88
- "@truedat/core": "4.36.0",
89
- "@truedat/df": "4.36.0",
87
+ "@truedat/auth": "4.36.4",
88
+ "@truedat/core": "4.36.4",
89
+ "@truedat/df": "4.36.4",
90
90
  "lodash": "^4.17.21",
91
91
  "path-to-regexp": "^1.7.0",
92
92
  "prop-types": "^15.7.2",
@@ -107,5 +107,5 @@
107
107
  "react-dom": ">= 16.8.6 < 17",
108
108
  "semantic-ui-react": ">= 0.88.2 < 2.1"
109
109
  },
110
- "gitHead": "6bf7c33362c73f97c8e5ff61f19c694ef28a0c3d"
110
+ "gitHead": "4dbf4f9e5188b82b17d053b65e76506e60aa6722"
111
111
  }
@@ -124,10 +124,14 @@ export const StructureSelectorInputFieldJoin = ({
124
124
  ];
125
125
  const deleteClause = (idx) => handleSelectField(removeAt(clauses, idx));
126
126
  const handleChange = (prop, idx) => (data) => {
127
- const { data_structure_id: id, parent_index: parent_index } = data;
127
+ const {
128
+ data_structure_id: id,
129
+ parent_index: parent_index,
130
+ name: name,
131
+ } = data;
128
132
  const newClause = _.isNil(parent_index)
129
- ? { ...clauses[idx], [prop]: { id } }
130
- : { ...clauses[idx], [prop]: { id, parent_index } };
133
+ ? { ...clauses[idx], [prop]: { id, name } }
134
+ : { ...clauses[idx], [prop]: { id, parent_index, name } };
131
135
  const newClauses = _.set(`[${idx}]`, newClause)(clauses);
132
136
  handleSelectField(newClauses);
133
137
  };
@@ -294,6 +294,7 @@ exports[`<GrantRequest /> matches the latest snapshot with approve actions 1`] =
294
294
  <span
295
295
  class="highlighted"
296
296
  >
297
+
297
298
  "foo"
298
299
  </span>
299
300
  </a>
@@ -560,6 +561,7 @@ exports[`<GrantRequest /> matches the latest snapshot with failed status 1`] = `
560
561
  <span
561
562
  class="highlighted"
562
563
  >
564
+
563
565
  "foo"
564
566
  </span>
565
567
  </a>
@@ -366,7 +366,12 @@ export default {
366
366
  "structures.bulkUpdateStructures.no.structures.body":
367
367
  "No structures selected",
368
368
  "structures.bulkUpdateStructures.no.structures.header": "Empty Search",
369
- "structures.bulkUpdateStructures.success.header": "Succeded Bulk Update",
369
+ "structures.bulkUpdateStructures.success.header":
370
+ "Bulk update success! Loaded {count_ids} omitted {count_errors}",
371
+ "structures.bulkUpdateStructures.success.errors":
372
+ "Error in id {id}, in {name} attribute: {key} message: {message}",
373
+ "structures.bulkUploadStructures.success.errors":
374
+ "Error in line {row}, in {name} attribute: {key} message: {message}",
370
375
  "structures.bulkUpdateStructures.success.unchanged":
371
376
  "{unchanged} structures remained unchanged.",
372
377
  "structures.bulkUpdateStructures.success.updated":
@@ -370,7 +370,11 @@ export default {
370
370
  "Ninguna estructura seleccionada",
371
371
  "structures.bulkUpdateStructures.no.structures.header": "Búsqueda vacía",
372
372
  "structures.bulkUpdateStructures.success.header":
373
- "Actualización terminada con éxito",
373
+ "¡Actualización realizada correctamente! subidos {count_ids} errores {count_errors}",
374
+ "structures.bulkUpdateStructures.success.errors":
375
+ "Error en id {id}, en {name} atributo: {key} mensaje: {message}",
376
+ "structures.bulkUploadStructures.success.errors":
377
+ "Error en linea {row}, en {name} atributo: {key} mensaje: {message}",
374
378
  "structures.bulkUpdateStructures.success.unchanged":
375
379
  "{unchanged} se han mantenido sin cambios.",
376
380
  "structures.bulkUpdateStructures.success.updated":
@@ -3,7 +3,7 @@ import {
3
3
  clearGraph,
4
4
  clearStructure,
5
5
  fetchGraph,
6
- fetchStructure
6
+ fetchStructure,
7
7
  } from "../../routines";
8
8
 
9
9
  const fooState = { foo: "bar" };
@@ -3,7 +3,7 @@ import {
3
3
  clearStructure,
4
4
  fetchStructure,
5
5
  fetchStructureGraph,
6
- createGraph
6
+ createGraph,
7
7
  } from "../../routines";
8
8
 
9
9
  const fooState = { foo: "bar" };
@@ -31,7 +31,7 @@ describe("reducers: structureImpactGraph", () => {
31
31
  expect(
32
32
  structureImpactGraph(fooState, {
33
33
  type: fetchStructureGraph.SUCCESS,
34
- payload
34
+ payload,
35
35
  })
36
36
  ).toBe(data);
37
37
  });
@@ -42,7 +42,7 @@ describe("reducers: structureImpactGraph", () => {
42
42
  expect(
43
43
  structureImpactGraph(fooState, {
44
44
  type: createGraph.SUCCESS,
45
- payload
45
+ payload,
46
46
  })
47
47
  ).toBe(data);
48
48
  });
@@ -53,7 +53,7 @@ describe("reducers: structureImpactGraph", () => {
53
53
  expect(
54
54
  structureImpactGraph(fooState, {
55
55
  type: createGraph.SUCCESS,
56
- payload
56
+ payload,
57
57
  })
58
58
  ).toBe(fooState);
59
59
  });
@@ -64,7 +64,7 @@ describe("reducers: structureImpactGraph", () => {
64
64
  expect(
65
65
  structureImpactGraph(fooState, {
66
66
  type: fetchStructureGraph.SUCCESS,
67
- payload
67
+ payload,
68
68
  })
69
69
  ).toBe(fooState);
70
70
  });
@@ -31,7 +31,7 @@ describe("reducers: structureLineageGraph", () => {
31
31
  expect(
32
32
  structureLineageGraph(fooState, {
33
33
  type: fetchStructureGraph.SUCCESS,
34
- payload
34
+ payload,
35
35
  })
36
36
  ).toBe(data);
37
37
  });
@@ -42,7 +42,7 @@ describe("reducers: structureLineageGraph", () => {
42
42
  expect(
43
43
  structureLineageGraph(fooState, {
44
44
  type: createGraph.SUCCESS,
45
- payload
45
+ payload,
46
46
  })
47
47
  ).toBe(data);
48
48
  });
@@ -53,7 +53,7 @@ describe("reducers: structureLineageGraph", () => {
53
53
  expect(
54
54
  structureLineageGraph(fooState, {
55
55
  type: fetchStructureGraph.SUCCESS,
56
- payload
56
+ payload,
57
57
  })
58
58
  ).toBe(fooState);
59
59
  });
@@ -64,7 +64,7 @@ describe("reducers: structureLineageGraph", () => {
64
64
  expect(
65
65
  structureLineageGraph(fooState, {
66
66
  type: createGraph.SUCCESS,
67
- payload
67
+ payload,
68
68
  })
69
69
  ).toBe(fooState);
70
70
  });
@@ -75,7 +75,7 @@ describe("reducers: structureLineageGraph", () => {
75
75
  expect(
76
76
  structureLineageGraph(fooState, {
77
77
  type: fetchStructureGraph.SUCCESS,
78
- payload
78
+ payload,
79
79
  })
80
80
  ).toBe(fooState);
81
81
  });
@@ -12,27 +12,39 @@ const ddMessage = (state = initialState, { type, payload }) => {
12
12
  switch (type) {
13
13
  case dismissAlert.TRIGGER:
14
14
  return initialState;
15
+ case uploadStructures.SUCCESS:
15
16
  case bulkUpdateStructures.SUCCESS: {
16
- const { data, structureCount } = payload;
17
- const changedMessage = {
18
- id: "structures.bulkUpdateStructures.success.updated",
19
- fields: { changed: _.size(data.message) },
20
- };
21
- const unchangedMessage = {
22
- id: "structures.bulkUpdateStructures.success.unchanged",
23
- fields: { unchanged: structureCount - _.size(data.message) },
24
- };
25
- const messages =
26
- structureCount - _.size(data.message) > 0
27
- ? [changedMessage, unchangedMessage]
28
- : [changedMessage];
17
+ const messagesImp = _.has("errors")(payload.data)
18
+ ? _.flow(
19
+ _.propOr([], "errors"),
20
+ _.map((error) => ({
21
+ id:
22
+ type == bulkUpdateStructures.SUCCESS
23
+ ? "structures.bulkUpdateStructures.success.errors"
24
+ : "structures.bulkUploadStructures.success.errors",
25
+ fields: {
26
+ name: error.implementation_key,
27
+ key: Object.keys(error.message)[0],
28
+ message: error.message[Object.keys(error.message)[0]][0],
29
+ row: error.row,
30
+ id: error.id,
31
+ },
32
+ defaultMessage:
33
+ "structures.bulkUpdateStructures.success.errors.default",
34
+ }))
35
+ )(payload.data)
36
+ : "";
29
37
  return {
30
38
  error: false,
31
39
  header: "structures.bulkUpdateStructures.success.header",
32
40
  icon: "check",
33
- color: "green",
41
+ color: payload.data.errors.length >= 1 ? "orange" : "green",
34
42
  text: "",
35
- messages: messages,
43
+ messages: messagesImp,
44
+ fields: {
45
+ count_ids: payload.data.ids.length,
46
+ count_errors: payload.data.errors.length,
47
+ },
36
48
  };
37
49
  }
38
50
  case updateStructureType.SUCCESS:
@@ -42,25 +54,6 @@ const ddMessage = (state = initialState, { type, payload }) => {
42
54
  icon: "check",
43
55
  color: "green",
44
56
  };
45
- case uploadStructures.SUCCESS: {
46
- const { data } = payload;
47
- const count = _.flow(_.prop("message"), _.size)(data);
48
- const content =
49
- count === 0
50
- ? "structures.uploadStructures.success.content.any"
51
- : count === 1
52
- ? "structures.uploadStructures.success.content.single"
53
- : "structures.uploadStructures.success.content";
54
- return {
55
- error: false,
56
- header: "structures.uploadStructures.success.header",
57
- content,
58
- icon: "check",
59
- color: "green",
60
- text: "",
61
- fields: { count },
62
- };
63
- }
64
57
  case uploadStructures.FAILURE:
65
58
  if (payload.status != 500) {
66
59
  const { data } = payload;
@@ -55,7 +55,7 @@ describe("sagas: bulkUpdateStructuresSaga", () => {
55
55
  .next()
56
56
  .call(apiJsonPost, API_DATA_STRUCTURES_BULK_UPDATE, body, JSON_OPTS)
57
57
  .next({ data })
58
- .put(bulkUpdateStructures.success({ ...data, structureCount }))
58
+ .put(bulkUpdateStructures.success({ data }))
59
59
  .next()
60
60
  .put(bulkUpdateStructures.fulfill())
61
61
  .next()
@@ -2,7 +2,7 @@ import { testSaga } from "redux-saga-test-plan";
2
2
  import { apiJsonPost, UPLOAD_JSON_OPTS } from "@truedat/core/services/api";
3
3
  import {
4
4
  uploadStructuresRequestSaga,
5
- uploadStructuresSaga
5
+ uploadStructuresSaga,
6
6
  } from "../uploadStructures";
7
7
  import { uploadStructures } from "../../routines";
8
8
  import { API_STRUCTURES_UPLOAD } from "../../api";
@@ -39,7 +39,7 @@ describe("sagas: uploadStructuresSaga", () => {
39
39
  .next()
40
40
  .call(apiJsonPost, API_STRUCTURES_UPLOAD, body, UPLOAD_JSON_OPTS)
41
41
  .next({ data })
42
- .put(uploadStructures.success(data))
42
+ .put(uploadStructures.success({ data }))
43
43
  .next()
44
44
  .put(uploadStructures.fulfill())
45
45
  .next()
@@ -22,7 +22,7 @@ export function* bulkUpdateStructuresSaga({ payload }) {
22
22
  body,
23
23
  JSON_OPTS
24
24
  );
25
- yield put(bulkUpdateStructures.success({ ...data, structureCount }));
25
+ yield put(bulkUpdateStructures.success({ data }));
26
26
  } catch (error) {
27
27
  if (error.response) {
28
28
  const { status, data } = error.response;
@@ -14,7 +14,7 @@ export function* uploadStructuresSaga({ payload }) {
14
14
  UPLOAD_JSON_OPTS
15
15
  );
16
16
 
17
- yield put(uploadStructures.success(data));
17
+ yield put(uploadStructures.success({ data }));
18
18
  } catch (error) {
19
19
  if (error.response) {
20
20
  const { status, data } = error.response;