@truedat/audit 6.3.2 → 6.3.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/audit",
|
|
3
|
-
"version": "6.3.
|
|
3
|
+
"version": "6.3.4",
|
|
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.3.
|
|
37
|
+
"@truedat/test": "6.3.4",
|
|
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.3.
|
|
88
|
-
"@truedat/core": "6.3.
|
|
87
|
+
"@truedat/auth": "6.3.4",
|
|
88
|
+
"@truedat/core": "6.3.4",
|
|
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": "e7d4c50cf2989fde79b5d1a46c83e6c6ce34f54d"
|
|
111
111
|
}
|
|
@@ -137,6 +137,10 @@ export const SubscriptionForm = ({
|
|
|
137
137
|
);
|
|
138
138
|
}, [resourceType, events]);
|
|
139
139
|
|
|
140
|
+
const defaultFilters = {
|
|
141
|
+
current: [true],
|
|
142
|
+
status: ["pending_approval", "draft", "rejected", "published"],
|
|
143
|
+
};
|
|
140
144
|
const statuses = _.flow(
|
|
141
145
|
_.pick(events),
|
|
142
146
|
_.values,
|
|
@@ -325,6 +329,7 @@ export const SubscriptionForm = ({
|
|
|
325
329
|
onChange(concept.business_concept_id);
|
|
326
330
|
}}
|
|
327
331
|
businessConceptId={value}
|
|
332
|
+
defaultFilters={defaultFilters}
|
|
328
333
|
/>
|
|
329
334
|
)}
|
|
330
335
|
/>
|
|
@@ -3,9 +3,38 @@ import { waitFor } from "@testing-library/react";
|
|
|
3
3
|
import { render } from "@truedat/test/render";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
5
|
import { domainsMock } from "@truedat/test/mocks";
|
|
6
|
+
import en from "../../messages/en";
|
|
6
7
|
import SubscriptionForm from "../SubscriptionForm";
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
jest.mock("@truedat/bg/concepts/hooks/useConcepts", () => {
|
|
10
|
+
const originalModule = jest.requireActual(
|
|
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
|
+
});
|
|
37
|
+
|
|
9
38
|
const structureActiveFilters = {};
|
|
10
39
|
const roles = [{ name: "role1" }, { name: "role2" }];
|
|
11
40
|
const templates = [
|
|
@@ -36,13 +65,30 @@ const state = {
|
|
|
36
65
|
roles,
|
|
37
66
|
templates,
|
|
38
67
|
users,
|
|
39
|
-
conceptActiveFilters,
|
|
40
68
|
structureActiveFilters,
|
|
41
69
|
};
|
|
42
70
|
|
|
71
|
+
const messages = {
|
|
72
|
+
en: {
|
|
73
|
+
...en,
|
|
74
|
+
"actions.save": "Save",
|
|
75
|
+
"actions.cancel": "Cancel",
|
|
76
|
+
"role.search.placeholder": "Search Roles...",
|
|
77
|
+
"concepts.search.results.empty": "No concepts found",
|
|
78
|
+
"user.search.placeholder": "Search users...",
|
|
79
|
+
"domain.selector.placeholder": "Select a domain...",
|
|
80
|
+
"domain.selector.label": "Domain",
|
|
81
|
+
"structures.not_found.body":
|
|
82
|
+
"No structures have been found matching these filters.",
|
|
83
|
+
"structures.not_found.header": "Nothing found...",
|
|
84
|
+
"structures.search.placeholder": "Search structures...",
|
|
85
|
+
"search.placeholder": "Search...",
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
43
89
|
const variables = { action: "manageSubscriptions" };
|
|
44
90
|
const mocks = [domainsMock(variables), domainsMock(variables)];
|
|
45
|
-
const renderOpts = { state, mocks };
|
|
91
|
+
const renderOpts = { state, mocks, messages };
|
|
46
92
|
|
|
47
93
|
describe("<SubscriptionForm />", () => {
|
|
48
94
|
it("matches the latest snapshot", async () => {
|