@truedat/dd 4.48.7 → 4.48.8
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/StructureChildrenRelations.js +6 -14
- package/src/components/StructureCrumbs.js +43 -25
- package/src/components/StructureFieldRow.js +12 -10
- package/src/components/StructureFields.js +7 -7
- package/src/components/StructureItem.js +2 -2
- package/src/components/StructureSummary.js +4 -6
- package/src/components/__tests__/StructureFieldRow.spec.js +37 -33
- package/src/components/__tests__/StructureFields.spec.js +26 -27
- package/src/components/__tests__/StructureItem.spec.js +1 -1
- package/src/components/__tests__/StructureItems.spec.js +1 -3
- package/src/components/__tests__/StructureSummary.spec.js +1 -4
- package/src/components/__tests__/__snapshots__/StructureFieldRow.spec.js.snap +71 -74
- package/src/components/__tests__/__snapshots__/StructureFields.spec.js.snap +132 -160
- package/src/messages/en.js +6 -6
- package/src/messages/es.js +6 -6
- package/src/reducers/structure.js +5 -5
- package/src/reducers/structures.js +2 -2
- package/src/selectors/__tests__/getSortedFields.spec.js +11 -11
- package/src/selectors/__tests__/getStructureParent.spec.js +10 -10
- package/src/selectors/getStructureFieldColumns.js +29 -39
- package/src/selectors/getStructureParent.js +2 -7
- package/src/selectors/getStructureSortingCriteria.js +7 -5
- package/src/selectors/structureColumnsSelector.js +2 -6
|
@@ -16,27 +16,22 @@ const translateDecoratorWithDefault = (text, default_text) => (
|
|
|
16
16
|
const typeDecorator = (field) =>
|
|
17
17
|
translateDecoratorWithDefault(`structure.type.${field}`, field);
|
|
18
18
|
|
|
19
|
-
const linkToStructureDecorator = ({
|
|
20
|
-
|
|
21
|
-
name,
|
|
22
|
-
published_note,
|
|
23
|
-
}) => (
|
|
24
|
-
<Link to={linkTo.STRUCTURE({ id })}>
|
|
25
|
-
{_.isEmpty(published_note?.alias) ? name : published_note.alias}
|
|
26
|
-
</Link>
|
|
19
|
+
const linkToStructureDecorator = ({ data_structure_id: id, alias, name }) => (
|
|
20
|
+
<Link to={linkTo.STRUCTURE({ id })}>{_.defaultTo(name)(alias)}</Link>
|
|
27
21
|
);
|
|
28
22
|
|
|
29
23
|
const nullableDecorator = (field) =>
|
|
30
24
|
field
|
|
31
|
-
? translateDecorator("structure.field.nullable.true")
|
|
32
|
-
: translateDecorator("structure.field.nullable.false");
|
|
25
|
+
? translateDecorator("structure.field.metadata.nullable.true")
|
|
26
|
+
: translateDecorator("structure.field.metadata.nullable.false");
|
|
33
27
|
|
|
34
28
|
const hasDfContentDecorator = (has_df_content) =>
|
|
35
|
-
has_df_content
|
|
29
|
+
has_df_content
|
|
30
|
+
? translateDecorator("structure.field.metadata.nullable.true")
|
|
31
|
+
: null;
|
|
36
32
|
|
|
37
33
|
const lineageLinkDecorator = ({ degree, data_structure_id: id }) =>
|
|
38
|
-
id &&
|
|
39
|
-
degree && (
|
|
34
|
+
id && degree ? (
|
|
40
35
|
<Link
|
|
41
36
|
to={
|
|
42
37
|
degree.in
|
|
@@ -46,44 +41,39 @@ const lineageLinkDecorator = ({ degree, data_structure_id: id }) =>
|
|
|
46
41
|
>
|
|
47
42
|
<Icon name="share alternate" />
|
|
48
43
|
</Link>
|
|
49
|
-
);
|
|
44
|
+
) : null;
|
|
50
45
|
|
|
51
46
|
export const linksDecorator = (links) => {
|
|
52
47
|
const sortedLinks = _.sortBy(accentInsensitivePathOrder("name"))(links);
|
|
53
|
-
return (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
</List>
|
|
69
|
-
)
|
|
48
|
+
return _.isEmpty(sortedLinks) ? null : (
|
|
49
|
+
<List>
|
|
50
|
+
{sortedLinks.map((resource, i) => (
|
|
51
|
+
<List.Item key={i}>
|
|
52
|
+
<Link
|
|
53
|
+
to={linkTo.CONCEPT_VERSION({
|
|
54
|
+
business_concept_id: resource.resource_id,
|
|
55
|
+
id: "current",
|
|
56
|
+
})}
|
|
57
|
+
>
|
|
58
|
+
{resource.name}
|
|
59
|
+
</Link>
|
|
60
|
+
</List.Item>
|
|
61
|
+
))}
|
|
62
|
+
</List>
|
|
70
63
|
);
|
|
71
64
|
};
|
|
72
65
|
|
|
73
66
|
export const defaultStructureFieldColumns = [
|
|
74
67
|
{
|
|
75
68
|
name: "name",
|
|
76
|
-
fieldSelector: _.pick(["data_structure_id", "name", "
|
|
69
|
+
fieldSelector: _.pick(["data_structure_id", "name", "alias"]),
|
|
77
70
|
fieldDecorator: linkToStructureDecorator,
|
|
78
71
|
},
|
|
79
|
-
{ name: "type", fieldDecorator: typeDecorator },
|
|
80
|
-
{ name: "precision" },
|
|
81
|
-
{ name: "nullable", fieldDecorator: nullableDecorator },
|
|
72
|
+
{ name: "metadata.type", fieldDecorator: typeDecorator },
|
|
73
|
+
{ name: "metadata.precision" },
|
|
74
|
+
{ name: "metadata.nullable", fieldDecorator: nullableDecorator },
|
|
82
75
|
{ name: "description" },
|
|
83
|
-
{
|
|
84
|
-
name: "has_df_content",
|
|
85
|
-
fieldDecorator: hasDfContentDecorator,
|
|
86
|
-
},
|
|
76
|
+
{ name: "has_df_content", fieldDecorator: hasDfContentDecorator },
|
|
87
77
|
{
|
|
88
78
|
name: "degree",
|
|
89
79
|
fieldSelector: _.pick(["degree", "data_structure_id"]),
|
|
@@ -8,16 +8,11 @@ const systemNavItem = (structure) =>
|
|
|
8
8
|
_.propOr({}, "system"),
|
|
9
9
|
_.pick(["id", "name"]),
|
|
10
10
|
_.set("type", "system"),
|
|
11
|
-
_.set("name", defaultName)
|
|
12
|
-
_.omit(["published_note"])
|
|
11
|
+
_.set("name", defaultName)
|
|
13
12
|
)(structure);
|
|
14
13
|
|
|
15
14
|
const structureNavItem = (structures) =>
|
|
16
|
-
_.flow(
|
|
17
|
-
_.head,
|
|
18
|
-
_.set("name", defaultName),
|
|
19
|
-
_.omit(["published_note"])
|
|
20
|
-
)(structures);
|
|
15
|
+
_.flow(_.head, _.set("name", defaultName))(structures);
|
|
21
16
|
|
|
22
17
|
export const getStructureParent = createSelector(
|
|
23
18
|
[_.propOr({}, "structure"), _.propOr([], "structureParents")],
|
|
@@ -25,7 +25,7 @@ const typeList = [
|
|
|
25
25
|
"attribute",
|
|
26
26
|
"metric",
|
|
27
27
|
"column",
|
|
28
|
-
"field"
|
|
28
|
+
"field",
|
|
29
29
|
];
|
|
30
30
|
|
|
31
31
|
const toWeightedMap = () => {
|
|
@@ -34,9 +34,11 @@ const toWeightedMap = () => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const mapWeights = toWeightedMap();
|
|
37
|
-
const weightFromMap = type => _.prop(type)(mapWeights);
|
|
38
|
-
const weightOrDefault =
|
|
39
|
-
|
|
37
|
+
const weightFromMap = (type) => _.prop(type)(mapWeights);
|
|
38
|
+
const weightOrDefault = (weight) =>
|
|
39
|
+
_.isNil(weight) ? _.size(typeList) : weight;
|
|
40
|
+
const orderCriteria = ({ metadata }) =>
|
|
41
|
+
metadata?.order && _.toInteger(metadata?.order);
|
|
40
42
|
const typeCriteria = ({ type }) =>
|
|
41
43
|
_.flow(lowerDeburr, weightFromMap, weightOrDefault)(type);
|
|
42
44
|
const nameCriteria = ({ name }) => name && lowerDeburr(name).trim();
|
|
@@ -44,7 +46,7 @@ const nameCriteria = ({ name }) => name && lowerDeburr(name).trim();
|
|
|
44
46
|
const defaultStructureSortingCriteria = [
|
|
45
47
|
orderCriteria,
|
|
46
48
|
typeCriteria,
|
|
47
|
-
nameCriteria
|
|
49
|
+
nameCriteria,
|
|
48
50
|
];
|
|
49
51
|
|
|
50
52
|
export const getStructureSortingCriteria = createSelector(
|
|
@@ -14,12 +14,10 @@ const typeTranslateDecorator = ({ type, data_structure_type }) => (
|
|
|
14
14
|
const dateDecorator = (date) => (
|
|
15
15
|
<Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />
|
|
16
16
|
);
|
|
17
|
-
|
|
18
|
-
_.isEmpty(published_note?.alias) ? name : published_note.alias;
|
|
17
|
+
|
|
19
18
|
export const defaultStructureColumns = [
|
|
20
19
|
{
|
|
21
20
|
name: "name",
|
|
22
|
-
fieldSelector: nameFieldSelector,
|
|
23
21
|
sort: { name: "name.sort" },
|
|
24
22
|
width: 2,
|
|
25
23
|
},
|
|
@@ -88,7 +86,5 @@ export const structureRowsSelector = createSelector(
|
|
|
88
86
|
getStructures,
|
|
89
87
|
getStructureColumnNames,
|
|
90
88
|
(structures, columnNames) =>
|
|
91
|
-
_.map(_.pick([...columnNames, "id", "domain_id", "
|
|
92
|
-
structures
|
|
93
|
-
)
|
|
89
|
+
_.map(_.pick([...columnNames, "id", "domain_id", "note"]))(structures)
|
|
94
90
|
);
|