@truedat/dd 6.16.0 → 6.16.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truedat/dd",
3
- "version": "6.16.0",
3
+ "version": "6.16.3",
4
4
  "description": "Truedat Web Data Dictionary",
5
5
  "sideEffects": false,
6
6
  "jsnext:main": "src/index.js",
@@ -115,5 +115,5 @@
115
115
  "react-dom": ">= 16.8.6 < 17",
116
116
  "semantic-ui-react": ">= 2.0.3 < 2.2"
117
117
  },
118
- "gitHead": "12471cdcd32bfc11646fa878939d625ed6278a44"
118
+ "gitHead": "9ac7bd2ddab3f16be28269b3203e568c269cbd0e"
119
119
  }
@@ -93,8 +93,6 @@ export const StructureSummary = ({
93
93
  title={shareTitle}
94
94
  name={name}
95
95
  description={description}
96
- icon="structures"
97
- popupType="structures"
98
96
  />
99
97
  {userPermissions.profile_permission &&
100
98
  structureClass === "field" ? (
@@ -17,7 +17,6 @@ import {
17
17
  useDataStructureFilters,
18
18
  useDataStructureSearch,
19
19
  } from "../hooks/useStructures";
20
-
21
20
  import StructuresSearchResults from "./StructuresSearchResults";
22
21
  import StructureGrantCart from "./StructureGrantCart";
23
22
 
@@ -45,7 +45,6 @@ exports[`<StructureSummary /> matches the latest snapshot 1`] = `
45
45
  />
46
46
  <button
47
47
  class="ui basic icon button button icon group-actions"
48
- data-tooltip="Sharing"
49
48
  >
50
49
  <i
51
50
  aria-hidden="true"
@@ -196,7 +195,6 @@ exports[`<StructureSummary /> matches the latest snapshot with alias 1`] = `
196
195
  />
197
196
  <button
198
197
  class="ui basic icon button button icon group-actions"
199
- data-tooltip="Sharing"
200
198
  >
201
199
  <i
202
200
  aria-hidden="true"
@@ -0,0 +1,23 @@
1
+ import {
2
+ defaultBusinessConceptsLinksToStructuresColumns,
3
+ getBusinessConceptsLinksToStructuresColumns,
4
+ } from "..";
5
+
6
+ describe("selectors: getBusinessConceptsLinksToStructuresColumns", () => {
7
+ it("should return custom businessConceptsLinksToStructuresColumns when present", () => {
8
+ const businessConceptsLinksToStructuresColumns = [{ name: "test" }];
9
+ const res = getBusinessConceptsLinksToStructuresColumns({
10
+ businessConceptsLinksToStructuresColumns,
11
+ });
12
+ expect(res).toHaveLength(1);
13
+ expect(res).toEqual(businessConceptsLinksToStructuresColumns);
14
+ });
15
+
16
+ it("should return default getBusinessConceptsLinksToStructuresColumns when no customized", () => {
17
+ const res = getBusinessConceptsLinksToStructuresColumns({});
18
+
19
+ expect(res).toHaveLength(
20
+ defaultBusinessConceptsLinksToStructuresColumns.length
21
+ );
22
+ });
23
+ });
@@ -0,0 +1,86 @@
1
+ import _ from "lodash/fp";
2
+ import React from "react";
3
+ import { Link } from "react-router-dom";
4
+ import { createSelector } from "reselect";
5
+ import { FormattedMessage } from "react-intl";
6
+ import Moment from "react-moment";
7
+ import { linkTo } from "@truedat/core/routes";
8
+
9
+ const typeTranslateDecorator = ({ type }) => (
10
+ <FormattedMessage id={`structure.type.${type}.text`} defaultMessage={type} />
11
+ );
12
+
13
+ const dateDecorator = (date) => (
14
+ <Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />
15
+ );
16
+
17
+ const relationTypeDecorator = _.map((relationTag) => (
18
+ <FormattedMessage
19
+ key={relationTag}
20
+ id={`conceptRelations.relationType.${relationTag}`}
21
+ defaultMessage={relationTag}
22
+ />
23
+ ));
24
+ const pathDecorator = (path) => (
25
+ <span title={_.join(" › ")(path)}>
26
+ {_.flow(_.join(" › "), _.truncate({ length: 90 }))(path)}{" "}
27
+ </span>
28
+ );
29
+
30
+ export const defaultBusinessConceptsLinksToStructuresColumns = [
31
+ {
32
+ name: "name",
33
+ width: 2,
34
+ },
35
+ {
36
+ name: "type",
37
+ fieldSelector: _.pick(["type"]),
38
+ fieldDecorator: typeTranslateDecorator,
39
+ width: 1,
40
+ },
41
+ {
42
+ name: "system",
43
+ fieldSelector: _.path("system.name"),
44
+ width: 1,
45
+ },
46
+ {
47
+ name: "relation.relation_type_name",
48
+ fieldSelector: _.path("tags"),
49
+ fieldDecorator: relationTypeDecorator,
50
+ width: 1,
51
+ },
52
+ { name: "group", width: 1 },
53
+ {
54
+ name: "updated_at",
55
+ fieldDecorator: dateDecorator,
56
+ width: 1,
57
+ },
58
+ {
59
+ name: "relationTags.props.expandable",
60
+ fieldSelector: _.pick(["business_concept_id", "business_concept_name"]),
61
+ fieldDecorator: ({ business_concept_id, business_concept_name }) => {
62
+ return _.isEmpty(business_concept_id) ? (
63
+ <></>
64
+ ) : (
65
+ <Link
66
+ to={linkTo.CONCEPT_VERSION({
67
+ business_concept_id: business_concept_id,
68
+ id: "current",
69
+ })}
70
+ >
71
+ {business_concept_name}
72
+ </Link>
73
+ );
74
+ },
75
+ width: 1,
76
+ },
77
+ {
78
+ name: "path",
79
+ fieldDecorator: pathDecorator,
80
+ },
81
+ ];
82
+
83
+ export const getBusinessConceptsLinksToStructuresColumns = createSelector(
84
+ _.prop("businessConceptsLinksToStructuresColumns"),
85
+ _.defaultTo(defaultBusinessConceptsLinksToStructuresColumns)
86
+ );
@@ -4,7 +4,7 @@ import { createSelector } from "reselect";
4
4
  const groupToOption = ({ external_id: id, name: text }) => ({
5
5
  key: id,
6
6
  text,
7
- value: id
7
+ value: id,
8
8
  });
9
9
 
10
10
  export const groupOptionsSelector = createSelector(
@@ -2,6 +2,10 @@ export {
2
2
  defaultStructureColumns,
3
3
  structureColumnsSelector,
4
4
  } from "./structureColumnsSelector";
5
+ export {
6
+ defaultBusinessConceptsLinksToStructuresColumns,
7
+ getBusinessConceptsLinksToStructuresColumns,
8
+ } from "./getBusinessConceptsLinksToStructuresColumnsSelector";
5
9
  export {
6
10
  getGrantRequestsSearchColumns,
7
11
  defaultGrantRequestsSearchTableColumns,