@truedat/bg 7.5.1 → 7.5.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 +6 -6
- package/src/concepts/components/ConceptArchiveRow.js +5 -5
- package/src/concepts/components/ConceptSummary.js +43 -11
- package/src/concepts/components/__tests__/ConceptArchive.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptArchiveRow.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptRow.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptSummary.spec.js +37 -0
- package/src/concepts/components/__tests__/Concepts.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptsPanel.spec.js +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptArchive.spec.js.snap +1 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptArchiveRow.spec.js.snap +7 -1
- package/src/concepts/components/__tests__/__snapshots__/ConceptSummary.spec.js.snap +99 -0
- package/src/concepts/reducers/__tests__/conceptArchive.spec.js +2 -2
- package/src/concepts/reducers/concept.js +2 -0
- package/src/concepts/reducers/conceptArchive.js +2 -2
- package/src/concepts/selectors/getConceptColumns.js +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/bg",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.3",
|
|
4
4
|
"description": "Truedat Web Business Glossary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"jsnext:main": "src/index.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@testing-library/jest-dom": "^5.16.5",
|
|
35
35
|
"@testing-library/react": "^12.0.0",
|
|
36
36
|
"@testing-library/user-event": "^13.2.1",
|
|
37
|
-
"@truedat/test": "7.5.
|
|
37
|
+
"@truedat/test": "7.5.3",
|
|
38
38
|
"babel-jest": "^28.1.0",
|
|
39
39
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
40
40
|
"babel-plugin-lodash": "^3.3.4",
|
|
@@ -86,9 +86,9 @@
|
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"dependencies": {
|
|
89
|
-
"@truedat/core": "7.5.
|
|
90
|
-
"@truedat/df": "7.5.
|
|
91
|
-
"@truedat/lm": "7.5.
|
|
89
|
+
"@truedat/core": "7.5.3",
|
|
90
|
+
"@truedat/df": "7.5.3",
|
|
91
|
+
"@truedat/lm": "7.5.3",
|
|
92
92
|
"decode-uri-component": "^0.2.2",
|
|
93
93
|
"file-saver": "^2.0.5",
|
|
94
94
|
"moment": "^2.29.4",
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"react-dom": ">= 16.8.6 < 17",
|
|
112
112
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
113
113
|
},
|
|
114
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "0493d9170268bd7cae7874b0f6d3b251f730e7a0"
|
|
115
115
|
}
|
|
@@ -11,8 +11,8 @@ export const ConceptArchiveRow = ({
|
|
|
11
11
|
business_concept_id,
|
|
12
12
|
id,
|
|
13
13
|
status,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
bcv_last_change_at,
|
|
15
|
+
bcv_last_change_by,
|
|
16
16
|
version,
|
|
17
17
|
}) => {
|
|
18
18
|
const history = useHistory();
|
|
@@ -31,8 +31,8 @@ export const ConceptArchiveRow = ({
|
|
|
31
31
|
}
|
|
32
32
|
/>
|
|
33
33
|
<Table.Cell content={version} />
|
|
34
|
-
<Table.Cell content={_.propOr("", "full_name")(
|
|
35
|
-
<Table.Cell content={<DateTime value={
|
|
34
|
+
<Table.Cell content={_.propOr("", "full_name")(bcv_last_change_by)} />
|
|
35
|
+
<Table.Cell content={<DateTime value={bcv_last_change_at} />} />
|
|
36
36
|
</Table.Row>
|
|
37
37
|
);
|
|
38
38
|
};
|
|
@@ -41,7 +41,7 @@ ConceptArchiveRow.propTypes = {
|
|
|
41
41
|
business_concept_id: PropTypes.number,
|
|
42
42
|
id: PropTypes.number,
|
|
43
43
|
status: PropTypes.string,
|
|
44
|
-
|
|
44
|
+
bcv_last_change_at: PropTypes.string,
|
|
45
45
|
last_change_by: PropTypes.string,
|
|
46
46
|
version: PropTypes.number,
|
|
47
47
|
};
|
|
@@ -26,7 +26,14 @@ FieldValue.propTypes = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export const ConceptSummary = ({
|
|
29
|
-
concept: {
|
|
29
|
+
concept: {
|
|
30
|
+
status,
|
|
31
|
+
version,
|
|
32
|
+
last_change_at,
|
|
33
|
+
last_change_user,
|
|
34
|
+
bcv_last_change_at,
|
|
35
|
+
bcv_last_change_user,
|
|
36
|
+
},
|
|
30
37
|
}) => (
|
|
31
38
|
<Segment>
|
|
32
39
|
<Header as="h3" dividing>
|
|
@@ -43,16 +50,41 @@ export const ConceptSummary = ({
|
|
|
43
50
|
color={mapStatusColor[status]}
|
|
44
51
|
/>
|
|
45
52
|
<FieldValue field="version" value={version} />
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
{status == "versioned" ? (
|
|
54
|
+
<>
|
|
55
|
+
<FieldValue
|
|
56
|
+
field="last_update_at"
|
|
57
|
+
value={
|
|
58
|
+
<Moment
|
|
59
|
+
locale="es"
|
|
60
|
+
date={bcv_last_change_at}
|
|
61
|
+
format="YYYY-MM-DD HH:mm"
|
|
62
|
+
/>
|
|
63
|
+
}
|
|
64
|
+
/>
|
|
65
|
+
<FieldValue
|
|
66
|
+
field="last_update_by"
|
|
67
|
+
value={(bcv_last_change_user && bcv_last_change_user.full_name) || ""}
|
|
68
|
+
/>
|
|
69
|
+
</>
|
|
70
|
+
) : (
|
|
71
|
+
<>
|
|
72
|
+
<FieldValue
|
|
73
|
+
field="last_update_at"
|
|
74
|
+
value={
|
|
75
|
+
<Moment
|
|
76
|
+
locale="es"
|
|
77
|
+
date={last_change_at}
|
|
78
|
+
format="YYYY-MM-DD HH:mm"
|
|
79
|
+
/>
|
|
80
|
+
}
|
|
81
|
+
/>
|
|
82
|
+
<FieldValue
|
|
83
|
+
field="last_update_by"
|
|
84
|
+
value={(last_change_user && last_change_user.full_name) || ""}
|
|
85
|
+
/>
|
|
86
|
+
</>
|
|
87
|
+
)}
|
|
56
88
|
</Segment>
|
|
57
89
|
);
|
|
58
90
|
|
|
@@ -19,7 +19,7 @@ describe("<ConceptRow />", () => {
|
|
|
19
19
|
id: 42,
|
|
20
20
|
name: "foo",
|
|
21
21
|
status: "draft",
|
|
22
|
-
|
|
22
|
+
bcv_last_change_at: "2018-06-27T07:32:53.154377Z",
|
|
23
23
|
};
|
|
24
24
|
const props = { columns, concept };
|
|
25
25
|
const { container } = render(
|
|
@@ -40,7 +40,7 @@ describe("<ConceptRow />", () => {
|
|
|
40
40
|
id: 42,
|
|
41
41
|
name: "foo",
|
|
42
42
|
status: "draft",
|
|
43
|
-
|
|
43
|
+
bcv_last_change_at: "2018-06-27T07:32:53.154377Z",
|
|
44
44
|
};
|
|
45
45
|
const props = { columns, concept };
|
|
46
46
|
const wrapper = render(
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { render } from "@truedat/test/render";
|
|
3
|
+
import { ConceptSummary } from "../ConceptSummary";
|
|
4
|
+
|
|
5
|
+
const concept = {
|
|
6
|
+
id: 1,
|
|
7
|
+
version: 1,
|
|
8
|
+
status: "draft",
|
|
9
|
+
last_change_at: "2025-01-01T10:00:00Z",
|
|
10
|
+
last_change_user: {
|
|
11
|
+
full_name: "bar",
|
|
12
|
+
},
|
|
13
|
+
bcv_last_change_at: "2024-01-01T10:00:00Z",
|
|
14
|
+
bcv_last_change_user: { full_name: "foo" },
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const props = { concept };
|
|
18
|
+
|
|
19
|
+
describe("<ConceptSummary />", () => {
|
|
20
|
+
it("matches the latest snapshot", () => {
|
|
21
|
+
const { container } = render(<ConceptSummary {...props} />);
|
|
22
|
+
expect(container).toMatchSnapshot();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("show correct change and user for versioned", () => {
|
|
26
|
+
const newProps = {
|
|
27
|
+
concept: {
|
|
28
|
+
...concept,
|
|
29
|
+
status: "versioned",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const { queryByText } = render(<ConceptSummary {...newProps} />);
|
|
33
|
+
expect(queryByText(/Versioned/)).toBeInTheDocument();
|
|
34
|
+
expect(queryByText(/foo/)).toBeInTheDocument();
|
|
35
|
+
expect(queryByText(/2024-01-01/)).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -56,11 +56,11 @@ exports[`<ConceptArchive /> matches the latest snapshot 1`] = `
|
|
|
56
56
|
as="tbody"
|
|
57
57
|
>
|
|
58
58
|
<ConceptArchiveRow
|
|
59
|
+
bcv_last_change_at="2018-06-27T07:32:53.154377Z"
|
|
59
60
|
id={123}
|
|
60
61
|
key="0"
|
|
61
62
|
last_change_by="maixu"
|
|
62
63
|
status="status"
|
|
63
|
-
updated_at="2018-06-27T07:32:53.154377Z"
|
|
64
64
|
version={1}
|
|
65
65
|
/>
|
|
66
66
|
</TableBody>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ConceptSummary /> matches the latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui segment"
|
|
7
|
+
>
|
|
8
|
+
<h3
|
|
9
|
+
class="ui dividing header"
|
|
10
|
+
>
|
|
11
|
+
Summary
|
|
12
|
+
</h3>
|
|
13
|
+
<div
|
|
14
|
+
class="item concept-summary"
|
|
15
|
+
role="listitem"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
class="content concept-summary__content"
|
|
19
|
+
>
|
|
20
|
+
<div
|
|
21
|
+
class="concept-summary__content-bold"
|
|
22
|
+
>
|
|
23
|
+
Status
|
|
24
|
+
:
|
|
25
|
+
</div>
|
|
26
|
+
<div
|
|
27
|
+
class="ui olive label"
|
|
28
|
+
>
|
|
29
|
+
Draft
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
<div
|
|
34
|
+
class="item concept-summary"
|
|
35
|
+
role="listitem"
|
|
36
|
+
>
|
|
37
|
+
<div
|
|
38
|
+
class="content concept-summary__content"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
class="concept-summary__content-bold"
|
|
42
|
+
>
|
|
43
|
+
Version
|
|
44
|
+
:
|
|
45
|
+
</div>
|
|
46
|
+
<div
|
|
47
|
+
class="ui label"
|
|
48
|
+
>
|
|
49
|
+
1
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div
|
|
54
|
+
class="item concept-summary"
|
|
55
|
+
role="listitem"
|
|
56
|
+
>
|
|
57
|
+
<div
|
|
58
|
+
class="content concept-summary__content"
|
|
59
|
+
>
|
|
60
|
+
<div
|
|
61
|
+
class="concept-summary__content-bold"
|
|
62
|
+
>
|
|
63
|
+
Update
|
|
64
|
+
:
|
|
65
|
+
</div>
|
|
66
|
+
<div
|
|
67
|
+
class="ui label"
|
|
68
|
+
>
|
|
69
|
+
<time
|
|
70
|
+
datetime="1735725600000"
|
|
71
|
+
>
|
|
72
|
+
2025-01-01 10:00
|
|
73
|
+
</time>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div
|
|
78
|
+
class="item concept-summary"
|
|
79
|
+
role="listitem"
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
class="content concept-summary__content"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="concept-summary__content-bold"
|
|
86
|
+
>
|
|
87
|
+
User
|
|
88
|
+
:
|
|
89
|
+
</div>
|
|
90
|
+
<div
|
|
91
|
+
class="ui label"
|
|
92
|
+
>
|
|
93
|
+
bar
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
`;
|
|
@@ -21,8 +21,8 @@ describe("reducers: conceptArchive", () => {
|
|
|
21
21
|
{
|
|
22
22
|
id: 123,
|
|
23
23
|
status: "status",
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
bcv_last_change_at: "2018-06-27T07:32:53.154377Z",
|
|
25
|
+
bcv_last_change_by: "maixu",
|
|
26
26
|
version: 1,
|
|
27
27
|
},
|
|
28
28
|
];
|
|
@@ -17,7 +17,7 @@ const iconDecorator = (field) =>
|
|
|
17
17
|
|
|
18
18
|
const translateDecorator = (text) => <FormattedMessage id={text} />;
|
|
19
19
|
|
|
20
|
-
const dateDecorator = (date) => (
|
|
20
|
+
const dateDecorator = ({ date }) => (
|
|
21
21
|
<Moment locale="es" date={date} format="YYYY-MM-DD HH:mm" />
|
|
22
22
|
);
|
|
23
23
|
|
|
@@ -57,7 +57,10 @@ export const defaultConceptColumns = [
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
name: "last_change_at",
|
|
60
|
-
sort: { name: "
|
|
60
|
+
sort: { name: "bcv_last_change_at" },
|
|
61
|
+
fieldSelector: ({ bcv_last_change_at }) => ({
|
|
62
|
+
date: bcv_last_change_at,
|
|
63
|
+
}),
|
|
61
64
|
fieldDecorator: dateDecorator,
|
|
62
65
|
textAlign: "center",
|
|
63
66
|
width: 2,
|