@truedat/dd 6.16.1 → 6.16.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/package.json +4 -4
- package/src/components/StructureSummary.js +0 -2
- package/src/components/StructuresGrantRequestView.js +0 -1
- package/src/components/__tests__/__snapshots__/StructureSummary.spec.js.snap +0 -2
- package/src/selectors/__tests__/getBusinessConceptsLinksToStructuresColumnsSelector.spec.js +23 -0
- package/src/selectors/getBusinessConceptsLinksToStructuresColumnsSelector.js +86 -0
- package/src/selectors/groupOptionsSelector.js +1 -1
- package/src/selectors/index.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "6.16.
|
|
3
|
+
"version": "6.16.4",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@apollo/client": "^3.7.1",
|
|
91
|
-
"@truedat/auth": "6.
|
|
91
|
+
"@truedat/auth": "6.15.2",
|
|
92
92
|
"@truedat/core": "6.15.2",
|
|
93
|
-
"@truedat/df": "6.
|
|
93
|
+
"@truedat/df": "6.15.2",
|
|
94
94
|
"lodash": "^4.17.21",
|
|
95
95
|
"moment": "^2.29.4",
|
|
96
96
|
"path-to-regexp": "^1.7.0",
|
|
@@ -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": "
|
|
118
|
+
"gitHead": "ecf57a30185b9e353b6e2692702b5599e4425edb"
|
|
119
119
|
}
|
|
@@ -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
|
+
);
|
package/src/selectors/index.js
CHANGED
|
@@ -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,
|