@truedat/dd 8.5.3 → 8.5.6
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 +3 -3
- package/src/selectors/getParsedEvents.js +12 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.6",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
52
|
"@testing-library/react": "^16.3.0",
|
|
53
53
|
"@testing-library/user-event": "^14.6.1",
|
|
54
|
-
"@truedat/test": "8.5.
|
|
54
|
+
"@truedat/test": "8.5.6",
|
|
55
55
|
"identity-obj-proxy": "^3.0.0",
|
|
56
56
|
"jest": "^29.7.0",
|
|
57
57
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"svg-pan-zoom": "^3.6.2",
|
|
87
87
|
"swr": "^2.3.3"
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "41e5e6138f5622558bae4151e720c040c4581162"
|
|
90
90
|
}
|
|
@@ -5,7 +5,7 @@ const getEvents = ({ events }) => events;
|
|
|
5
5
|
|
|
6
6
|
const getTemplate = ({ structure, templates }) =>
|
|
7
7
|
_.find(
|
|
8
|
-
(t) => _.path("structure_type.template_id")(structure) == _.prop("id")(t)
|
|
8
|
+
(t) => _.path("structure_type.template_id")(structure) == _.prop("id")(t),
|
|
9
9
|
)(templates);
|
|
10
10
|
|
|
11
11
|
const transformFieldFormat = (field) =>
|
|
@@ -40,7 +40,7 @@ const getFieldLabel = (field, fields) =>
|
|
|
40
40
|
_.flow(
|
|
41
41
|
_.find((f) => _.prop("name")(f) == field),
|
|
42
42
|
_.defaultTo({}),
|
|
43
|
-
_.prop("label")
|
|
43
|
+
_.prop("label"),
|
|
44
44
|
)(fields) || field;
|
|
45
45
|
|
|
46
46
|
const payloadForAction = (action, content, fields, fieldsWithoutValue) =>
|
|
@@ -52,7 +52,7 @@ const payloadForAction = (action, content, fields, fieldsWithoutValue) =>
|
|
|
52
52
|
field: getFieldLabel(field, fields),
|
|
53
53
|
value: transformContentField(field, value, fieldsWithoutValue),
|
|
54
54
|
action,
|
|
55
|
-
}))
|
|
55
|
+
})),
|
|
56
56
|
)(content);
|
|
57
57
|
|
|
58
58
|
const buildUpdatePayload = (payload, template) => {
|
|
@@ -64,53 +64,47 @@ const buildUpdatePayload = (payload, template) => {
|
|
|
64
64
|
const templateFields = _.flow(
|
|
65
65
|
_.prop("content"),
|
|
66
66
|
_.map(_.prop("fields")),
|
|
67
|
-
_.flatten
|
|
67
|
+
_.flatten,
|
|
68
68
|
)(template);
|
|
69
69
|
|
|
70
70
|
const fieldsWithoutValue = _.flow(
|
|
71
71
|
_.filter((f) =>
|
|
72
|
-
_.includes(_.prop("type")(f))([
|
|
73
|
-
"enriched_text",
|
|
74
|
-
"url",
|
|
75
|
-
"table",
|
|
76
|
-
"system",
|
|
77
|
-
"image",
|
|
78
|
-
])
|
|
72
|
+
_.includes(_.prop("type")(f))(["url", "table", "system", "image"]),
|
|
79
73
|
),
|
|
80
|
-
_.map(_.prop("name"))
|
|
74
|
+
_.map(_.prop("name")),
|
|
81
75
|
)(templateFields);
|
|
82
76
|
|
|
83
77
|
const added = payloadForAction(
|
|
84
78
|
"added",
|
|
85
79
|
content,
|
|
86
80
|
templateFields,
|
|
87
|
-
fieldsWithoutValue
|
|
81
|
+
fieldsWithoutValue,
|
|
88
82
|
);
|
|
89
83
|
|
|
90
84
|
const changed = payloadForAction(
|
|
91
85
|
"changed",
|
|
92
86
|
content,
|
|
93
87
|
templateFields,
|
|
94
|
-
fieldsWithoutValue
|
|
88
|
+
fieldsWithoutValue,
|
|
95
89
|
);
|
|
96
90
|
|
|
97
91
|
const removed = payloadForAction(
|
|
98
92
|
"removed",
|
|
99
93
|
content,
|
|
100
94
|
templateFields,
|
|
101
|
-
fieldsWithoutValue
|
|
95
|
+
fieldsWithoutValue,
|
|
102
96
|
);
|
|
103
97
|
|
|
104
98
|
const fields = _.flow(
|
|
105
99
|
_.toPairs,
|
|
106
100
|
_.filter(
|
|
107
|
-
([k]) => k != "content" && k != "df_content" && k != "last_change_by"
|
|
101
|
+
([k]) => k != "content" && k != "df_content" && k != "last_change_by",
|
|
108
102
|
),
|
|
109
103
|
_.map(([k, v]) => ({
|
|
110
104
|
field: k,
|
|
111
105
|
action: "changed",
|
|
112
106
|
value: transformFieldFormat(v),
|
|
113
|
-
}))
|
|
107
|
+
})),
|
|
114
108
|
)(payload);
|
|
115
109
|
|
|
116
110
|
return [...fields, ...added, ...changed, ...removed];
|
|
@@ -259,7 +253,7 @@ const getParsedEvents = createSelector(
|
|
|
259
253
|
};
|
|
260
254
|
}
|
|
261
255
|
})(events);
|
|
262
|
-
}
|
|
256
|
+
},
|
|
263
257
|
);
|
|
264
258
|
|
|
265
259
|
export { getParsedEvents };
|