@truedat/dd 4.54.11 → 4.56.0

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +6 -6
  3. package/src/api/mutations.js +28 -0
  4. package/src/api/queries.js +36 -0
  5. package/src/components/GrantApprovalRule.js +149 -0
  6. package/src/components/GrantApprovalRuleConditions.js +134 -0
  7. package/src/components/GrantApprovalRuleDeleteButton.js +44 -0
  8. package/src/components/GrantApprovalRuleEdit.js +38 -0
  9. package/src/components/GrantApprovalRuleForm.js +264 -0
  10. package/src/components/GrantApprovalRuleNew.js +15 -0
  11. package/src/components/GrantApprovalRules.js +113 -0
  12. package/src/components/GrantRequest.js +4 -3
  13. package/src/components/GrantRoutes.js +30 -0
  14. package/src/components/StructureSelectorInputField.js +1 -1
  15. package/src/components/__tests__/GrantApprovalRule.spec.js +69 -0
  16. package/src/components/__tests__/GrantApprovalRuleConditions.spec.js +120 -0
  17. package/src/components/__tests__/GrantApprovalRuleDeleteButton.spec.js +56 -0
  18. package/src/components/__tests__/GrantApprovalRuleEdit.spec.js +76 -0
  19. package/src/components/__tests__/GrantApprovalRuleForm.spec.js +135 -0
  20. package/src/components/__tests__/GrantApprovalRuleNew.spec.js +40 -0
  21. package/src/components/__tests__/GrantApprovalRules.spec.js +107 -0
  22. package/src/components/__tests__/StructureGrantDropdown.spec.js +1 -1
  23. package/src/components/__tests__/__snapshots__/GrantApprovalRule.spec.js.snap +239 -0
  24. package/src/components/__tests__/__snapshots__/GrantApprovalRuleConditions.spec.js.snap +819 -0
  25. package/src/components/__tests__/__snapshots__/GrantApprovalRuleDeleteButton.spec.js.snap +11 -0
  26. package/src/components/__tests__/__snapshots__/GrantApprovalRuleEdit.spec.js.snap +487 -0
  27. package/src/components/__tests__/__snapshots__/GrantApprovalRuleForm.spec.js.snap +1036 -0
  28. package/src/components/__tests__/__snapshots__/GrantApprovalRuleNew.spec.js.snap +464 -0
  29. package/src/components/__tests__/__snapshots__/GrantApprovalRules.spec.js.snap +266 -0
  30. package/src/components/__tests__/__snapshots__/GrantRequest.spec.js.snap +2 -2
  31. package/src/components/__tests__/__snapshots__/GrantRoutes.spec.js.snap +27 -5
  32. package/src/messages/en.js +40 -0
  33. package/src/messages/es.js +41 -0
  34. package/src/reducers/__tests__/structureNotes.spec.js +2 -2
  35. package/src/reducers/structureRedirect.js +23 -3
  36. package/src/routines.js +3 -0
  37. package/src/sagas/__tests__/createGrantApprovalRule.spec.js +96 -0
  38. package/src/sagas/__tests__/deleteGrantApprovalRule.spec.js +85 -0
  39. package/src/sagas/__tests__/updateGrantApprovalRule.spec.js +96 -0
  40. package/src/sagas/createGrantApprovalRule.js +26 -0
  41. package/src/sagas/deleteGrantApprovalRule.js +32 -0
  42. package/src/sagas/index.js +9 -0
  43. package/src/sagas/updateGrantApprovalRule.js +26 -0
  44. package/src/selectors/__tests__/getGrantsColumns.spec.js +4 -0
  45. package/src/components/GrantRequestCrumbs.js +0 -25
  46. package/src/components/__tests__/GrantRequestCrumbs.spec.js +0 -18
  47. package/src/components/__tests__/__snapshots__/GrantRequestCrumbs.spec.js.snap +0 -100
@@ -0,0 +1,26 @@
1
+ import { call, put, takeLatest, getContext } from "redux-saga/effects";
2
+ import { UPDATE_GRANT_APPROVAL_RULE } from "../api/mutations";
3
+ import { updateGrantApprovalRule } from "../routines";
4
+
5
+ export function* updateGrantApprovalRuleSaga({ payload }) {
6
+ const client = yield getContext("client");
7
+ try {
8
+ yield put(updateGrantApprovalRule.request(payload));
9
+ const { data } = yield call(client.mutate, {
10
+ mutation: UPDATE_GRANT_APPROVAL_RULE,
11
+ variables: payload,
12
+ });
13
+ yield put(updateGrantApprovalRule.success(data));
14
+ } catch (error) {
15
+ yield put(updateGrantApprovalRule.failure(error.message));
16
+ } finally {
17
+ yield put(updateGrantApprovalRule.fulfill());
18
+ }
19
+ }
20
+
21
+ export function* updateGrantApprovalRuleRequestSaga() {
22
+ yield takeLatest(
23
+ updateGrantApprovalRule.TRIGGER,
24
+ updateGrantApprovalRuleSaga
25
+ );
26
+ }
@@ -13,6 +13,10 @@ import {
13
13
  EndDateDecorator,
14
14
  } from "..";
15
15
 
16
+ jest
17
+ .spyOn(global.Date, "now")
18
+ .mockImplementation(() => new Date("2022-05-17T15:01:01.000Z").valueOf());
19
+
16
20
  const structure = {
17
21
  id: 1,
18
22
  name: "foo",
@@ -1,25 +0,0 @@
1
- import React from "react";
2
- import PropTypes from "prop-types";
3
- import { Breadcrumb } from "semantic-ui-react";
4
- import { useHistory } from "react-router-dom";
5
- import { FormattedMessage } from "react-intl";
6
-
7
- export const GrantRequestCrumbs = ({ title }) => {
8
- const history = useHistory();
9
- const goBack = () => history.goBack();
10
- return (
11
- <Breadcrumb>
12
- <Breadcrumb.Section onClick={goBack} active={false}>
13
- <FormattedMessage id="grantRequests.header" />
14
- </Breadcrumb.Section>
15
- <Breadcrumb.Divider icon="right angle" />
16
- {title && <Breadcrumb.Section active>{title}</Breadcrumb.Section>}
17
- </Breadcrumb>
18
- );
19
- };
20
-
21
- GrantRequestCrumbs.propTypes = {
22
- title: PropTypes.string,
23
- };
24
-
25
- export default GrantRequestCrumbs;
@@ -1,18 +0,0 @@
1
- import React from "react";
2
- import { render } from "@truedat/test/render";
3
- import { GrantRequestCrumbs } from "../GrantRequestCrumbs";
4
-
5
- describe("<GrantRequestCrumbs />", () => {
6
- it("matches the latest snapshot", () => {
7
- const renderOpts = {
8
- messages: {
9
- en: {
10
- "grantRequests.header": "grant requests",
11
- },
12
- },
13
- };
14
- const props = { title: "foo" };
15
- const wrapper = render(<GrantRequestCrumbs {...props} />, renderOpts);
16
- expect(wrapper).toMatchSnapshot();
17
- });
18
- });
@@ -1,100 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`<GrantRequestCrumbs /> matches the latest snapshot 1`] = `
4
- Object {
5
- "asFragment": [Function],
6
- "baseElement": <body>
7
- <div>
8
- <div
9
- class="ui breadcrumb"
10
- >
11
- <a
12
- class="section"
13
- >
14
- grant requests
15
- </a>
16
- <i
17
- aria-hidden="true"
18
- class="right angle icon divider"
19
- />
20
- <div
21
- class="active section"
22
- >
23
- foo
24
- </div>
25
- </div>
26
- </div>
27
- </body>,
28
- "container": <div>
29
- <div
30
- class="ui breadcrumb"
31
- >
32
- <a
33
- class="section"
34
- >
35
- grant requests
36
- </a>
37
- <i
38
- aria-hidden="true"
39
- class="right angle icon divider"
40
- />
41
- <div
42
- class="active section"
43
- >
44
- foo
45
- </div>
46
- </div>
47
- </div>,
48
- "debug": [Function],
49
- "findAllByAltText": [Function],
50
- "findAllByDisplayValue": [Function],
51
- "findAllByLabelText": [Function],
52
- "findAllByPlaceholderText": [Function],
53
- "findAllByRole": [Function],
54
- "findAllByTestId": [Function],
55
- "findAllByText": [Function],
56
- "findAllByTitle": [Function],
57
- "findByAltText": [Function],
58
- "findByDisplayValue": [Function],
59
- "findByLabelText": [Function],
60
- "findByPlaceholderText": [Function],
61
- "findByRole": [Function],
62
- "findByTestId": [Function],
63
- "findByText": [Function],
64
- "findByTitle": [Function],
65
- "getAllByAltText": [Function],
66
- "getAllByDisplayValue": [Function],
67
- "getAllByLabelText": [Function],
68
- "getAllByPlaceholderText": [Function],
69
- "getAllByRole": [Function],
70
- "getAllByTestId": [Function],
71
- "getAllByText": [Function],
72
- "getAllByTitle": [Function],
73
- "getByAltText": [Function],
74
- "getByDisplayValue": [Function],
75
- "getByLabelText": [Function],
76
- "getByPlaceholderText": [Function],
77
- "getByRole": [Function],
78
- "getByTestId": [Function],
79
- "getByText": [Function],
80
- "getByTitle": [Function],
81
- "queryAllByAltText": [Function],
82
- "queryAllByDisplayValue": [Function],
83
- "queryAllByLabelText": [Function],
84
- "queryAllByPlaceholderText": [Function],
85
- "queryAllByRole": [Function],
86
- "queryAllByTestId": [Function],
87
- "queryAllByText": [Function],
88
- "queryAllByTitle": [Function],
89
- "queryByAltText": [Function],
90
- "queryByDisplayValue": [Function],
91
- "queryByLabelText": [Function],
92
- "queryByPlaceholderText": [Function],
93
- "queryByRole": [Function],
94
- "queryByTestId": [Function],
95
- "queryByText": [Function],
96
- "queryByTitle": [Function],
97
- "rerender": [Function],
98
- "unmount": [Function],
99
- }
100
- `;