@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 +6 -0
- package/package.json +5 -5
- package/src/components/StructureSelectorInputFieldJoin.js +7 -3
- package/src/components/__tests__/__snapshots__/GrantRequest.spec.js.snap +2 -0
- package/src/messages/en.js +6 -1
- package/src/messages/es.js +5 -1
- package/src/reducers/__tests__/graph.spec.js +1 -1
- package/src/reducers/__tests__/structureImpactGraph.spec.js +5 -5
- package/src/reducers/__tests__/structureLineageGraph.spec.js +5 -5
- package/src/reducers/ddMessage.js +27 -34
- package/src/sagas/__tests__/bulkUpdateStructures.spec.js +1 -1
- package/src/sagas/__tests__/uploadStructures.spec.js +2 -2
- package/src/sagas/bulkUpdateStructures.js +1 -1
- package/src/sagas/uploadStructures.js +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "4.36.
|
|
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.
|
|
88
|
-
"@truedat/core": "4.36.
|
|
89
|
-
"@truedat/df": "4.36.
|
|
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": "
|
|
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 {
|
|
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>
|
package/src/messages/en.js
CHANGED
|
@@ -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":
|
|
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":
|
package/src/messages/es.js
CHANGED
|
@@ -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
|
|
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
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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:
|
|
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({
|
|
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({
|
|
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;
|