@truedat/bg 4.46.2 → 4.46.5
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/concepts/components/ConceptArchiveRow.js +8 -3
- package/src/concepts/components/ConceptFiltersLoader.js +1 -0
- package/src/concepts/components/ConceptRoutes.js +1 -17
- package/src/concepts/components/ConceptSummary.js +11 -6
- package/src/concepts/components/Concepts.js +6 -27
- package/src/concepts/components/ConceptsActions.js +12 -10
- package/src/concepts/components/ConceptsLoader.js +7 -28
- package/src/concepts/components/ConceptsPanel.js +34 -0
- package/src/concepts/components/ConceptsTable.js +13 -14
- package/src/concepts/components/DomainConcepts.js +29 -0
- package/src/concepts/components/__tests__/ConceptArchiveRow.spec.js +11 -14
- package/src/concepts/components/__tests__/ConceptsLoader.spec.js +2 -5
- package/src/concepts/components/__tests__/ConceptsPanel.spec.js +25 -0
- package/src/concepts/components/__tests__/__snapshots__/ConceptArchiveRow.spec.js.snap +34 -30
- package/src/concepts/components/__tests__/__snapshots__/Concepts.spec.js.snap +1 -30
- package/src/concepts/components/__tests__/__snapshots__/ConceptsPanel.spec.js.snap +157 -0
- package/src/concepts/components/__tests__/__snapshots__/ConceptsTable.spec.js.snap +36 -2
- package/src/concepts/reducers/conceptQuery.js +2 -2
- package/src/concepts/reducers/index.js +0 -2
- package/src/concepts/relations/components/ConceptSelector.js +6 -3
- package/src/concepts/routines.js +0 -6
- package/src/messages/en.js +1 -0
- package/src/messages/es.js +1 -0
- package/src/taxonomy/components/Domain.js +22 -6
- package/src/taxonomy/components/DomainCrumbs.js +4 -3
- package/src/taxonomy/components/DomainDetail.js +3 -5
- package/src/taxonomy/components/DomainRoutes.js +3 -1
- package/src/taxonomy/components/DomainTabs.js +19 -5
- package/src/taxonomy/components/__tests__/__snapshots__/Domain.spec.js.snap +12 -18
- package/src/concepts/components/ConceptsDefaultFiltersLoader.js +0 -23
- package/src/concepts/components/__tests__/ConceptsDefaultFiltersLoader.spec.js +0 -18
- package/src/concepts/reducers/__tests__/conceptsDefaultFilters.spec.js +0 -37
- package/src/concepts/reducers/conceptsDefaultFilters.js +0 -20
|
@@ -26,36 +26,7 @@ exports[`<Concepts /> matches the latest snapshot 1`] = `
|
|
|
26
26
|
<Segment
|
|
27
27
|
attached="bottom"
|
|
28
28
|
>
|
|
29
|
-
<Connect(
|
|
30
|
-
concepts={
|
|
31
|
-
Array [
|
|
32
|
-
Object {
|
|
33
|
-
"description": "dd",
|
|
34
|
-
"id": 1,
|
|
35
|
-
"name": "s1",
|
|
36
|
-
"status": "st",
|
|
37
|
-
"version": "vs",
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
create={true}
|
|
42
|
-
update={true}
|
|
43
|
-
/>
|
|
44
|
-
<Connect(ConceptsSearch) />
|
|
45
|
-
<ConceptSelectedFilters />
|
|
46
|
-
<DimmerDimmable
|
|
47
|
-
dimmed={false}
|
|
48
|
-
>
|
|
49
|
-
<Dimmer
|
|
50
|
-
active={false}
|
|
51
|
-
inverted={true}
|
|
52
|
-
>
|
|
53
|
-
<Loader />
|
|
54
|
-
</Dimmer>
|
|
55
|
-
<Connect(ConceptsLabelResults) />
|
|
56
|
-
<withRouter(Connect(ConceptsTable)) />
|
|
57
|
-
<Connect(Pagination) />
|
|
58
|
-
</DimmerDimmable>
|
|
29
|
+
<Connect(ConceptsPanel) />
|
|
59
30
|
</Segment>
|
|
60
31
|
</Segment>
|
|
61
32
|
</Fragment>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<ConceptsPanel /> matches latest snapshot 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<div
|
|
6
|
+
class="ui action left icon input"
|
|
7
|
+
>
|
|
8
|
+
<input
|
|
9
|
+
placeholder="Search concepts..."
|
|
10
|
+
type="text"
|
|
11
|
+
value=""
|
|
12
|
+
/>
|
|
13
|
+
<i
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
class="search link icon"
|
|
16
|
+
/>
|
|
17
|
+
<div
|
|
18
|
+
aria-expanded="false"
|
|
19
|
+
class="ui button floating labeled scrolling dropdown icon"
|
|
20
|
+
role="listbox"
|
|
21
|
+
tabindex="0"
|
|
22
|
+
>
|
|
23
|
+
<div
|
|
24
|
+
aria-atomic="true"
|
|
25
|
+
aria-live="polite"
|
|
26
|
+
class="divider text"
|
|
27
|
+
role="alert"
|
|
28
|
+
>
|
|
29
|
+
Filters
|
|
30
|
+
</div>
|
|
31
|
+
<i
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
class="filter icon"
|
|
34
|
+
/>
|
|
35
|
+
<div
|
|
36
|
+
class="menu transition"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
class="item"
|
|
40
|
+
role="option"
|
|
41
|
+
>
|
|
42
|
+
<em>
|
|
43
|
+
(reset all filters)
|
|
44
|
+
</em>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
class="selectedFilters"
|
|
51
|
+
/>
|
|
52
|
+
<div
|
|
53
|
+
class="dimmable"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
class="ui inverted dimmer"
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
class="content"
|
|
60
|
+
>
|
|
61
|
+
<div
|
|
62
|
+
class="ui loader"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
<div
|
|
67
|
+
class="ui label concepts-label-results"
|
|
68
|
+
>
|
|
69
|
+
123 concepts found
|
|
70
|
+
</div>
|
|
71
|
+
<table
|
|
72
|
+
class="ui selectable sortable table"
|
|
73
|
+
>
|
|
74
|
+
<thead
|
|
75
|
+
class=""
|
|
76
|
+
>
|
|
77
|
+
<tr
|
|
78
|
+
class=""
|
|
79
|
+
>
|
|
80
|
+
<th
|
|
81
|
+
class="seven wide"
|
|
82
|
+
>
|
|
83
|
+
Term
|
|
84
|
+
</th>
|
|
85
|
+
<th
|
|
86
|
+
class="three wide"
|
|
87
|
+
>
|
|
88
|
+
Domain
|
|
89
|
+
</th>
|
|
90
|
+
<th
|
|
91
|
+
class="two wide"
|
|
92
|
+
>
|
|
93
|
+
Status
|
|
94
|
+
</th>
|
|
95
|
+
<th
|
|
96
|
+
class="one wide"
|
|
97
|
+
>
|
|
98
|
+
Quality rules
|
|
99
|
+
</th>
|
|
100
|
+
<th
|
|
101
|
+
class="one wide"
|
|
102
|
+
>
|
|
103
|
+
Link to field
|
|
104
|
+
</th>
|
|
105
|
+
<th
|
|
106
|
+
class="two wide"
|
|
107
|
+
>
|
|
108
|
+
Last modification date
|
|
109
|
+
</th>
|
|
110
|
+
</tr>
|
|
111
|
+
</thead>
|
|
112
|
+
<tbody
|
|
113
|
+
class=""
|
|
114
|
+
>
|
|
115
|
+
<tr
|
|
116
|
+
class=""
|
|
117
|
+
>
|
|
118
|
+
<td
|
|
119
|
+
class=""
|
|
120
|
+
>
|
|
121
|
+
concept
|
|
122
|
+
</td>
|
|
123
|
+
<td
|
|
124
|
+
class=""
|
|
125
|
+
>
|
|
126
|
+
domain
|
|
127
|
+
</td>
|
|
128
|
+
<td
|
|
129
|
+
class=""
|
|
130
|
+
>
|
|
131
|
+
Published
|
|
132
|
+
</td>
|
|
133
|
+
<td
|
|
134
|
+
class="center aligned"
|
|
135
|
+
>
|
|
136
|
+
|
|
137
|
+
</td>
|
|
138
|
+
<td
|
|
139
|
+
class="center aligned"
|
|
140
|
+
>
|
|
141
|
+
|
|
142
|
+
</td>
|
|
143
|
+
<td
|
|
144
|
+
class="center aligned"
|
|
145
|
+
>
|
|
146
|
+
<time
|
|
147
|
+
datetime="1577836800000"
|
|
148
|
+
>
|
|
149
|
+
2020-01-01 00:00
|
|
150
|
+
</time>
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
</tbody>
|
|
154
|
+
</table>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
`;
|
|
@@ -13,13 +13,47 @@ exports[`<ConceptsTable /> matches the latest snapshot 1`] = `
|
|
|
13
13
|
<TableRow
|
|
14
14
|
as="tr"
|
|
15
15
|
cellAs="td"
|
|
16
|
-
|
|
16
|
+
>
|
|
17
|
+
<TableHeaderCell
|
|
18
|
+
as="th"
|
|
19
|
+
className="disabled"
|
|
20
|
+
content={
|
|
21
|
+
<Memo(MemoizedFormattedMessage)
|
|
22
|
+
id="concepts.props.name"
|
|
23
|
+
/>
|
|
24
|
+
}
|
|
25
|
+
key="0"
|
|
26
|
+
onClick={[Function]}
|
|
27
|
+
sorted="ascending"
|
|
28
|
+
/>
|
|
29
|
+
<TableHeaderCell
|
|
30
|
+
as="th"
|
|
31
|
+
className="disabled"
|
|
32
|
+
content={
|
|
33
|
+
<Memo(MemoizedFormattedMessage)
|
|
34
|
+
id="concepts.props.status"
|
|
35
|
+
/>
|
|
36
|
+
}
|
|
37
|
+
key="1"
|
|
38
|
+
onClick={[Function]}
|
|
39
|
+
sorted="ascending"
|
|
40
|
+
/>
|
|
41
|
+
</TableRow>
|
|
17
42
|
</TableHeader>
|
|
18
43
|
<TableBody
|
|
19
44
|
as="tbody"
|
|
20
45
|
>
|
|
21
46
|
<ConceptRow
|
|
22
|
-
columns={
|
|
47
|
+
columns={
|
|
48
|
+
Array [
|
|
49
|
+
Object {
|
|
50
|
+
"name": "name",
|
|
51
|
+
},
|
|
52
|
+
Object {
|
|
53
|
+
"name": "status",
|
|
54
|
+
},
|
|
55
|
+
]
|
|
56
|
+
}
|
|
23
57
|
concept={
|
|
24
58
|
Object {
|
|
25
59
|
"id": 1,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
toggleConceptFilterValue,
|
|
7
7
|
searchConcepts,
|
|
8
8
|
selectConceptPage,
|
|
9
|
-
sortConcepts
|
|
9
|
+
sortConcepts,
|
|
10
10
|
} from "../routines";
|
|
11
11
|
|
|
12
12
|
const defaultPage = 1;
|
|
@@ -18,7 +18,7 @@ export const initialState = {
|
|
|
18
18
|
query: "",
|
|
19
19
|
page: defaultPage,
|
|
20
20
|
size: defaultSize,
|
|
21
|
-
sort: byNameSort
|
|
21
|
+
sort: byNameSort,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const conceptQuery = (state = initialState, { type, payload }) => {
|
|
@@ -16,7 +16,6 @@ import { conceptRedirect } from "./conceptRedirect";
|
|
|
16
16
|
import { conceptSelectedFilter } from "./conceptSelectedFilter";
|
|
17
17
|
import { concepts } from "./concepts";
|
|
18
18
|
import { conceptsActions } from "./conceptsActions";
|
|
19
|
-
import { conceptsDefaultFilters } from "./conceptsDefaultFilters";
|
|
20
19
|
import { conceptsDownloading } from "./conceptsDownloading";
|
|
21
20
|
import { conceptsLoading } from "./conceptsLoading";
|
|
22
21
|
import { conceptsPageSize } from "./conceptsPageSize";
|
|
@@ -39,7 +38,6 @@ export {
|
|
|
39
38
|
conceptArchive,
|
|
40
39
|
conceptArchiveLoading,
|
|
41
40
|
conceptCount,
|
|
42
|
-
conceptsDefaultFilters,
|
|
43
41
|
conceptFilters,
|
|
44
42
|
conceptFiltersLoading,
|
|
45
43
|
conceptLinking,
|
|
@@ -30,9 +30,12 @@ const ConceptSelectorRow = ({ concept, active, onClick, disabled }) => {
|
|
|
30
30
|
<Table.Cell
|
|
31
31
|
content={
|
|
32
32
|
<Label color={mapStatusColor[status]}>
|
|
33
|
-
{
|
|
34
|
-
<
|
|
35
|
-
|
|
33
|
+
{(
|
|
34
|
+
<FormattedMessage
|
|
35
|
+
id={`concepts.status.${status}`}
|
|
36
|
+
defaultMessage={status}
|
|
37
|
+
/>
|
|
38
|
+
) || <Icon name="ellipsis vertical" color="grey" />}
|
|
36
39
|
</Label>
|
|
37
40
|
}
|
|
38
41
|
/>
|
package/src/concepts/routines.js
CHANGED
|
@@ -36,12 +36,6 @@ export const toggleConceptFilterValue = createRoutine(
|
|
|
36
36
|
"TOGGLE_CONCEPT_FILTER_VALUE"
|
|
37
37
|
);
|
|
38
38
|
export const bulkUpdate = createRoutine("BULK_UPDATE");
|
|
39
|
-
export const setConceptDefaultFilters = createRoutine(
|
|
40
|
-
"SET_CONCEPT_DEFAULT_FILTERS"
|
|
41
|
-
);
|
|
42
|
-
export const clearConceptDefaultFilters = createRoutine(
|
|
43
|
-
"CLEAR_CONCEPT_DEFAULT_FILTERS"
|
|
44
|
-
);
|
|
45
39
|
export const saveSharedTo = createRoutine("SAVE_SHARED_TO");
|
|
46
40
|
export const setConfidentialConcept = createRoutine("SET_CONFIDENTIAL_CONCEPT");
|
|
47
41
|
|
package/src/messages/en.js
CHANGED
|
@@ -286,6 +286,7 @@ export default {
|
|
|
286
286
|
"tabs.bg.qualityImplementations": "Quality Implementations",
|
|
287
287
|
"tabs.bg.relations_business_concept": "Related Concepts",
|
|
288
288
|
"tabs.bg.relations_data_field": "Linkage",
|
|
289
|
+
"tabs.concepts": "Concepts",
|
|
289
290
|
"tabs.domains": "Domains",
|
|
290
291
|
"tabs.members": "Members",
|
|
291
292
|
"tabs.se.concepts": "Concepts",
|
package/src/messages/es.js
CHANGED
|
@@ -290,6 +290,7 @@ export default {
|
|
|
290
290
|
"tabs.bg.qualityImplementations": "Implementaciones",
|
|
291
291
|
"tabs.bg.relations_business_concept": "Conceptos relacionados",
|
|
292
292
|
"tabs.bg.relations_data_field": "Vinculación",
|
|
293
|
+
"tabs.concepts": "Conceptos",
|
|
293
294
|
"tabs.domains": "Dominios",
|
|
294
295
|
"tabs.members": "Roles",
|
|
295
296
|
"tabs.se.concepts": "Conceptos",
|
|
@@ -4,7 +4,13 @@ import PropTypes from "prop-types";
|
|
|
4
4
|
import { connect } from "react-redux";
|
|
5
5
|
import { Route, Switch } from "react-router-dom";
|
|
6
6
|
import { Segment } from "semantic-ui-react";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
DOMAIN,
|
|
9
|
+
DOMAIN_CONCEPTS,
|
|
10
|
+
DOMAIN_MEMBERS,
|
|
11
|
+
linkTo,
|
|
12
|
+
} from "@truedat/core/routes";
|
|
13
|
+
import DomainConcepts from "../../concepts/components/DomainConcepts";
|
|
8
14
|
import DomainActions from "./DomainActions";
|
|
9
15
|
import DomainCrumbs from "./DomainCrumbs";
|
|
10
16
|
import DomainCards from "./DomainCards";
|
|
@@ -19,8 +25,8 @@ export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
|
19
25
|
order: 1,
|
|
20
26
|
icon: "cube",
|
|
21
27
|
messageId: "domain.actions.create",
|
|
22
|
-
action: id => linkTo.
|
|
23
|
-
}
|
|
28
|
+
action: (id) => linkTo.DOMAIN_NEW({ id }),
|
|
29
|
+
},
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
return domainLoading ? null : domain && domain.id ? (
|
|
@@ -42,7 +48,16 @@ export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
|
42
48
|
</>
|
|
43
49
|
)}
|
|
44
50
|
/>
|
|
45
|
-
<Route
|
|
51
|
+
<Route
|
|
52
|
+
path={DOMAIN_MEMBERS}
|
|
53
|
+
render={() => <DomainMembers />}
|
|
54
|
+
exact
|
|
55
|
+
/>
|
|
56
|
+
<Route
|
|
57
|
+
path={DOMAIN_CONCEPTS}
|
|
58
|
+
render={() => <DomainConcepts />}
|
|
59
|
+
exact
|
|
60
|
+
/>
|
|
46
61
|
</Switch>
|
|
47
62
|
</Segment>
|
|
48
63
|
</Segment>
|
|
@@ -52,7 +67,8 @@ export const Domain = ({ hasChildren, domain, domainLoading }) => {
|
|
|
52
67
|
|
|
53
68
|
Domain.propTypes = {
|
|
54
69
|
hasChildren: PropTypes.bool,
|
|
55
|
-
domain: PropTypes.object
|
|
70
|
+
domain: PropTypes.object,
|
|
71
|
+
domainLoading: PropTypes.bool,
|
|
56
72
|
};
|
|
57
73
|
|
|
58
74
|
const mapStateToProps = ({ domain, domainLoading, domains }) => ({
|
|
@@ -62,7 +78,7 @@ const mapStateToProps = ({ domain, domainLoading, domains }) => ({
|
|
|
62
78
|
_.filter(_.prop("parent_id")),
|
|
63
79
|
_.filter(_.propEq("parent_id", _.prop("id")(domain))),
|
|
64
80
|
_.negate(_.isEmpty)
|
|
65
|
-
)(domains)
|
|
81
|
+
)(domains),
|
|
66
82
|
});
|
|
67
83
|
|
|
68
84
|
export default connect(mapStateToProps)(Domain);
|
|
@@ -44,13 +44,14 @@ export const DomainCrumbs = ({ parents, domain, actionCrumb }) => (
|
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
DomainCrumbs.propTypes = {
|
|
47
|
+
actionCrumb: PropTypes.string,
|
|
48
|
+
domain: PropTypes.object,
|
|
47
49
|
parents: PropTypes.array,
|
|
48
|
-
domain: PropTypes.object
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
const mapStateToProps = state => ({
|
|
52
|
+
const mapStateToProps = (state) => ({
|
|
52
53
|
domain: state.domain,
|
|
53
|
-
parents: getAncestorDomains(state)
|
|
54
|
+
parents: getAncestorDomains(state),
|
|
54
55
|
});
|
|
55
56
|
|
|
56
57
|
export default connect(mapStateToProps)(DomainCrumbs);
|
|
@@ -8,17 +8,15 @@ import { linkTo } from "@truedat/core/routes";
|
|
|
8
8
|
|
|
9
9
|
import DomainActions from "./DomainActions";
|
|
10
10
|
|
|
11
|
-
const toActionPath = linkTo.DOMAIN_ACTION;
|
|
12
|
-
|
|
13
11
|
export const DomainDetail = ({ type, name, description, domain_group }) => {
|
|
14
12
|
const available_actions = {
|
|
15
13
|
update: {
|
|
16
14
|
order: 2,
|
|
17
15
|
icon: "edit",
|
|
18
16
|
messageId: "actions.edit",
|
|
19
|
-
action: id =>
|
|
17
|
+
action: (id) => linkTo.DOMAIN_EDIT({ id }),
|
|
20
18
|
},
|
|
21
|
-
deleteOption: true
|
|
19
|
+
deleteOption: true,
|
|
22
20
|
};
|
|
23
21
|
return (
|
|
24
22
|
<>
|
|
@@ -57,7 +55,7 @@ DomainDetail.propTypes = {
|
|
|
57
55
|
type: PropTypes.string,
|
|
58
56
|
name: PropTypes.string,
|
|
59
57
|
description: PropTypes.string,
|
|
60
|
-
domain_group: PropTypes.object
|
|
58
|
+
domain_group: PropTypes.object,
|
|
61
59
|
};
|
|
62
60
|
|
|
63
61
|
const mapStateToProps = ({ domain }) => ({ ...domain });
|
|
@@ -4,13 +4,14 @@ import { Unauthorized } from "@truedat/core/components";
|
|
|
4
4
|
import { useAuthorized } from "@truedat/core/hooks";
|
|
5
5
|
import {
|
|
6
6
|
DOMAIN,
|
|
7
|
+
DOMAIN_CONCEPTS,
|
|
7
8
|
DOMAINS,
|
|
8
9
|
DOMAINS_NEW,
|
|
9
10
|
DOMAINS_SEARCH,
|
|
10
11
|
DOMAIN_EDIT,
|
|
11
12
|
DOMAIN_MEMBERS,
|
|
12
13
|
DOMAIN_MEMBERS_NEW,
|
|
13
|
-
DOMAIN_NEW
|
|
14
|
+
DOMAIN_NEW,
|
|
14
15
|
} from "@truedat/core/routes";
|
|
15
16
|
import AddDomainMember from "./AddMember";
|
|
16
17
|
import Domain from "./Domain";
|
|
@@ -39,6 +40,7 @@ const AuthorizedRoutes = () => (
|
|
|
39
40
|
<Route component={DomainLoader} />
|
|
40
41
|
<Route component={DomainMembersLoader} />
|
|
41
42
|
<Route path={DOMAIN} component={Domain} exact />
|
|
43
|
+
<Route path={DOMAIN_CONCEPTS} component={Domain} exact />
|
|
42
44
|
<Route path={DOMAIN_MEMBERS} component={Domain} exact />
|
|
43
45
|
<Route path={DOMAIN_EDIT} component={EditDomain} exact />
|
|
44
46
|
<Route path={DOMAIN_NEW} component={NewDomain} exact />
|
|
@@ -6,10 +6,16 @@ import { connect } from "react-redux";
|
|
|
6
6
|
import { Link } from "react-router-dom";
|
|
7
7
|
import { Menu } from "semantic-ui-react";
|
|
8
8
|
import { usePath } from "@truedat/core/hooks";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DOMAIN,
|
|
11
|
+
DOMAIN_CONCEPTS,
|
|
12
|
+
DOMAIN_MEMBERS,
|
|
13
|
+
linkTo,
|
|
14
|
+
} from "@truedat/core/routes";
|
|
10
15
|
|
|
11
16
|
const DomainTabs = ({ domain }) => {
|
|
12
17
|
const path = usePath();
|
|
18
|
+
const id = domain?.id;
|
|
13
19
|
return (
|
|
14
20
|
<Menu attached="top" pointing secondary tabular>
|
|
15
21
|
<Menu.Item
|
|
@@ -18,22 +24,30 @@ const DomainTabs = ({ domain }) => {
|
|
|
18
24
|
to={linkTo.DOMAIN(domain)}
|
|
19
25
|
replace
|
|
20
26
|
>
|
|
21
|
-
<FormattedMessage id=
|
|
27
|
+
<FormattedMessage id="tabs.subdomains" />
|
|
22
28
|
</Menu.Item>
|
|
23
29
|
<Menu.Item
|
|
24
30
|
active={path === DOMAIN_MEMBERS}
|
|
25
31
|
as={Link}
|
|
26
|
-
to={linkTo.
|
|
32
|
+
to={linkTo.DOMAIN_MEMBERS({ id })}
|
|
27
33
|
replace
|
|
28
34
|
>
|
|
29
|
-
<FormattedMessage id=
|
|
35
|
+
<FormattedMessage id="tabs.members" />
|
|
36
|
+
</Menu.Item>
|
|
37
|
+
<Menu.Item
|
|
38
|
+
active={path === DOMAIN_CONCEPTS}
|
|
39
|
+
as={Link}
|
|
40
|
+
to={linkTo.DOMAIN_CONCEPTS({ id })}
|
|
41
|
+
replace
|
|
42
|
+
>
|
|
43
|
+
<FormattedMessage id="tabs.concepts" />
|
|
30
44
|
</Menu.Item>
|
|
31
45
|
</Menu>
|
|
32
46
|
);
|
|
33
47
|
};
|
|
34
48
|
|
|
35
49
|
DomainTabs.propTypes = {
|
|
36
|
-
domain: PropTypes.object
|
|
50
|
+
domain: PropTypes.object,
|
|
37
51
|
};
|
|
38
52
|
|
|
39
53
|
const mapStateToProps = ({ domain }) => ({ domain });
|
|
@@ -16,17 +16,14 @@ exports[`<Domain /> matches the latest snapshot (no subdomains) 1`] = `
|
|
|
16
16
|
render={[Function]}
|
|
17
17
|
/>
|
|
18
18
|
<Route
|
|
19
|
-
component={
|
|
20
|
-
Object {
|
|
21
|
-
"$$typeof": Symbol(react.memo),
|
|
22
|
-
"WrappedComponent": [Function],
|
|
23
|
-
"compare": null,
|
|
24
|
-
"displayName": "Connect(DomainMembers)",
|
|
25
|
-
"type": [Function],
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
19
|
exact={true}
|
|
29
20
|
path="/domains/:id/members"
|
|
21
|
+
render={[Function]}
|
|
22
|
+
/>
|
|
23
|
+
<Route
|
|
24
|
+
exact={true}
|
|
25
|
+
path="/domains/:id/concepts"
|
|
26
|
+
render={[Function]}
|
|
30
27
|
/>
|
|
31
28
|
</Switch>
|
|
32
29
|
</Segment>
|
|
@@ -50,17 +47,14 @@ exports[`<Domain /> matches the latest snapshot (with subdomains) 1`] = `
|
|
|
50
47
|
render={[Function]}
|
|
51
48
|
/>
|
|
52
49
|
<Route
|
|
53
|
-
component={
|
|
54
|
-
Object {
|
|
55
|
-
"$$typeof": Symbol(react.memo),
|
|
56
|
-
"WrappedComponent": [Function],
|
|
57
|
-
"compare": null,
|
|
58
|
-
"displayName": "Connect(DomainMembers)",
|
|
59
|
-
"type": [Function],
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
50
|
exact={true}
|
|
63
51
|
path="/domains/:id/members"
|
|
52
|
+
render={[Function]}
|
|
53
|
+
/>
|
|
54
|
+
<Route
|
|
55
|
+
exact={true}
|
|
56
|
+
path="/domains/:id/concepts"
|
|
57
|
+
render={[Function]}
|
|
64
58
|
/>
|
|
65
59
|
</Switch>
|
|
66
60
|
</Segment>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { connect } from "react-redux";
|
|
4
|
-
import { setConceptDefaultFilters } from "../routines";
|
|
5
|
-
|
|
6
|
-
export const ConceptsDefaultFiltersLoader = ({
|
|
7
|
-
defaultFilters,
|
|
8
|
-
setConceptDefaultFilters,
|
|
9
|
-
}) => {
|
|
10
|
-
useEffect(() => {
|
|
11
|
-
setConceptDefaultFilters({ defaultFilters });
|
|
12
|
-
}, [defaultFilters, setConceptDefaultFilters]);
|
|
13
|
-
return null;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
ConceptsDefaultFiltersLoader.propTypes = {
|
|
17
|
-
defaultFilters: PropTypes.object,
|
|
18
|
-
setConceptDefaultFilters: PropTypes.func,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default connect(null, { setConceptDefaultFilters })(
|
|
22
|
-
ConceptsDefaultFiltersLoader
|
|
23
|
-
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { mount } from "enzyme";
|
|
3
|
-
import { ConceptsDefaultFiltersLoader } from "../ConceptsDefaultFiltersLoader";
|
|
4
|
-
|
|
5
|
-
const getProps = () => ({
|
|
6
|
-
setConceptDefaultFilters: jest.fn(),
|
|
7
|
-
defaultFilters: { status: ["pending"] }
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
describe("<ConceptsDefaultFiltersLoader />", () => {
|
|
11
|
-
it("calls setConceptDefaultFilters when component mounts but not when it unmounts", () => {
|
|
12
|
-
const props = getProps();
|
|
13
|
-
const wrapper = mount(<ConceptsDefaultFiltersLoader {...props} />);
|
|
14
|
-
expect(props.setConceptDefaultFilters).toHaveBeenCalledTimes(1);
|
|
15
|
-
wrapper.unmount();
|
|
16
|
-
expect(props.setConceptDefaultFilters).toHaveBeenCalledTimes(1);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
setConceptDefaultFilters,
|
|
3
|
-
clearConceptDefaultFilters
|
|
4
|
-
} from "../../routines";
|
|
5
|
-
import { conceptsDefaultFilters } from "..";
|
|
6
|
-
|
|
7
|
-
const fooState = { foo: "bar" };
|
|
8
|
-
const initialState = {};
|
|
9
|
-
|
|
10
|
-
describe("reducers: conceptsDefaultFilters", () => {
|
|
11
|
-
it("should provide the initial state", () => {
|
|
12
|
-
expect(conceptsDefaultFilters(undefined, {})).toEqual(initialState);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should handle the setConceptDefaultFilters.TRIGGER action", () => {
|
|
16
|
-
const defaultFilters = { status: ["pending"] };
|
|
17
|
-
const payload = { defaultFilters };
|
|
18
|
-
expect(
|
|
19
|
-
conceptsDefaultFilters(fooState, {
|
|
20
|
-
type: setConceptDefaultFilters.TRIGGER,
|
|
21
|
-
payload
|
|
22
|
-
})
|
|
23
|
-
).toEqual(defaultFilters);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("should handle the clearConceptDefaultFilters.TRIGGER action", () => {
|
|
27
|
-
expect(
|
|
28
|
-
conceptsDefaultFilters(fooState, {
|
|
29
|
-
type: clearConceptDefaultFilters.TRIGGER
|
|
30
|
-
})
|
|
31
|
-
).toEqual(initialState);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("should ignore unknown actions", () => {
|
|
35
|
-
expect(conceptsDefaultFilters(fooState, { type: "FOO" })).toBe(fooState);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
clearConceptDefaultFilters,
|
|
3
|
-
setConceptDefaultFilters
|
|
4
|
-
} from "../routines";
|
|
5
|
-
|
|
6
|
-
const initialState = {};
|
|
7
|
-
|
|
8
|
-
const conceptsDefaultFilters = (state = initialState, { type, payload }) => {
|
|
9
|
-
switch (type) {
|
|
10
|
-
case setConceptDefaultFilters.TRIGGER:
|
|
11
|
-
const { defaultFilters } = payload;
|
|
12
|
-
return defaultFilters;
|
|
13
|
-
case clearConceptDefaultFilters.TRIGGER:
|
|
14
|
-
return initialState;
|
|
15
|
-
default:
|
|
16
|
-
return state;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { conceptsDefaultFilters };
|