@truedat/audit 6.6.0 → 6.6.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/audit",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.2",
|
|
4
4
|
"description": "Truedat Web Audit Module",
|
|
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": "6.6.
|
|
37
|
+
"@truedat/test": "6.6.2",
|
|
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",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
86
|
"dependencies": {
|
|
87
|
-
"@truedat/auth": "6.6.
|
|
88
|
-
"@truedat/core": "6.6.
|
|
87
|
+
"@truedat/auth": "6.6.2",
|
|
88
|
+
"@truedat/core": "6.6.2",
|
|
89
89
|
"moment": "^2.29.4",
|
|
90
90
|
"path-to-regexp": "^1.7.0",
|
|
91
91
|
"prop-types": "^15.8.1",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"react-dom": ">= 16.8.6 < 17",
|
|
108
108
|
"semantic-ui-react": ">= 2.0.3 < 2.2"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "b5defab13b213876e57046dc7d9885c6adc4a64d"
|
|
111
111
|
}
|
|
@@ -5,8 +5,6 @@ import { FormattedMessage, useIntl } from "react-intl";
|
|
|
5
5
|
import { Label } from "semantic-ui-react";
|
|
6
6
|
import Moment from "react-moment";
|
|
7
7
|
import { useOnScreen } from "@truedat/core/hooks";
|
|
8
|
-
import { Link } from "react-router-dom";
|
|
9
|
-
import { linkTo } from "@truedat/core/routes";
|
|
10
8
|
|
|
11
9
|
const TEMPLATES = {
|
|
12
10
|
ingest_sent_for_approval: "ingests_pending",
|
|
@@ -73,17 +71,6 @@ export const NotificationEvent = ({
|
|
|
73
71
|
)}
|
|
74
72
|
</h4>
|
|
75
73
|
<p>{event.name}</p>
|
|
76
|
-
{event.event === "grant_request_group_creation" ? (
|
|
77
|
-
<ul>
|
|
78
|
-
{_.map((request) => (
|
|
79
|
-
<li key={request.id}>
|
|
80
|
-
<Link to={linkTo.GRANT_REQUEST({ id: request.id })}>
|
|
81
|
-
{request?.data_structure?.current_version?.name}
|
|
82
|
-
</Link>
|
|
83
|
-
</li>
|
|
84
|
-
))(event.payload?.requests)}
|
|
85
|
-
</ul>
|
|
86
|
-
) : null}
|
|
87
74
|
<Label>
|
|
88
75
|
{eventsWithStatus.includes(template) ? (
|
|
89
76
|
<FormattedMessage
|
|
@@ -2,38 +2,17 @@ import React from "react";
|
|
|
2
2
|
import { waitFor } from "@testing-library/react";
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
domainsMock,
|
|
7
|
+
mockUseStructures,
|
|
8
|
+
mockUseConcepts,
|
|
9
|
+
} from "@truedat/test/mocks";
|
|
10
|
+
import SearchContextWrapper from "@truedat/core/components/common/SearchContextWrapper";
|
|
7
11
|
import SubscriptionForm from "../SubscriptionForm";
|
|
12
|
+
import en from "../../messages/en";
|
|
8
13
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@truedat/bg/concepts/hooks/useConcepts"
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
__esModule: true,
|
|
16
|
-
...originalModule,
|
|
17
|
-
useConceptFilters: () => ({
|
|
18
|
-
trigger: () => ({
|
|
19
|
-
then: (callback) =>
|
|
20
|
-
callback({
|
|
21
|
-
data: [],
|
|
22
|
-
}),
|
|
23
|
-
}),
|
|
24
|
-
}),
|
|
25
|
-
|
|
26
|
-
useConceptVersionsSearch: () => ({
|
|
27
|
-
trigger: () => ({
|
|
28
|
-
then: (callback) =>
|
|
29
|
-
callback({
|
|
30
|
-
data: [],
|
|
31
|
-
headers: {},
|
|
32
|
-
}),
|
|
33
|
-
}),
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
14
|
+
mockUseStructures();
|
|
15
|
+
mockUseConcepts();
|
|
37
16
|
|
|
38
17
|
const structureActiveFilters = {};
|
|
39
18
|
const roles = [{ name: "role1" }, { name: "role2" }];
|
|
@@ -83,12 +62,18 @@ const messages = {
|
|
|
83
62
|
"structures.not_found.header": "Nothing found...",
|
|
84
63
|
"structures.search.placeholder": "Search structures...",
|
|
85
64
|
"search.placeholder": "Search...",
|
|
65
|
+
"structures.loading.header": "Loading structures...",
|
|
86
66
|
},
|
|
87
67
|
};
|
|
88
68
|
|
|
89
69
|
const variables = { action: "manageSubscriptions" };
|
|
90
70
|
const mocks = [domainsMock(variables), domainsMock(variables)];
|
|
91
71
|
const renderOpts = { state, mocks, messages };
|
|
72
|
+
const searchProps = {
|
|
73
|
+
loading: false,
|
|
74
|
+
searchParams: {},
|
|
75
|
+
searchData: { data: [] },
|
|
76
|
+
};
|
|
92
77
|
|
|
93
78
|
describe("<SubscriptionForm />", () => {
|
|
94
79
|
it("matches the latest snapshot", async () => {
|
|
@@ -101,7 +86,9 @@ describe("<SubscriptionForm />", () => {
|
|
|
101
86
|
const onSubmit = jest.fn();
|
|
102
87
|
const props = { onSubmit };
|
|
103
88
|
const { getByRole, findByText, queryByTestId, queryByText } = render(
|
|
104
|
-
<
|
|
89
|
+
<SearchContextWrapper props={searchProps}>
|
|
90
|
+
<SubscriptionForm {...props} />
|
|
91
|
+
</SearchContextWrapper>,
|
|
105
92
|
renderOpts
|
|
106
93
|
);
|
|
107
94
|
await waitFor(() => {
|