@truedat/dd 8.12.2 → 8.12.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 +3 -3
- package/src/api/__tests__/queries.spec.js +55 -0
- package/src/api/queries.js +31 -0
- package/src/components/Grant.js +106 -16
- package/src/components/GrantRequest.js +2 -2
- package/src/components/GrantRequestBulkApprovalPopup.js +0 -1
- package/src/components/GrantsDownloadButton.js +9 -1
- package/src/components/GrantsTable.js +4 -1
- package/src/components/StructureFields.js +7 -4
- package/src/components/StructureGrantCartUserSelector.js +29 -4
- package/src/components/StructureGrantDropdown.js +7 -1
- package/src/components/StructureGrants.js +4 -1
- package/src/components/StructuresUpdateOption.js +2 -2
- package/src/components/SystemStructures.js +3 -3
- package/src/components/__tests__/CatalogViewConfigForm.spec.js +2 -0
- package/src/components/__tests__/EditDomainForm.spec.js +3 -1
- package/src/components/__tests__/Grant.spec.js +171 -0
- package/src/components/__tests__/GrantApprovalRuleForm.spec.js +2 -0
- package/src/components/__tests__/GrantApprovalRuleNew.spec.js +8 -0
- package/src/components/__tests__/GrantApprovalRules.spec.js +4 -0
- package/src/components/__tests__/GrantRequest.spec.js +4 -4
- package/src/components/__tests__/GrantRequestBulkActions.spec.js +1 -4
- package/src/components/__tests__/GrantRequestsSearchResults.spec.js +2 -0
- package/src/components/__tests__/GrantsDownloadButton.spec.js +58 -2
- package/src/components/__tests__/GrantsTable.spec.js +22 -2
- package/src/components/__tests__/LineageDefs.spec.js +6 -1
- package/src/components/__tests__/LineageForm.spec.js +1 -0
- package/src/components/__tests__/LineageGraphToolbar.spec.js +19 -17
- package/src/components/__tests__/LineageInspectorPanel.spec.js +17 -9
- package/src/components/__tests__/ProfileGroup.spec.js +7 -1
- package/src/components/__tests__/ReferenceDatasetForm.spec.js +2 -0
- package/src/components/__tests__/ReferenceDatasetRoutes.spec.js +9 -0
- package/src/components/__tests__/StructureGrantCartCheckout.spec.js +39 -1
- package/src/components/__tests__/StructureGrantCartInformation.spec.js +5 -2
- package/src/components/__tests__/StructureGrantCartUserSelector.spec.js +128 -0
- package/src/components/__tests__/StructureGrantDropdown.spec.js +92 -0
- package/src/components/__tests__/StructureGrantListButton.spec.js +70 -0
- package/src/components/__tests__/StructureGrantSummaryButton.spec.js +36 -1
- package/src/components/__tests__/StructureGrants.spec.js +12 -0
- package/src/components/__tests__/StructureRelationRow.spec.js +72 -4
- package/src/components/__tests__/StructureRelations.spec.js +18 -0
- package/src/components/__tests__/StructureRoles.spec.js +9 -0
- package/src/components/__tests__/StructureRow.spec.js +13 -4
- package/src/components/__tests__/StructureSelector.spec.js +2 -0
- package/src/components/__tests__/StructureTag.spec.js +2 -0
- package/src/components/__tests__/StructureTagForm.spec.js +2 -0
- package/src/components/__tests__/StructureType.spec.js +3 -1
- package/src/components/__tests__/StructureTypeForm.spec.js +3 -1
- package/src/components/__tests__/StructureView.spec.js +17 -1
- package/src/components/__tests__/StructuresGrantRequestView.spec.js +2 -0
- package/src/components/__tests__/StructuresView.spec.js +2 -1
- package/src/components/__tests__/Tag.spec.js +4 -1
- package/src/components/__tests__/Tags.spec.js +7 -1
- package/src/components/__tests__/__snapshots__/GrantsTable.spec.js.snap +34 -2
- package/src/components/__tests__/__snapshots__/LineageDefs.spec.js.snap +32 -30
- package/src/components/__tests__/__snapshots__/StructureFields.spec.js.snap +1 -16
- package/src/components/__tests__/__snapshots__/StructureRelationRow.spec.js.snap +23 -19
- package/src/components/__tests__/__snapshots__/StructureRow.spec.js.snap +28 -24
- package/src/components/__tests__/__snapshots__/StructuresUpdateOption.spec.js.snap +7 -3
- package/src/messages/en.js +2 -2
- package/src/messages/es.js +2 -2
- package/src/reducers/__tests__/grantRequestsCart.spec.js +17 -0
- package/src/reducers/__tests__/structureRelations.spec.js +28 -0
- package/src/reducers/grantRequestsCart.js +3 -0
- package/src/selectors/__tests__/__snapshots__/getGrantsColumns.spec.js.snap +1 -9
- package/src/selectors/__tests__/getGrantRequestsSearchColumns.spec.js +11 -4
- package/src/selectors/__tests__/getGrantsColumns.spec.js +295 -0
- package/src/selectors/getBusinessConceptsLinksToStructuresColumnsSelector.js +3 -5
- package/src/selectors/getGrantRequestsSearchColumns.js +3 -5
- package/src/selectors/getGrantsColumns.js +85 -11
- package/src/selectors/getLinkedImplementationsToStructuresColumns.js +3 -7
- package/src/selectors/getStructureFieldColumns.js +7 -6
- package/src/selectors/getStructureProperties.js +2 -5
- package/src/selectors/getStructuresUploadEventColumns.js +2 -7
- package/src/selectors/structureColumnsSelector.js +13 -16
|
@@ -4,6 +4,15 @@ import { render, waitForLoad } from "@truedat/test/render";
|
|
|
4
4
|
import _ from "lodash/fp";
|
|
5
5
|
import { StructureRow } from "../StructureRow";
|
|
6
6
|
|
|
7
|
+
const renderRow = (props) =>
|
|
8
|
+
render(
|
|
9
|
+
<table>
|
|
10
|
+
<tbody>
|
|
11
|
+
<StructureRow {...props} />
|
|
12
|
+
</tbody>
|
|
13
|
+
</table>,
|
|
14
|
+
);
|
|
15
|
+
|
|
7
16
|
describe("<StructureRow />", () => {
|
|
8
17
|
const structure = {
|
|
9
18
|
id: 1,
|
|
@@ -22,7 +31,7 @@ describe("<StructureRow />", () => {
|
|
|
22
31
|
|
|
23
32
|
it("matches the latest snapshot", async () => {
|
|
24
33
|
const props = { structure, columns };
|
|
25
|
-
const rendered =
|
|
34
|
+
const rendered = renderRow(props);
|
|
26
35
|
await waitForLoad(rendered);
|
|
27
36
|
expect(rendered.container).toMatchSnapshot();
|
|
28
37
|
});
|
|
@@ -30,7 +39,7 @@ describe("<StructureRow />", () => {
|
|
|
30
39
|
it("clicking the row will pass the structure to onClick()", async () => {
|
|
31
40
|
const onClick = jest.fn();
|
|
32
41
|
const props = { structure, columns, onClick };
|
|
33
|
-
const rendered =
|
|
42
|
+
const rendered = renderRow(props);
|
|
34
43
|
await waitForLoad(rendered);
|
|
35
44
|
const user = userEvent.setup({ delay: null });
|
|
36
45
|
|
|
@@ -56,7 +65,7 @@ describe("<StructureRow />", () => {
|
|
|
56
65
|
},
|
|
57
66
|
];
|
|
58
67
|
const props = { structure: testStructure, columns: testColumns };
|
|
59
|
-
const rendered =
|
|
68
|
+
const rendered = renderRow(props);
|
|
60
69
|
await waitForLoad(rendered);
|
|
61
70
|
|
|
62
71
|
expect(rendered.container.querySelector("td")).toHaveTextContent(testValue);
|
|
@@ -71,7 +80,7 @@ describe("<StructureRow />", () => {
|
|
|
71
80
|
};
|
|
72
81
|
const testColumns = [{ name: "testObject", fieldDecorator }];
|
|
73
82
|
const props = { structure: testStructure, columns: testColumns };
|
|
74
|
-
const rendered =
|
|
83
|
+
const rendered = renderRow(props);
|
|
75
84
|
await waitForLoad(rendered);
|
|
76
85
|
|
|
77
86
|
const decoratedValue = fieldDecorator(testValue);
|
|
@@ -4,6 +4,8 @@ import { render, waitForLoad } from "@truedat/test/render";
|
|
|
4
4
|
import { StructureTagForm } from "../StructureTagForm";
|
|
5
5
|
|
|
6
6
|
describe("<StructureTagForm />", () => {
|
|
7
|
+
beforeEach(() => jest.useRealTimers());
|
|
8
|
+
|
|
7
9
|
const tags = [
|
|
8
10
|
{ id: "1", name: "Tag1", description: "desc1" },
|
|
9
11
|
{ id: "2", name: "Tag2", description: "desc2" },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { act } from "@testing-library/react";
|
|
1
2
|
import { render } from "@truedat/test/render";
|
|
2
3
|
import StructureType from "../StructureType";
|
|
3
4
|
|
|
@@ -17,8 +18,9 @@ const renderOpts = {
|
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
describe("<StructureType />", () => {
|
|
20
|
-
it("matches the latest snapshot", () => {
|
|
21
|
+
it("matches the latest snapshot", async () => {
|
|
21
22
|
const { container } = render(<StructureType />, renderOpts);
|
|
23
|
+
await act(async () => {});
|
|
22
24
|
expect(container).toMatchSnapshot();
|
|
23
25
|
});
|
|
24
26
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { act } from "@testing-library/react";
|
|
1
2
|
import { render } from "@truedat/test/render";
|
|
2
3
|
import StructureTypeForm from "../StructureTypeForm";
|
|
3
4
|
|
|
@@ -39,8 +40,9 @@ const renderOpts = {
|
|
|
39
40
|
};
|
|
40
41
|
|
|
41
42
|
describe("<StructureTypeForm />", () => {
|
|
42
|
-
it("matches the latest snapshot", () => {
|
|
43
|
+
it("matches the latest snapshot", async () => {
|
|
43
44
|
const { container } = render(<StructureTypeForm />, renderOpts);
|
|
45
|
+
await act(async () => {});
|
|
44
46
|
expect(container).toMatchSnapshot();
|
|
45
47
|
});
|
|
46
48
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { render } from "@truedat/test/render";
|
|
2
2
|
import { waitFor } from "@testing-library/react";
|
|
3
|
+
import { STRUCTURE_TAGS_QUERY } from "../../api/queries";
|
|
3
4
|
import StructureView from "../StructureView";
|
|
4
5
|
|
|
6
|
+
jest.mock("../../hooks/useBucketStructures", () => ({
|
|
7
|
+
useBucketStructures: () => ({ data: undefined, isLoading: true }),
|
|
8
|
+
}));
|
|
9
|
+
|
|
5
10
|
jest.mock("react-router", () => ({
|
|
6
11
|
...jest.requireActual("react-router"),
|
|
7
12
|
useParams: () => ({ id: 1 }),
|
|
@@ -33,6 +38,14 @@ const commonState = {
|
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
describe("<StructureView />", () => {
|
|
41
|
+
const structureTagsMock = {
|
|
42
|
+
request: { query: STRUCTURE_TAGS_QUERY, variables: { id: 1 } },
|
|
43
|
+
result: {
|
|
44
|
+
data: {
|
|
45
|
+
dataStructure: { id: 1, availableTags: [], structureTags: [] },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
36
49
|
it("Some inner component shows the structure name", () => {
|
|
37
50
|
const renderOpts = {
|
|
38
51
|
state: {
|
|
@@ -48,7 +61,10 @@ describe("<StructureView />", () => {
|
|
|
48
61
|
},
|
|
49
62
|
};
|
|
50
63
|
|
|
51
|
-
const { getAllByText } = render(<StructureView />,
|
|
64
|
+
const { getAllByText } = render(<StructureView />, {
|
|
65
|
+
...renderOpts,
|
|
66
|
+
mocks: [structureTagsMock],
|
|
67
|
+
});
|
|
52
68
|
expect(getAllByText("some_db")[0]).toBeInTheDocument();
|
|
53
69
|
});
|
|
54
70
|
|
|
@@ -6,6 +6,8 @@ import { functionsMock } from "@truedat/test/mocks";
|
|
|
6
6
|
import { StructuresGrantRequestView } from "../StructuresGrantRequestView";
|
|
7
7
|
import en from "../../messages/en";
|
|
8
8
|
|
|
9
|
+
jest.mock("@truedat/core/hooks/useUserFilters");
|
|
10
|
+
|
|
9
11
|
const mockHistory = jest.fn();
|
|
10
12
|
|
|
11
13
|
jest.mock("react-router", () => ({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import _ from "lodash/fp";
|
|
2
1
|
import { within } from "@testing-library/react";
|
|
3
2
|
import { render, waitForLoad } from "@truedat/test/render";
|
|
4
3
|
import SearchContext from "@truedat/core/search/SearchContext";
|
|
5
4
|
import StructuresView from "../StructuresView";
|
|
6
5
|
import { StructuresViewContent } from "../StructuresView";
|
|
7
6
|
|
|
7
|
+
jest.mock("@truedat/core/hooks/useUserFilters");
|
|
8
|
+
|
|
8
9
|
const mockHistory = jest.fn();
|
|
9
10
|
|
|
10
11
|
jest.mock("react-router", () => ({
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { render } from "@truedat/test/render";
|
|
2
|
+
import { domainsMock } from "@truedat/test/mocks";
|
|
2
3
|
import Tag from "../Tag";
|
|
3
4
|
|
|
4
5
|
describe("<Tag />", () => {
|
|
5
6
|
it("matches the latest snapshot", () => {
|
|
6
7
|
const createTag = jest.fn();
|
|
7
|
-
const { container } = render(<Tag createTag={createTag}
|
|
8
|
+
const { container } = render(<Tag createTag={createTag} />, {
|
|
9
|
+
mocks: [domainsMock({ action: "manageTags" })],
|
|
10
|
+
});
|
|
8
11
|
expect(container).toMatchSnapshot();
|
|
9
12
|
});
|
|
10
13
|
});
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { render } from "@truedat/test/render";
|
|
2
|
+
import { TAGS_QUERY } from "../../api/queries";
|
|
2
3
|
import Tags from "../Tags";
|
|
3
4
|
|
|
5
|
+
const tagsMock = {
|
|
6
|
+
request: { query: TAGS_QUERY },
|
|
7
|
+
result: { data: { tags: [] } },
|
|
8
|
+
};
|
|
9
|
+
|
|
4
10
|
describe("<Tags />", () => {
|
|
5
11
|
it("matches the latest snapshot", () => {
|
|
6
|
-
const { container } = render(<Tags
|
|
12
|
+
const { container } = render(<Tags />, { mocks: [tagsMock] });
|
|
7
13
|
expect(container).toMatchSnapshot();
|
|
8
14
|
});
|
|
9
15
|
});
|
|
@@ -41,7 +41,23 @@ exports[`<GrantsTable /> matches the latest snapshot 1`] = `
|
|
|
41
41
|
>
|
|
42
42
|
<td
|
|
43
43
|
class=""
|
|
44
|
-
|
|
44
|
+
>
|
|
45
|
+
<h4
|
|
46
|
+
class="ui header"
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
class="content"
|
|
50
|
+
>
|
|
51
|
+
user_full_name_1
|
|
52
|
+
|
|
53
|
+
<div
|
|
54
|
+
class="sub header"
|
|
55
|
+
>
|
|
56
|
+
user1@example.com
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</h4>
|
|
60
|
+
</td>
|
|
45
61
|
<td
|
|
46
62
|
class=""
|
|
47
63
|
>
|
|
@@ -92,7 +108,23 @@ exports[`<GrantsTable /> matches the latest snapshot 1`] = `
|
|
|
92
108
|
>
|
|
93
109
|
<td
|
|
94
110
|
class=""
|
|
95
|
-
|
|
111
|
+
>
|
|
112
|
+
<h4
|
|
113
|
+
class="ui header"
|
|
114
|
+
>
|
|
115
|
+
<div
|
|
116
|
+
class="content"
|
|
117
|
+
>
|
|
118
|
+
user_full_name_2
|
|
119
|
+
|
|
120
|
+
<div
|
|
121
|
+
class="sub header"
|
|
122
|
+
>
|
|
123
|
+
user2@example.com
|
|
124
|
+
</div>
|
|
125
|
+
</div>
|
|
126
|
+
</h4>
|
|
127
|
+
</td>
|
|
96
128
|
<td
|
|
97
129
|
class=""
|
|
98
130
|
>
|
|
@@ -2,35 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<LineageDefs /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
<svg>
|
|
6
|
+
<defs>
|
|
7
|
+
<marker
|
|
8
|
+
id="end"
|
|
9
|
+
markerHeight="6"
|
|
10
|
+
markerWidth="6"
|
|
11
|
+
orient="auto"
|
|
12
|
+
refX="10"
|
|
13
|
+
refY="0"
|
|
14
|
+
viewBox="0 -5 10 10"
|
|
15
|
+
>
|
|
16
|
+
<path
|
|
17
|
+
d="M0,-5L10,0L0,5L0,-5"
|
|
18
|
+
fill="#999"
|
|
19
|
+
/>
|
|
20
|
+
</marker>
|
|
21
|
+
<marker
|
|
22
|
+
id="end-active"
|
|
23
|
+
markerHeight="6"
|
|
24
|
+
markerWidth="6"
|
|
25
|
+
orient="auto"
|
|
26
|
+
refX="10"
|
|
27
|
+
refY="0"
|
|
28
|
+
viewBox="0 -5 10 10"
|
|
29
|
+
>
|
|
30
|
+
<path
|
|
31
|
+
d="M0,-5L10,0L0,5L0,-5"
|
|
32
|
+
fill="orangered"
|
|
33
|
+
/>
|
|
34
|
+
</marker>
|
|
35
|
+
</defs>
|
|
36
|
+
</svg>
|
|
35
37
|
</div>
|
|
36
38
|
`;
|
|
@@ -142,22 +142,7 @@ exports[`<StructureFields /> matches the latest snapshot 1`] = `
|
|
|
142
142
|
</td>
|
|
143
143
|
<td
|
|
144
144
|
class=""
|
|
145
|
-
|
|
146
|
-
<div
|
|
147
|
-
class="ui list"
|
|
148
|
-
role="list"
|
|
149
|
-
>
|
|
150
|
-
<div
|
|
151
|
-
class="item"
|
|
152
|
-
role="listitem"
|
|
153
|
-
>
|
|
154
|
-
<a
|
|
155
|
-
data-discover="true"
|
|
156
|
-
href="/concepts/123/versions/current"
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</td>
|
|
145
|
+
/>
|
|
161
146
|
</tr>
|
|
162
147
|
<tr
|
|
163
148
|
class=""
|
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<StructureRelationRow /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
<table>
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr
|
|
8
|
+
class=""
|
|
9
|
+
>
|
|
10
|
+
<td
|
|
11
|
+
class=""
|
|
12
|
+
>
|
|
13
|
+
Structure 1
|
|
14
|
+
</td>
|
|
15
|
+
<td
|
|
16
|
+
class=""
|
|
17
|
+
>
|
|
18
|
+
Some Type 1
|
|
19
|
+
</td>
|
|
20
|
+
<td
|
|
21
|
+
class=""
|
|
22
|
+
>
|
|
23
|
+
used_by
|
|
24
|
+
</td>
|
|
25
|
+
</tr>
|
|
26
|
+
</tbody>
|
|
27
|
+
</table>
|
|
24
28
|
</div>
|
|
25
29
|
`;
|
|
@@ -2,29 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<StructureRow /> matches the latest snapshot 1`] = `
|
|
4
4
|
<div>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
5
|
+
<table>
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr
|
|
8
|
+
class=""
|
|
9
|
+
>
|
|
10
|
+
<td
|
|
11
|
+
class="structure-cell-overflow"
|
|
12
|
+
>
|
|
13
|
+
s1
|
|
14
|
+
</td>
|
|
15
|
+
<td
|
|
16
|
+
class=""
|
|
17
|
+
>
|
|
18
|
+
org
|
|
19
|
+
</td>
|
|
20
|
+
<td
|
|
21
|
+
class=""
|
|
22
|
+
>
|
|
23
|
+
sys
|
|
24
|
+
</td>
|
|
25
|
+
<td
|
|
26
|
+
class=""
|
|
27
|
+
>
|
|
28
|
+
gp
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
29
33
|
</div>
|
|
30
34
|
`;
|
|
@@ -11,9 +11,13 @@ exports[`<StructuresUpdateOption /> matches the latest snapshot 1`] = `
|
|
|
11
11
|
aria-hidden="true"
|
|
12
12
|
class="refresh icon"
|
|
13
13
|
/>
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<div
|
|
15
|
+
class="text"
|
|
16
|
+
>
|
|
17
|
+
<span>
|
|
18
|
+
update
|
|
19
|
+
</span>
|
|
20
|
+
</div>
|
|
17
21
|
</div>
|
|
18
22
|
</div>
|
|
19
23
|
`;
|
package/src/messages/en.js
CHANGED
|
@@ -132,8 +132,8 @@ export default {
|
|
|
132
132
|
"grantRequest.header.updated_at": "Updated",
|
|
133
133
|
"grantRequest.header.user": "User",
|
|
134
134
|
"grantRequest.header.group": "User group",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
135
|
+
"deleted.user": "Deleted user",
|
|
136
|
+
"deleted.group": "Deleted group",
|
|
137
137
|
"grantRequest.header.createdBy": "Created by",
|
|
138
138
|
"grantRequest.header.create": "Create grant request",
|
|
139
139
|
"grantRequest.header.type": "Request type",
|
package/src/messages/es.js
CHANGED
|
@@ -135,8 +135,8 @@ export default {
|
|
|
135
135
|
"grantRequest.header.updated_at": "Actualizado",
|
|
136
136
|
"grantRequest.header.user": "Usuario",
|
|
137
137
|
"grantRequest.header.group": "Grupo de usuarios",
|
|
138
|
-
"
|
|
139
|
-
"
|
|
138
|
+
"deleted.user": "Usuario eliminado",
|
|
139
|
+
"deleted.group": "Grupo eliminado",
|
|
140
140
|
"grantRequest.header.createdBy": "Creado por",
|
|
141
141
|
"grantRequest.header.create": "Crear petición de acceso",
|
|
142
142
|
"grantRequest.header.type": "Tipo de petición",
|
|
@@ -497,4 +497,21 @@ describe("reducers: grantRequestsCart", () => {
|
|
|
497
497
|
expect([null, undefined, ""]).toContain(state.user?.id);
|
|
498
498
|
expect(state.user?.id).not.toBe("group:10");
|
|
499
499
|
});
|
|
500
|
+
|
|
501
|
+
it("sets user_group_id when setGrantChangeRequestCart.TRIGGER opens a group grant", () => {
|
|
502
|
+
const structure = { id: 1 };
|
|
503
|
+
const grant = {
|
|
504
|
+
id: 2,
|
|
505
|
+
user_id: null,
|
|
506
|
+
user_group_id: 10,
|
|
507
|
+
detail: {},
|
|
508
|
+
};
|
|
509
|
+
const state = grantRequestsCart(initialState, {
|
|
510
|
+
type: setGrantChangeRequestCart.TRIGGER,
|
|
511
|
+
payload: { structure, grant },
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
expect(state.user_group_id).toBe(10);
|
|
515
|
+
expect(state.user?.id ?? null).toBeNull();
|
|
516
|
+
});
|
|
500
517
|
});
|
|
@@ -95,3 +95,31 @@ describe("reducers: parentRelations", () => {
|
|
|
95
95
|
expect(parentRelations(fooState, { type: "FOO" })).toBe(fooState);
|
|
96
96
|
});
|
|
97
97
|
});
|
|
98
|
+
|
|
99
|
+
describe("reducers: structure relation concept links", () => {
|
|
100
|
+
const links = [{ name: "foo concept", resource_id: "1" }];
|
|
101
|
+
const data = {
|
|
102
|
+
relations: {
|
|
103
|
+
children: [{ id: 1, links }],
|
|
104
|
+
parents: [{ id: 2, links }],
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
it("should keep concept links on children relations", () => {
|
|
109
|
+
expect(
|
|
110
|
+
childrenRelations([], {
|
|
111
|
+
type: fetchStructure.SUCCESS,
|
|
112
|
+
payload: { data },
|
|
113
|
+
}),
|
|
114
|
+
).toEqual([{ id: 1, links }]);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it("should keep concept links on parent relations", () => {
|
|
118
|
+
expect(
|
|
119
|
+
parentRelations([], {
|
|
120
|
+
type: fetchStructure.SUCCESS,
|
|
121
|
+
payload: { data },
|
|
122
|
+
}),
|
|
123
|
+
).toEqual([{ id: 2, links }]);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
@@ -127,6 +127,9 @@ const grantRequestsCart = (state = initialState, { type, payload }) => {
|
|
|
127
127
|
templateContent: formatLegacyContent(grant.detail),
|
|
128
128
|
modificationGrant: grant,
|
|
129
129
|
structures: [mapPayload(structure)],
|
|
130
|
+
...(_.isNil(grant?.user_group_id)
|
|
131
|
+
? {}
|
|
132
|
+
: { user_group_id: grant.user_group_id }),
|
|
130
133
|
};
|
|
131
134
|
}
|
|
132
135
|
case updateGrantRequestFilter.TRIGGER:
|
|
@@ -73,8 +73,8 @@ describe("selectors: getGrantRequestsSearchColumns", () => {
|
|
|
73
73
|
en: {
|
|
74
74
|
"grantRequest.header.user": "User",
|
|
75
75
|
"grantRequest.header.group": "User group",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
76
|
+
"deleted.user": "Deleted user",
|
|
77
|
+
"deleted.group": "Deleted group",
|
|
78
78
|
},
|
|
79
79
|
},
|
|
80
80
|
},
|
|
@@ -100,8 +100,8 @@ describe("selectors: getGrantRequestsSearchColumns", () => {
|
|
|
100
100
|
en: {
|
|
101
101
|
"grantRequest.header.user": "User",
|
|
102
102
|
"grantRequest.header.group": "User group",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
103
|
+
"deleted.user": "Deleted user",
|
|
104
|
+
"deleted.group": "Deleted group",
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
},
|
|
@@ -109,4 +109,11 @@ describe("selectors: getGrantRequestsSearchColumns", () => {
|
|
|
109
109
|
expect(rendered.getByText(/^deleted group$/i)).toBeInTheDocument();
|
|
110
110
|
expect(rendered.queryByText(/^deleted user$/i)).not.toBeInTheDocument();
|
|
111
111
|
});
|
|
112
|
+
|
|
113
|
+
it("sorts the user column by user_or_group.raw", () => {
|
|
114
|
+
const column = _.find({ name: "user" })(
|
|
115
|
+
defaultGrantRequestsSearchTableColumns,
|
|
116
|
+
);
|
|
117
|
+
expect(column.sort.name).toBe("user_or_group.raw");
|
|
118
|
+
});
|
|
112
119
|
});
|