@truedat/bg 8.7.0 → 8.7.2
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 +3 -3
- package/src/concepts/api.js +3 -2
- package/src/concepts/components/Concept.js +7 -7
- package/src/concepts/components/ConceptActions.js +1 -1
- package/src/concepts/components/ConceptCompleteness.js +6 -6
- package/src/concepts/components/ConceptCrumbs.js +1 -1
- package/src/concepts/components/ConceptDetails.js +1 -1
- package/src/concepts/components/ConceptHeader.js +2 -2
- package/src/concepts/components/ConceptLinksDropdownSelector.js +2 -2
- package/src/concepts/components/ConceptLinksUploadButton.js +1 -1
- package/src/concepts/components/ConceptLoader.js +1 -1
- package/src/concepts/components/ConceptRoutes.js +7 -5
- package/src/concepts/components/ConceptSubscription.js +2 -2
- package/src/concepts/components/ConceptSuggestions.js +40 -43
- package/src/concepts/components/ConceptTabs.js +12 -12
- package/src/concepts/components/ConceptsActions.js +1 -3
- package/src/concepts/components/ConceptsBulkUpdate.js +2 -2
- package/src/concepts/components/ConceptsLinksManagement.js +6 -6
- package/src/concepts/components/ConceptsTable.js +1 -1
- package/src/concepts/components/ConceptsUpdateButton.js +1 -1
- package/src/concepts/components/ConceptsUploadButton.js +27 -22
- package/src/concepts/components/ConceptsUploadEventsTable.js +9 -6
- package/src/concepts/components/EventRow.js +7 -3
- package/src/concepts/components/SharedToForm.js +4 -1
- package/src/concepts/components/__tests__/Concept.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptArchiveRow.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptCompleteness.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptContext.spec.js +3 -3
- package/src/concepts/components/__tests__/ConceptDeleteModalBody.spec.js +6 -6
- package/src/concepts/components/__tests__/ConceptEdit.spec.js +4 -4
- package/src/concepts/components/__tests__/ConceptForm.spec.js +4 -4
- package/src/concepts/components/__tests__/ConceptHeader.spec.js +3 -3
- package/src/concepts/components/__tests__/ConceptLinksManagement.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptLinksUploadButton.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptManageDomainPopup.spec.js +10 -10
- package/src/concepts/components/__tests__/ConceptRoutes.spec.js +3 -3
- package/src/concepts/components/__tests__/ConceptRow.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptSubscription.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptSuggestions.spec.js +60 -48
- package/src/concepts/components/__tests__/ConceptTabPane.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptTabs.spec.js +10 -4
- package/src/concepts/components/__tests__/Concepts.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptsActions.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptsBulkUpdate.spec.js +3 -3
- package/src/concepts/components/__tests__/ConceptsLabelResults.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptsPanel.spec.js +1 -1
- package/src/concepts/components/__tests__/ConceptsTable.spec.js +16 -16
- package/src/concepts/components/__tests__/ConceptsUpdateButton.spec.js +2 -2
- package/src/concepts/components/__tests__/ConceptsUploadButton.spec.js +3 -3
- package/src/concepts/components/__tests__/Events.spec.js +6 -4
- package/src/concepts/components/__tests__/SharedToDomains.spec.js +1 -1
- package/src/concepts/components/__tests__/SharedToDomainsPopup.spec.js +5 -5
- package/src/concepts/components/__tests__/SharedToForm.spec.js +4 -4
- package/src/concepts/constants/mappings.js +6 -6
- package/src/concepts/hooks/useConcepts.js +6 -6
- package/src/concepts/hooks/useUploadEvents.js +1 -1
- package/src/concepts/reducers/__tests__/bulkUpdateLoading.spec.js +2 -2
- package/src/concepts/reducers/__tests__/concept.spec.js +7 -7
- package/src/concepts/reducers/__tests__/conceptActions.spec.js +5 -5
- package/src/concepts/reducers/__tests__/conceptArchive.spec.js +2 -2
- package/src/concepts/reducers/__tests__/conceptArchiveLoading.spec.js +2 -2
- package/src/concepts/reducers/__tests__/conceptLoading.spec.js +1 -1
- package/src/concepts/reducers/__tests__/conceptPermissions.spec.js +7 -7
- package/src/concepts/reducers/__tests__/conceptRedirect.spec.js +17 -17
- package/src/concepts/reducers/__tests__/conceptUpdating.spec.js +2 -2
- package/src/concepts/reducers/__tests__/conceptsDownloading.spec.js +2 -2
- package/src/concepts/reducers/__tests__/savingSharedTo.spec.js +1 -1
- package/src/concepts/reducers/__tests__/sharedToDomains.spec.js +6 -6
- package/src/concepts/reducers/conceptArchive.js +1 -1
- package/src/concepts/reducers/conceptRedirect.js +2 -6
- package/src/concepts/relations/components/ConceptImplementationLinks.js +5 -5
- package/src/concepts/relations/components/ConceptLinkActions.js +3 -1
- package/src/concepts/relations/components/ConceptLinksApprovalResults.js +2 -1
- package/src/concepts/relations/components/ConceptLinksApprovals.js +4 -4
- package/src/concepts/relations/components/ConceptLinkstRequestGrantButton.js +2 -2
- package/src/concepts/relations/components/ConceptRelationForm.js +2 -2
- package/src/concepts/relations/components/ConceptRelationRow.js +2 -2
- package/src/concepts/relations/components/ConceptRelations.js +19 -33
- package/src/concepts/relations/components/ConceptRelationsRoutes.js +3 -3
- package/src/concepts/relations/components/ConceptRelationsSummary.js +2 -2
- package/src/concepts/relations/components/ConceptSelector.js +4 -4
- package/src/concepts/relations/components/ConceptStructureLinks.js +1 -1
- package/src/concepts/relations/components/SliderWithFilter.js +20 -7
- package/src/concepts/relations/components/__tests__/ConceptImplementationLinks.spec.js +0 -1
- package/src/concepts/relations/components/__tests__/ConceptLinkActions.spec.js +41 -10
- package/src/concepts/relations/components/__tests__/ConceptLinksActions.spec.js +5 -5
- package/src/concepts/relations/components/__tests__/ConceptLinksApprovalResults.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptLinksApprovals.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptLinksApprovalsLabelResults.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptLinksApprovalsRow.spec.js +5 -5
- package/src/concepts/relations/components/__tests__/ConceptLinksApprovalsTable.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptLinkstRequestGrantButton.spec.js +10 -5
- package/src/concepts/relations/components/__tests__/ConceptRelationForm.spec.js +4 -4
- package/src/concepts/relations/components/__tests__/ConceptRelations.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptRelationsRoutes.spec.js +1 -1
- package/src/concepts/relations/components/__tests__/ConceptSelector.spec.js +10 -10
- package/src/concepts/relations/components/__tests__/ConceptStructureLinks.spec.js +3 -7
- package/src/concepts/relations/components/__tests__/SliderWithFilter.spec.js +6 -8
- package/src/concepts/relations/hooks/useLinks.js +3 -3
- package/src/concepts/relations/sagas/linkConcept.js +1 -1
- package/src/concepts/relations/selectors/__tests__/getBusinessConceptsLinksToImplementationsColumns.spec.js +1 -1
- package/src/concepts/relations/selectors/getBusinessConceptsLinksToImplementationsColumns.js +1 -1
- package/src/concepts/relations/selectors/getConceptImplementationLinks.js +4 -4
- package/src/concepts/relations/selectors/getConceptLinks.js +7 -7
- package/src/concepts/relations/selectors/getConceptRelations.js +9 -9
- package/src/concepts/relations/selectors/getLinksSearchColumns.js +3 -3
- package/src/concepts/sagas/bulkUpdate.js +1 -1
- package/src/concepts/selectors/__tests__/getConceptDomainPath.spec.js +1 -1
- package/src/concepts/selectors/getConceptColumns.js +1 -1
- package/src/concepts/selectors/getConceptDomainPath.js +1 -1
- package/src/concepts/selectors/getConceptUploadEventColumns.js +1 -1
- package/src/concepts/selectors/getConceptVersionPath.js +1 -1
- package/src/concepts/selectors/getTemplateFields.js +1 -1
- package/src/concepts/selectors/getTemplateGroups.js +1 -1
- package/src/hooks/useDomains.js +2 -2
- package/src/messages/index.js +1 -1
- package/src/taxonomy/components/DomainActions.js +4 -4
- package/src/taxonomy/components/DomainCards.js +3 -3
- package/src/taxonomy/components/DomainContent.js +1 -1
- package/src/taxonomy/components/DomainForm.js +6 -6
- package/src/taxonomy/components/DomainImplementations.js +2 -3
- package/src/taxonomy/components/DomainTabs.js +2 -2
- package/src/taxonomy/components/__tests__/Domain.spec.js +6 -6
- package/src/taxonomy/components/__tests__/DomainCards.spec.js +1 -1
- package/src/taxonomy/components/__tests__/DomainContent.spec.js +10 -10
- package/src/taxonomy/components/__tests__/DomainForm.spec.js +5 -5
- package/src/taxonomy/components/__tests__/DomainImplmentation.spec.js +3 -3
- package/src/taxonomy/components/__tests__/DomainRoutes.spec.js +1 -1
- package/src/taxonomy/components/__tests__/DomainStructures.spec.js +5 -3
- package/src/taxonomy/components/__tests__/DomainTabs.spec.js +7 -7
- package/src/taxonomy/components/__tests__/Domains.spec.js +8 -8
- package/src/taxonomy/components/__tests__/DomainsActions.spec.js +1 -1
- package/src/taxonomy/selectors/__tests__/getVisibleDomains.spec.js +4 -4
- package/src/taxonomy/selectors/getDomainsConcept.js +9 -9
- package/src/taxonomy/selectors/index.js +8 -8
|
@@ -7,21 +7,21 @@ const getBusinessConceptId = ({ concept }) => concept.business_concept_id;
|
|
|
7
7
|
export const getConceptSourceRelations = createSelector(
|
|
8
8
|
[getRelations, getBusinessConceptId],
|
|
9
9
|
(relations, business_concept_id) =>
|
|
10
|
-
_getConceptSourceRelations(relations, business_concept_id)
|
|
10
|
+
_getConceptSourceRelations(relations, business_concept_id),
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
export const getConceptTargetRelations = createSelector(
|
|
14
14
|
[getRelations, getBusinessConceptId],
|
|
15
15
|
(relations, business_concept_id) =>
|
|
16
|
-
_getConceptTargetRelations(relations, business_concept_id)
|
|
16
|
+
_getConceptTargetRelations(relations, business_concept_id),
|
|
17
17
|
);
|
|
18
18
|
|
|
19
19
|
export const getConceptToConceptRelations = createSelector(
|
|
20
20
|
[getRelations, getBusinessConceptId],
|
|
21
21
|
(relations, business_concept_id) =>
|
|
22
22
|
_.concat(_getConceptSourceRelations(relations, business_concept_id))(
|
|
23
|
-
_getConceptTargetRelations(relations, business_concept_id)
|
|
24
|
-
)
|
|
23
|
+
_getConceptTargetRelations(relations, business_concept_id),
|
|
24
|
+
),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
export const getConceptRelations = (formatMessage) =>
|
|
@@ -29,10 +29,10 @@ export const getConceptRelations = (formatMessage) =>
|
|
|
29
29
|
[getRelations, getBusinessConceptId],
|
|
30
30
|
(relations, business_concept_id) => {
|
|
31
31
|
const allRelations = _.concat(
|
|
32
|
-
_getConceptSourceRelations(relations, business_concept_id)
|
|
32
|
+
_getConceptSourceRelations(relations, business_concept_id),
|
|
33
33
|
)(_getConceptTargetRelations(relations, business_concept_id));
|
|
34
34
|
return groupRelationsByLabel(allRelations, formatMessage);
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
const _getConceptSourceRelations = (relations, business_concept_id) => {
|
|
@@ -71,7 +71,7 @@ const groupRelationsByLabel = (bcRelations, formatMessage) => {
|
|
|
71
71
|
}),
|
|
72
72
|
...t,
|
|
73
73
|
};
|
|
74
|
-
})
|
|
74
|
+
}),
|
|
75
75
|
)(r.tags);
|
|
76
76
|
return {
|
|
77
77
|
...r,
|
|
@@ -82,12 +82,12 @@ const groupRelationsByLabel = (bcRelations, formatMessage) => {
|
|
|
82
82
|
const labels = _.flow(
|
|
83
83
|
_.flatMap("tags"),
|
|
84
84
|
_.uniqBy("i18n"),
|
|
85
|
-
_.sortBy("relationSide")
|
|
85
|
+
_.sortBy("relationSide"),
|
|
86
86
|
)(relations);
|
|
87
87
|
|
|
88
88
|
const tagsRelations = _.map((tag) => {
|
|
89
89
|
const relationsByLabel = _.filter((r) =>
|
|
90
|
-
_.find({ i18n: tag.i18n })(r.tags)
|
|
90
|
+
_.find({ i18n: tag.i18n })(r.tags),
|
|
91
91
|
)(relations);
|
|
92
92
|
return { ...tag, relations: relationsByLabel };
|
|
93
93
|
})(labels);
|
|
@@ -39,7 +39,7 @@ const nodeDecorator = ({ link, nodeRole }) => {
|
|
|
39
39
|
type: obj[`${nodeRole}_type`],
|
|
40
40
|
id: obj[`${nodeRole}_id`],
|
|
41
41
|
name: obj[`${nodeRole}_name`],
|
|
42
|
-
})
|
|
42
|
+
}),
|
|
43
43
|
)(link);
|
|
44
44
|
|
|
45
45
|
const linkToNode =
|
|
@@ -100,7 +100,7 @@ export const getLinksSearchColumns = createSelector(
|
|
|
100
100
|
[_.prop("linksSearchColumns")],
|
|
101
101
|
(linksSearchColumns) => {
|
|
102
102
|
return _.flow(_.defaultTo(defaultLinksSearchTableColumns))(
|
|
103
|
-
linksSearchColumns
|
|
103
|
+
linksSearchColumns,
|
|
104
104
|
);
|
|
105
|
-
}
|
|
105
|
+
},
|
|
106
106
|
);
|
|
@@ -19,7 +19,7 @@ describe("selectors: getConceptDomainPath", () => {
|
|
|
19
19
|
it("should return empty array when not domain parents", () => {
|
|
20
20
|
expect(getConceptDomainPath({ concept: {} })).toEqual([]);
|
|
21
21
|
expect(getConceptDomainPath({ concept: { domain_parents: null } })).toEqual(
|
|
22
|
-
[]
|
|
22
|
+
[],
|
|
23
23
|
);
|
|
24
24
|
});
|
|
25
25
|
});
|
|
@@ -67,5 +67,5 @@ const getColumns = (state) => state.conceptsUploadEventColumns;
|
|
|
67
67
|
|
|
68
68
|
export const getConceptUploadEventColumns = createSelector(
|
|
69
69
|
[getColumns],
|
|
70
|
-
(columns) => _.defaultTo(defaultConceptsUploadEventColumns)(columns)
|
|
70
|
+
(columns) => _.defaultTo(defaultConceptsUploadEventColumns)(columns),
|
|
71
71
|
);
|
package/src/hooks/useDomains.js
CHANGED
|
@@ -60,7 +60,7 @@ export const useDomainUpdate = (id) => {
|
|
|
60
60
|
const { mutate } = useSWRConfig();
|
|
61
61
|
const url = compile(API_DOMAIN)({ id: `${id}` });
|
|
62
62
|
const mutator = useSWRMutations(url, (url, { arg }) =>
|
|
63
|
-
apiJsonPatch(url, arg)
|
|
63
|
+
apiJsonPatch(url, arg),
|
|
64
64
|
);
|
|
65
65
|
return {
|
|
66
66
|
...mutator,
|
|
@@ -78,7 +78,7 @@ export const useDomainDelete = (id) => {
|
|
|
78
78
|
const { mutate } = useSWRConfig();
|
|
79
79
|
const url = compile(API_DOMAIN)({ id: `${id}` });
|
|
80
80
|
const mutator = useSWRMutations(url, (url, { arg }) =>
|
|
81
|
-
apiJsonDelete(url, arg)
|
|
81
|
+
apiJsonDelete(url, arg),
|
|
82
82
|
);
|
|
83
83
|
return {
|
|
84
84
|
...mutator,
|
package/src/messages/index.js
CHANGED
|
@@ -79,7 +79,7 @@ const ActionButtons = ({
|
|
|
79
79
|
...rest,
|
|
80
80
|
to: action(id),
|
|
81
81
|
})),
|
|
82
|
-
(actions) => (deleteAction ? withDelete(actions, onConfirm) : actions)
|
|
82
|
+
(actions) => (deleteAction ? withDelete(actions, onConfirm) : actions),
|
|
83
83
|
)(secondaryActions);
|
|
84
84
|
|
|
85
85
|
return (
|
|
@@ -116,15 +116,15 @@ const DomainActions = ({
|
|
|
116
116
|
_.toPairs,
|
|
117
117
|
_.map(([key, actionProps]) => ({ key, ...actionProps })),
|
|
118
118
|
_.filter(({ key }) => _.has(key)(availableActions)),
|
|
119
|
-
_.map((a) => ({ ...a, ..._.prop(_.prop("key")(a))(availableActions) }))
|
|
119
|
+
_.map((a) => ({ ...a, ..._.prop(_.prop("key")(a))(availableActions) })),
|
|
120
120
|
)(domainAllActions);
|
|
121
121
|
|
|
122
122
|
const primaryActions = _.filter(
|
|
123
|
-
({ key }) => !_.includes(key)(secondaryActionsKeys)
|
|
123
|
+
({ key }) => !_.includes(key)(secondaryActionsKeys),
|
|
124
124
|
)(notHiddenActions);
|
|
125
125
|
|
|
126
126
|
const secondaryActions = _.filter(({ key }) =>
|
|
127
|
-
_.includes(key)(secondaryActionsKeys)
|
|
127
|
+
_.includes(key)(secondaryActionsKeys),
|
|
128
128
|
)(notHiddenActions);
|
|
129
129
|
|
|
130
130
|
const deleteAction =
|
|
@@ -60,14 +60,14 @@ export const DomainCards = ({ actions, domain, domains }) => {
|
|
|
60
60
|
const visibleDomains = _.flow(
|
|
61
61
|
_.map((domain) => {
|
|
62
62
|
const children = _.filter(({ parent_id }) => parent_id == domain.id)(
|
|
63
|
-
domains
|
|
63
|
+
domains,
|
|
64
64
|
);
|
|
65
65
|
return { childCount: children.length, ...domain };
|
|
66
66
|
}),
|
|
67
67
|
_.filter((domain) =>
|
|
68
|
-
domain.name.toLowerCase().includes(domainsFilter.toLowerCase())
|
|
68
|
+
domain.name.toLowerCase().includes(domainsFilter.toLowerCase()),
|
|
69
69
|
),
|
|
70
|
-
_.orderBy("name", "asc")
|
|
70
|
+
_.orderBy("name", "asc"),
|
|
71
71
|
)(domainChildren);
|
|
72
72
|
return (
|
|
73
73
|
<>
|
|
@@ -21,7 +21,7 @@ import DomainMembers from "./DomainMembers";
|
|
|
21
21
|
import AddDomainMember from "./AddDomainMember";
|
|
22
22
|
|
|
23
23
|
const RolesLoader = React.lazy(
|
|
24
|
-
() => import("@truedat/auth/roles/components/RolesLoader")
|
|
24
|
+
() => import("@truedat/auth/roles/components/RolesLoader"),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
const DomainContent = ({ domain, domains }) => {
|
|
@@ -15,26 +15,26 @@ const buildOptions = (collection, value) =>
|
|
|
15
15
|
_.filter(_.isString),
|
|
16
16
|
_.uniq,
|
|
17
17
|
_.sortBy(accentInsensitiveOrder),
|
|
18
|
-
_.map.convert({ cap: false })(toOption)
|
|
18
|
+
_.map.convert({ cap: false })(toOption),
|
|
19
19
|
)(collection);
|
|
20
20
|
|
|
21
21
|
const getDomainGroups = _.flow(
|
|
22
22
|
_.map(_.path("domain_group.name")),
|
|
23
23
|
_.filter(_.isString),
|
|
24
|
-
_.sortBy(_.toLower)
|
|
24
|
+
_.sortBy(_.toLower),
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
const getDomainTypes = _.flow(
|
|
28
28
|
_.map("type"),
|
|
29
29
|
_.filter(_.isString),
|
|
30
30
|
_.uniq,
|
|
31
|
-
_.sortBy(_.toLower)
|
|
31
|
+
_.sortBy(_.toLower),
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
const getDomainParentOptions = (parentableIds = []) =>
|
|
35
35
|
_.flow(
|
|
36
36
|
_.filter((d) => _.includes(d.id)(parentableIds)),
|
|
37
|
-
_.map(({ id, name }) => ({ key: id, text: name, value: id }))
|
|
37
|
+
_.map(({ id, name }) => ({ key: id, text: name, value: id })),
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
const DEFAULTS = {
|
|
@@ -78,7 +78,7 @@ export const DomainForm = ({ domain = {}, parentableIds = [], onSubmit }) => {
|
|
|
78
78
|
rules={{
|
|
79
79
|
required: formatMessage(
|
|
80
80
|
{ id: "form.validation.required" },
|
|
81
|
-
{ prop: formatMessage({ id: "domain.props.name" }) }
|
|
81
|
+
{ prop: formatMessage({ id: "domain.props.name" }) },
|
|
82
82
|
),
|
|
83
83
|
}}
|
|
84
84
|
render={({ field: { onBlur, onChange, value } }) => (
|
|
@@ -105,7 +105,7 @@ export const DomainForm = ({ domain = {}, parentableIds = [], onSubmit }) => {
|
|
|
105
105
|
rules={{
|
|
106
106
|
required: formatMessage(
|
|
107
107
|
{ id: "form.validation.required" },
|
|
108
|
-
{ prop: formatMessage({ id: "domain.props.external_id" }) }
|
|
108
|
+
{ prop: formatMessage({ id: "domain.props.external_id" }) },
|
|
109
109
|
),
|
|
110
110
|
}}
|
|
111
111
|
render={({ field: { onBlur, onChange, value } }) => (
|
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
} from "@truedat/dq/hooks/useImplementations";
|
|
8
8
|
|
|
9
9
|
const ImplementationFiltersLoader = lazy(
|
|
10
|
-
() => import("@truedat/dq/components/ImplementationFiltersLoader")
|
|
10
|
+
() => import("@truedat/dq/components/ImplementationFiltersLoader"),
|
|
11
11
|
);
|
|
12
12
|
|
|
13
13
|
const ImplementationSearchResults = lazy(
|
|
14
|
-
() => import("@truedat/dq/components/ImplementationSearchResults")
|
|
14
|
+
() => import("@truedat/dq/components/ImplementationSearchResults"),
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
export const DomainImplementations = ({ domain = {} }) => {
|
|
@@ -31,7 +31,6 @@ export const DomainImplementations = ({ domain = {} }) => {
|
|
|
31
31
|
defaultFilters,
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
return (
|
|
36
35
|
<>
|
|
37
36
|
<SearchContextProvider {...searchProps}>
|
|
@@ -79,7 +79,7 @@ const DomainTabs = ({
|
|
|
79
79
|
_.filter((tab) => dqAuthorized || tab.key !== "implementations"),
|
|
80
80
|
_.reject((tab) => hiddenTabs.includes(tab.key)),
|
|
81
81
|
_.sortBy("priority"),
|
|
82
|
-
setMainTab
|
|
82
|
+
setMainTab,
|
|
83
83
|
)(tabs);
|
|
84
84
|
|
|
85
85
|
const getActived = (key, url, id) => {
|
|
@@ -92,7 +92,7 @@ const DomainTabs = ({
|
|
|
92
92
|
|
|
93
93
|
return _.flow(
|
|
94
94
|
_.map((url) => compile(url)({ id: `${id}` })),
|
|
95
|
-
_.some((url) => path === url)
|
|
95
|
+
_.some((url) => path === url),
|
|
96
96
|
)(maybeAddMain);
|
|
97
97
|
};
|
|
98
98
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
-
import Domain from "../Domain";
|
|
4
|
-
import { useDomain } from "../../../hooks/useDomains";
|
|
5
3
|
import { useAuthorized } from "@truedat/core/hooks";
|
|
6
4
|
import { DOMAIN_NEW, DOMAIN_EDIT } from "@truedat/core/routes";
|
|
5
|
+
import Domain from "../Domain";
|
|
6
|
+
import { useDomain } from "../../../hooks/useDomains";
|
|
7
7
|
|
|
8
8
|
jest.mock("@truedat/core/hooks", () => ({
|
|
9
9
|
useAuthorized: jest.fn(() => true),
|
|
@@ -42,7 +42,7 @@ describe("<Domain />", () => {
|
|
|
42
42
|
domainId={domainId}
|
|
43
43
|
domains={domains}
|
|
44
44
|
taxonomyConfig={taxonomyConfig}
|
|
45
|
-
|
|
45
|
+
/>,
|
|
46
46
|
);
|
|
47
47
|
await waitForLoad(rendered);
|
|
48
48
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -57,7 +57,7 @@ describe("<Domain />", () => {
|
|
|
57
57
|
/>,
|
|
58
58
|
{
|
|
59
59
|
routes: [DOMAIN_EDIT],
|
|
60
|
-
}
|
|
60
|
+
},
|
|
61
61
|
);
|
|
62
62
|
await waitForLoad(rendered);
|
|
63
63
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -72,7 +72,7 @@ describe("<Domain />", () => {
|
|
|
72
72
|
/>,
|
|
73
73
|
{
|
|
74
74
|
routes: [DOMAIN_NEW],
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
);
|
|
77
77
|
await waitForLoad(rendered);
|
|
78
78
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -88,7 +88,7 @@ describe("<Domain />", () => {
|
|
|
88
88
|
domainId={domainId}
|
|
89
89
|
domains={domains}
|
|
90
90
|
taxonomyConfig={taxonomyConfig}
|
|
91
|
-
|
|
91
|
+
/>,
|
|
92
92
|
);
|
|
93
93
|
await waitForLoad(rendered);
|
|
94
94
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -117,7 +117,7 @@ describe("<DomainCards />", () => {
|
|
|
117
117
|
|
|
118
118
|
const user = userEvent.setup({ delay: null });
|
|
119
119
|
const searchInput = rendered.getByPlaceholderText(
|
|
120
|
-
/domains.search.placeholder/i
|
|
120
|
+
/domains.search.placeholder/i,
|
|
121
121
|
);
|
|
122
122
|
await user.type(searchInput, "other");
|
|
123
123
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
-
import DomainContent from "../DomainContent";
|
|
4
3
|
import { useAuthorized } from "@truedat/core/hooks/useAuthorized";
|
|
5
4
|
import {
|
|
6
5
|
DOMAIN_CONCEPTS,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
DOMAIN_STRUCTURES,
|
|
11
10
|
DOMAIN_SUBDOMAINS,
|
|
12
11
|
} from "@truedat/core/routes";
|
|
12
|
+
import DomainContent from "../DomainContent";
|
|
13
13
|
|
|
14
14
|
jest.mock("@truedat/core/hooks/useAuthorized", () => ({
|
|
15
15
|
useAuthorized: jest.fn(() => true),
|
|
@@ -50,7 +50,7 @@ describe("<DomainContent />", () => {
|
|
|
50
50
|
|
|
51
51
|
it("renders correctly with default route", async () => {
|
|
52
52
|
const rendered = render(
|
|
53
|
-
<DomainContent domain={domain} domains={domains}
|
|
53
|
+
<DomainContent domain={domain} domains={domains} />,
|
|
54
54
|
);
|
|
55
55
|
await waitForLoad(rendered);
|
|
56
56
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -61,7 +61,7 @@ describe("<DomainContent />", () => {
|
|
|
61
61
|
<DomainContent domain={domain} domains={domains} />,
|
|
62
62
|
{
|
|
63
63
|
routes: [DOMAIN_CONCEPTS],
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
65
|
);
|
|
66
66
|
await waitForLoad(rendered);
|
|
67
67
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -72,7 +72,7 @@ describe("<DomainContent />", () => {
|
|
|
72
72
|
<DomainContent domain={domain} domains={domains} />,
|
|
73
73
|
{
|
|
74
74
|
routes: [DOMAIN_STRUCTURES],
|
|
75
|
-
}
|
|
75
|
+
},
|
|
76
76
|
);
|
|
77
77
|
await waitForLoad(rendered);
|
|
78
78
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -84,7 +84,7 @@ describe("<DomainContent />", () => {
|
|
|
84
84
|
<DomainContent domain={domain} domains={domains} />,
|
|
85
85
|
{
|
|
86
86
|
routes: [DOMAIN_STRUCTURES],
|
|
87
|
-
}
|
|
87
|
+
},
|
|
88
88
|
);
|
|
89
89
|
await waitForLoad(rendered);
|
|
90
90
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -95,7 +95,7 @@ describe("<DomainContent />", () => {
|
|
|
95
95
|
<DomainContent domain={domain} domains={domains} />,
|
|
96
96
|
{
|
|
97
97
|
routes: [DOMAIN_IMPLEMENTATIONS],
|
|
98
|
-
}
|
|
98
|
+
},
|
|
99
99
|
);
|
|
100
100
|
await waitForLoad(rendered);
|
|
101
101
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -107,7 +107,7 @@ describe("<DomainContent />", () => {
|
|
|
107
107
|
<DomainContent domain={domain} domains={domains} />,
|
|
108
108
|
{
|
|
109
109
|
routes: [DOMAIN_IMPLEMENTATIONS],
|
|
110
|
-
}
|
|
110
|
+
},
|
|
111
111
|
);
|
|
112
112
|
await waitForLoad(rendered);
|
|
113
113
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -118,7 +118,7 @@ describe("<DomainContent />", () => {
|
|
|
118
118
|
<DomainContent domain={domain} domains={domains} />,
|
|
119
119
|
{
|
|
120
120
|
routes: [DOMAIN_MEMBERS],
|
|
121
|
-
}
|
|
121
|
+
},
|
|
122
122
|
);
|
|
123
123
|
await waitForLoad(rendered);
|
|
124
124
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -129,7 +129,7 @@ describe("<DomainContent />", () => {
|
|
|
129
129
|
<DomainContent domain={domain} domains={domains} />,
|
|
130
130
|
{
|
|
131
131
|
routes: [DOMAIN_MEMBERS_NEW],
|
|
132
|
-
}
|
|
132
|
+
},
|
|
133
133
|
);
|
|
134
134
|
await waitForLoad(rendered);
|
|
135
135
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -140,7 +140,7 @@ describe("<DomainContent />", () => {
|
|
|
140
140
|
<DomainContent domain={domain} domains={domains} />,
|
|
141
141
|
{
|
|
142
142
|
routes: [DOMAIN_SUBDOMAINS],
|
|
143
|
-
}
|
|
143
|
+
},
|
|
144
144
|
);
|
|
145
145
|
await waitForLoad(rendered);
|
|
146
146
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -101,23 +101,23 @@ describe("<DomainForm />", () => {
|
|
|
101
101
|
await waitForLoad(rendered);
|
|
102
102
|
|
|
103
103
|
expect(
|
|
104
|
-
await rendered.findByRole("button", { name: /save/i })
|
|
104
|
+
await rendered.findByRole("button", { name: /save/i }),
|
|
105
105
|
).toBeDisabled();
|
|
106
106
|
|
|
107
107
|
const user = userEvent.setup({ delay: null });
|
|
108
108
|
await act(async () => {
|
|
109
109
|
await user.type(
|
|
110
110
|
await rendered.findByRole("textbox", { name: /name/i }),
|
|
111
|
-
"name"
|
|
111
|
+
"name",
|
|
112
112
|
);
|
|
113
113
|
await user.type(
|
|
114
114
|
await rendered.findByRole("textbox", { name: /external_id/i }),
|
|
115
|
-
"id"
|
|
115
|
+
"id",
|
|
116
116
|
);
|
|
117
117
|
});
|
|
118
118
|
|
|
119
119
|
expect(
|
|
120
|
-
await rendered.findByRole("button", { name: /save/i })
|
|
120
|
+
await rendered.findByRole("button", { name: /save/i }),
|
|
121
121
|
).toBeEnabled();
|
|
122
122
|
});
|
|
123
123
|
|
|
@@ -182,7 +182,7 @@ describe("<DomainForm />", () => {
|
|
|
182
182
|
domain={domain}
|
|
183
183
|
parentableIds={parentableIds}
|
|
184
184
|
onSubmit={jest.fn()}
|
|
185
|
-
|
|
185
|
+
/>,
|
|
186
186
|
);
|
|
187
187
|
await waitForLoad(rendered);
|
|
188
188
|
|
|
@@ -6,7 +6,7 @@ import DomainImplementations from "../DomainImplementations";
|
|
|
6
6
|
|
|
7
7
|
jest.mock("@truedat/core/search/SearchContext", () => {
|
|
8
8
|
const originalModule = jest.requireActual(
|
|
9
|
-
"@truedat/core/search/SearchContext"
|
|
9
|
+
"@truedat/core/search/SearchContext",
|
|
10
10
|
);
|
|
11
11
|
|
|
12
12
|
return {
|
|
@@ -38,7 +38,7 @@ describe("DomainImplementations", () => {
|
|
|
38
38
|
|
|
39
39
|
it("renders DomainImplementations for a given domain", async () => {
|
|
40
40
|
const rendered = render(
|
|
41
|
-
<DomainImplementations domain={{ id: "domain-123" }}
|
|
41
|
+
<DomainImplementations domain={{ id: "domain-123" }} />,
|
|
42
42
|
);
|
|
43
43
|
await waitForLoad(rendered);
|
|
44
44
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -56,7 +56,7 @@ describe("DomainImplementations", () => {
|
|
|
56
56
|
setOnSearchChange: jest.fn(),
|
|
57
57
|
});
|
|
58
58
|
const rendered = render(
|
|
59
|
-
<DomainImplementations domain={{ id: "domain-empty" }}
|
|
59
|
+
<DomainImplementations domain={{ id: "domain-empty" }} />,
|
|
60
60
|
);
|
|
61
61
|
await waitForLoad(rendered);
|
|
62
62
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
3
|
-
import DomainRoutes from "../DomainRoutes";
|
|
4
3
|
import { useAuthorized } from "@truedat/core/hooks/useAuthorized";
|
|
5
4
|
import { DOMAINS, DOMAIN, DOMAINS_NEW } from "@truedat/core/routes";
|
|
5
|
+
import DomainRoutes from "../DomainRoutes";
|
|
6
6
|
|
|
7
7
|
jest.mock("@truedat/core/hooks/useAuthorized", () => ({
|
|
8
8
|
useAuthorized: jest.fn(() => true),
|
|
@@ -35,13 +35,15 @@ describe("<DomainStructures />", () => {
|
|
|
35
35
|
|
|
36
36
|
it("matches the latest snapshot", async () => {
|
|
37
37
|
const rendered = render(
|
|
38
|
-
<SearchContextWrapper
|
|
38
|
+
<SearchContextWrapper>
|
|
39
|
+
<DomainStructures {...props} />
|
|
40
|
+
</SearchContextWrapper>,
|
|
39
41
|
);
|
|
40
42
|
await waitForLoad(rendered);
|
|
41
43
|
await waitFor(() =>
|
|
42
44
|
expect(
|
|
43
|
-
rendered.queryByText(/structures.not_found.body/i)
|
|
44
|
-
).toBeInTheDocument()
|
|
45
|
+
rendered.queryByText(/structures.not_found.body/i),
|
|
46
|
+
).toBeInTheDocument(),
|
|
45
47
|
);
|
|
46
48
|
|
|
47
49
|
expect(rendered.container).toMatchSnapshot();
|
|
@@ -19,14 +19,14 @@ describe("<DomainTabs />", () => {
|
|
|
19
19
|
|
|
20
20
|
it("matches the latest snapshot", () => {
|
|
21
21
|
const { container } = render(
|
|
22
|
-
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig}
|
|
22
|
+
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig} />,
|
|
23
23
|
);
|
|
24
24
|
expect(container).toMatchSnapshot();
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
it("renders all tabs", () => {
|
|
28
28
|
const { getByText } = render(
|
|
29
|
-
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig}
|
|
29
|
+
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig} />,
|
|
30
30
|
);
|
|
31
31
|
|
|
32
32
|
expect(getByText("tabs.subdomains")).toBeInTheDocument();
|
|
@@ -43,7 +43,7 @@ describe("<DomainTabs />", () => {
|
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
const { queryByText } = render(
|
|
46
|
-
<DomainTabs domain={domain} taxonomyConfig={hiddenTabsConfig}
|
|
46
|
+
<DomainTabs domain={domain} taxonomyConfig={hiddenTabsConfig} />,
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
expect(queryByText("Structures")).not.toBeInTheDocument();
|
|
@@ -57,7 +57,7 @@ describe("<DomainTabs />", () => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
const { container } = render(
|
|
60
|
-
<DomainTabs domain={domain} taxonomyConfig={priorityTabsConfig}
|
|
60
|
+
<DomainTabs domain={domain} taxonomyConfig={priorityTabsConfig} />,
|
|
61
61
|
);
|
|
62
62
|
|
|
63
63
|
const tabs = container.querySelectorAll(".item");
|
|
@@ -67,11 +67,11 @@ describe("<DomainTabs />", () => {
|
|
|
67
67
|
|
|
68
68
|
it("hides 'implementations' tab if dqAuthorized is false", () => {
|
|
69
69
|
useAuthorized.mockImplementation(
|
|
70
|
-
(permission) => permission == "data_dictionary"
|
|
70
|
+
(permission) => permission == "data_dictionary",
|
|
71
71
|
);
|
|
72
72
|
|
|
73
73
|
const { queryByText } = render(
|
|
74
|
-
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig}
|
|
74
|
+
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig} />,
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
expect(queryByText("Implementations")).not.toBeInTheDocument();
|
|
@@ -81,7 +81,7 @@ describe("<DomainTabs />", () => {
|
|
|
81
81
|
useAuthorized.mockImplementation((permission) => permission == "quality");
|
|
82
82
|
|
|
83
83
|
const { queryByText } = render(
|
|
84
|
-
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig}
|
|
84
|
+
<DomainTabs domain={domain} taxonomyConfig={taxonomyConfig} />,
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
expect(queryByText("Structures")).not.toBeInTheDocument();
|