@truedat/dd 8.10.5 → 8.10.7
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/components/GrantRequestsDownloadButton.js +13 -7
- package/src/components/GrantsDownloadButton.js +11 -5
- package/src/components/LineageDownloadButton.js +10 -6
- package/src/components/StructureNotesDownloadButton.js +21 -5
- package/src/components/__tests__/StructureNotesDownloadButton.spec.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truedat/dd",
|
|
3
|
-
"version": "8.10.
|
|
3
|
+
"version": "8.10.7",
|
|
4
4
|
"description": "Truedat Web Data Dictionary",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "src/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@testing-library/jest-dom": "^6.6.3",
|
|
55
55
|
"@testing-library/react": "^16.3.0",
|
|
56
56
|
"@testing-library/user-event": "^14.6.1",
|
|
57
|
-
"@truedat/test": "8.10.
|
|
57
|
+
"@truedat/test": "8.10.7",
|
|
58
58
|
"identity-obj-proxy": "^3.0.0",
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
60
|
"redux-saga-test-plan": "^4.0.6"
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"svg-pan-zoom": "^3.6.2",
|
|
90
90
|
"swr": "^2.3.3"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "9b9c72e7d3045158547a4ae9fbc4b73a62283ed8"
|
|
93
93
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Button } from "semantic-ui-react";
|
|
4
|
+
import { Button, Icon } from "semantic-ui-react";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { useSearchContext } from "@truedat/core/search/SearchContext";
|
|
7
7
|
import { useGrantRequestsDownload } from "../hooks/useGrantRequest";
|
|
@@ -47,8 +47,9 @@ export const GrantRequestsDownloadButton = ({
|
|
|
47
47
|
return (
|
|
48
48
|
<Button
|
|
49
49
|
secondary
|
|
50
|
-
icon=
|
|
51
|
-
onClick={() =>
|
|
50
|
+
icon={true}
|
|
51
|
+
onClick={() => {
|
|
52
|
+
if (grantRequestsDownloading) return;
|
|
52
53
|
triggerDownload({
|
|
53
54
|
search_by: searchBy,
|
|
54
55
|
header_labels: headerLabels,
|
|
@@ -56,11 +57,11 @@ export const GrantRequestsDownloadButton = ({
|
|
|
56
57
|
...(_.isEmpty(selectedGrantRequests)
|
|
57
58
|
? searchParams
|
|
58
59
|
: { must: { id: selectedGrantRequests } }),
|
|
59
|
-
})
|
|
60
|
-
}
|
|
61
|
-
loading={grantRequestsDownloading}
|
|
60
|
+
});
|
|
61
|
+
}}
|
|
62
62
|
disabled={
|
|
63
63
|
grantRequestsLoading ||
|
|
64
|
+
grantRequestsDownloading ||
|
|
64
65
|
(_.isEmpty(selectedGrantRequests) &&
|
|
65
66
|
(_.isEmpty(grantRequests) || _.isEmpty(searchParams)))
|
|
66
67
|
}
|
|
@@ -68,7 +69,12 @@ export const GrantRequestsDownloadButton = ({
|
|
|
68
69
|
id: "grantRequest.actions.download.tooltip",
|
|
69
70
|
})}
|
|
70
71
|
data-position="top right"
|
|
71
|
-
|
|
72
|
+
>
|
|
73
|
+
<Icon
|
|
74
|
+
name={grantRequestsDownloading ? "spinner" : "download"}
|
|
75
|
+
loading={grantRequestsDownloading}
|
|
76
|
+
/>
|
|
77
|
+
</Button>
|
|
72
78
|
);
|
|
73
79
|
};
|
|
74
80
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import { Button, Popup } from "semantic-ui-react";
|
|
4
|
+
import { Button, Popup, Icon } from "semantic-ui-react";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { useSearchContext } from "@truedat/core/search/SearchContext";
|
|
7
7
|
import { useGrantDownload } from "../hooks/useGrant";
|
|
@@ -59,7 +59,7 @@ export const GrantsDownloadButton = ({
|
|
|
59
59
|
<span className="trigger-right">
|
|
60
60
|
<Button
|
|
61
61
|
secondary
|
|
62
|
-
icon=
|
|
62
|
+
icon={true}
|
|
63
63
|
onClick={() =>
|
|
64
64
|
triggerDownload({
|
|
65
65
|
search_by: onlyMyGrants ? "user" : "permissions",
|
|
@@ -69,9 +69,15 @@ export const GrantsDownloadButton = ({
|
|
|
69
69
|
...searchParams,
|
|
70
70
|
})
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
disabled={
|
|
73
|
+
grantsDownloading || _.isEmpty(grants) || !hasFilterApplied
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
<Icon
|
|
77
|
+
name={grantsDownloading ? "spinner" : "download"}
|
|
78
|
+
loading={grantsDownloading}
|
|
79
|
+
/>
|
|
80
|
+
</Button>
|
|
75
81
|
</span>
|
|
76
82
|
}
|
|
77
83
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _ from "lodash/fp";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { connect } from "react-redux";
|
|
4
|
-
import { Button, Popup } from "semantic-ui-react";
|
|
4
|
+
import { Button, Popup, Icon } from "semantic-ui-react";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
import { downloadCsvGraph } from "../routines";
|
|
7
7
|
|
|
@@ -49,18 +49,22 @@ export const LineageDownloadButton = ({
|
|
|
49
49
|
className={className}
|
|
50
50
|
compact={compact}
|
|
51
51
|
content={content}
|
|
52
|
-
icon=
|
|
52
|
+
icon={true}
|
|
53
53
|
labelPosition={content ? labelPosition : undefined}
|
|
54
54
|
onClick={() => {
|
|
55
|
-
if (downloadDisabled) return;
|
|
55
|
+
if (downloadDisabled || csvGraphDownloading) return;
|
|
56
56
|
|
|
57
57
|
downloadCsvGraph({ headerLabels, id: _.prop("id")(graph) });
|
|
58
58
|
}}
|
|
59
|
-
|
|
60
|
-
disabled={downloadDisabled}
|
|
59
|
+
disabled={downloadDisabled || csvGraphDownloading}
|
|
61
60
|
secondary={!basic}
|
|
62
61
|
size={size}
|
|
63
|
-
|
|
62
|
+
>
|
|
63
|
+
<Icon
|
|
64
|
+
name={csvGraphDownloading ? "spinner" : "download"}
|
|
65
|
+
loading={csvGraphDownloading}
|
|
66
|
+
/>
|
|
67
|
+
</Button>
|
|
64
68
|
</span>
|
|
65
69
|
}
|
|
66
70
|
/>
|
|
@@ -29,14 +29,19 @@ export const StructureNotesDownloadButton = ({ structureId }) => {
|
|
|
29
29
|
<Modal
|
|
30
30
|
trigger={
|
|
31
31
|
<Button
|
|
32
|
-
icon=
|
|
32
|
+
icon={true}
|
|
33
33
|
onClick={() => setOpen(true)}
|
|
34
|
-
|
|
34
|
+
disabled={isDownloading}
|
|
35
35
|
className="basic structureButton profile"
|
|
36
36
|
data-tooltip={formatMessage({
|
|
37
37
|
id: "structure.actions.downloadNotes.tooltip",
|
|
38
38
|
})}
|
|
39
|
-
|
|
39
|
+
>
|
|
40
|
+
<Icon
|
|
41
|
+
name={isDownloading ? "spinner" : "download"}
|
|
42
|
+
loading={isDownloading}
|
|
43
|
+
/>
|
|
44
|
+
</Button>
|
|
40
45
|
}
|
|
41
46
|
open={open}
|
|
42
47
|
onClose={() => setOpen(false)}
|
|
@@ -62,8 +67,19 @@ export const StructureNotesDownloadButton = ({ structureId }) => {
|
|
|
62
67
|
<Button onClick={() => setOpen(false)}>
|
|
63
68
|
{formatMessage({ id: "actions.cancel" })}
|
|
64
69
|
</Button>
|
|
65
|
-
<Button
|
|
66
|
-
|
|
70
|
+
<Button
|
|
71
|
+
primary
|
|
72
|
+
icon={true}
|
|
73
|
+
onClick={() => {
|
|
74
|
+
if (isDownloading) return;
|
|
75
|
+
handleDownload();
|
|
76
|
+
}}
|
|
77
|
+
disabled={isDownloading}
|
|
78
|
+
>
|
|
79
|
+
<Icon
|
|
80
|
+
name={isDownloading ? "spinner" : "download"}
|
|
81
|
+
loading={isDownloading}
|
|
82
|
+
/>
|
|
67
83
|
{formatMessage({ id: "actions.download" })}
|
|
68
84
|
</Button>
|
|
69
85
|
</Modal.Actions>
|
|
@@ -191,7 +191,9 @@ describe("StructureNotesDownloadButton", () => {
|
|
|
191
191
|
);
|
|
192
192
|
|
|
193
193
|
const button = screen.getByRole("button");
|
|
194
|
-
expect(button).
|
|
194
|
+
expect(button).toBeDisabled();
|
|
195
|
+
const icon = button.querySelector("i");
|
|
196
|
+
expect(icon).toHaveAttribute("class", expect.stringContaining("loading"));
|
|
195
197
|
});
|
|
196
198
|
|
|
197
199
|
it("closes modal when cancel button is clicked", () => {
|