@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.
@@ -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
- data_structure_id: id,
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 && translateDecorator("structure.field.nullable.true");
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
- !_.isEmpty(sortedLinks) && (
55
- <List>
56
- {sortedLinks.map((resource, i) => (
57
- <List.Item key={i}>
58
- <Link
59
- to={linkTo.CONCEPT_VERSION({
60
- business_concept_id: resource.resource_id,
61
- id: "current",
62
- })}
63
- >
64
- {resource.name}
65
- </Link>
66
- </List.Item>
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", "published_note"]),
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 = weight => (_.isNil(weight) ? _.size(typeList) : weight);
39
- const orderCriteria = ({ order }) => order && _.toInteger(order);
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
- const nameFieldSelector = ({ name, published_note }) =>
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", "published_note"]))(
92
- structures
93
- )
89
+ _.map(_.pick([...columnNames, "id", "domain_id", "note"]))(structures)
94
90
  );