@gen3/frontend 0.12.13 → 0.12.14
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/LICENSE +2 -188
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js +2 -2
- package/dist/dts/features/CohortBuilder/downloads/ActionButton.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js +11 -2
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.js.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.stories.d.ts +29 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.stories.d.ts.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.stories.js +58 -0
- package/dist/dts/features/CohortBuilder/downloads/CohortActionButton.stories.js.map +1 -0
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts +22 -0
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.d.ts.map +1 -1
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js +75 -43
- package/dist/dts/features/CohortBuilder/downloads/downloadActionHook.js.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/AggMetaMDSProxy/DataLoader.d.ts +3 -0
- package/dist/dts/features/Discovery/DataLoaders/AggMetaMDSProxy/DataLoader.d.ts.map +1 -0
- package/dist/dts/features/Discovery/DataLoaders/AggMetaMDSProxy/DataLoader.js +141 -0
- package/dist/dts/features/Discovery/DataLoaders/AggMetaMDSProxy/DataLoader.js.map +1 -0
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.js +2 -16
- package/dist/dts/features/Discovery/DataLoaders/MDSAllLocal/DataLoader.js.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/registeredDataLoaders.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/registeredDataLoaders.js +2 -0
- package/dist/dts/features/Discovery/DataLoaders/registeredDataLoaders.js.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/utils.d.ts +2 -1
- package/dist/dts/features/Discovery/DataLoaders/utils.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DataLoaders/utils.js +15 -0
- package/dist/dts/features/Discovery/DataLoaders/utils.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js +16 -20
- package/dist/dts/features/Discovery/DiscoveryIndexPanel.js.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.d.ts.map +1 -1
- package/dist/dts/features/Discovery/DiscoveryTable.js +7 -0
- package/dist/dts/features/Discovery/DiscoveryTable.js.map +1 -1
- package/dist/dts/features/Discovery/Search/SearchInputWithSuggestions.d.ts +4 -1
- package/dist/dts/features/Discovery/Search/SearchInputWithSuggestions.d.ts.map +1 -1
- package/dist/dts/features/Discovery/Search/SearchInputWithSuggestions.js +5 -7
- package/dist/dts/features/Discovery/Search/SearchInputWithSuggestions.js.map +1 -1
- package/dist/dts/utils/download.d.ts +1 -3
- package/dist/dts/utils/download.d.ts.map +1 -1
- package/dist/dts/utils/download.js +5 -25
- package/dist/dts/utils/download.js.map +1 -1
- package/dist/index/cjs/QueryPanel-DDhoqTsI.js +24 -0
- package/dist/index/cjs/QueryPanel-DDhoqTsI.js.map +1 -0
- package/dist/index/cjs/index-B8IAMxS_.js +31028 -0
- package/dist/index/cjs/index-B8IAMxS_.js.map +1 -0
- package/dist/index/cjs/index.js +1 -1
- package/dist/index/esm/QueryPanel-BgzwCqTi.js +22 -0
- package/dist/index/esm/QueryPanel-BgzwCqTi.js.map +1 -0
- package/dist/index/esm/index-BAsyl9k4.js +30786 -0
- package/dist/index/esm/index-BAsyl9k4.js.map +1 -0
- package/dist/index/esm/index.js +1 -1
- package/dist/index.d.ts +22 -0
- package/dist/pages/cjs/CohortBuilder-DiRT1y0l.js +482 -0
- package/dist/pages/cjs/CohortBuilder-DiRT1y0l.js.map +1 -0
- package/dist/pages/cjs/index-b5LLUTR9.js +22843 -0
- package/dist/pages/cjs/index-b5LLUTR9.js.map +1 -0
- package/dist/pages/cjs/index.js +1 -1
- package/dist/pages/esm/CohortBuilder-b92RnZ0v.js +479 -0
- package/dist/pages/esm/CohortBuilder-b92RnZ0v.js.map +1 -0
- package/dist/pages/esm/index-EaCstuyL.js +22761 -0
- package/dist/pages/esm/index-EaCstuyL.js.map +1 -0
- package/dist/pages/esm/index.js +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,192 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
1
|
+
Apache Software License 2.0
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
3
|
+
Copyright (c) 2026, University of Chicago
|
|
190
4
|
|
|
191
5
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
6
|
you may not use this file except in compliance with the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/ActionButton.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,YAAY,GAAI,qHAWnB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/ActionButton.tsx"],"names":[],"mappings":"AAIA,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,YAAY,GAAI,qHAWnB,iBAAiB,4CAsBnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef } from 'react';
|
|
3
|
-
import { Button, Tooltip } from '@mantine/core';
|
|
3
|
+
import { Button, Loader, Tooltip } from '@mantine/core';
|
|
4
4
|
import { FiDownload } from 'react-icons/fi';
|
|
5
5
|
var ActionButton = function (_a) {
|
|
6
6
|
var activeText = _a.activeText, inactiveText = _a.inactiveText, active = _a.active, icon = _a.icon, customStyle = _a.customStyle, _b = _a.showLoading, showLoading = _b === void 0 ? true : _b, _c = _a.showIcon, showIcon = _c === void 0 ? true : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, handleClick = _a.handleClick, tooltipText = _a.tooltipText;
|
|
7
7
|
var ref = useRef(null);
|
|
8
|
-
return (_jsx(Tooltip, { disabled: !tooltipText, label: tooltipText, children: _jsx(Button, { ref: ref, leftSection: showIcon && inactiveText && _jsx(FiDownload, {}), disabled: disabled, className: customStyle ||
|
|
8
|
+
return (_jsx(Tooltip, { disabled: !tooltipText, label: tooltipText, children: _jsx(Button, { ref: ref, leftSection: showIcon && inactiveText && _jsx(FiDownload, {}), rightSection: active && _jsx(Loader, { color: "accent.4", size: "xs" }), disabled: disabled, className: customStyle ||
|
|
9
9
|
"".concat(disabled ? 'text-base-lightest' : 'text-primary-contrast', " ").concat(disabled ? 'bg-base' : 'bg-primary hover:bg-primary-darker', " "), loading: showLoading && active, onClick: handleClick, children: active ? activeText : inactiveText || icon }) }));
|
|
10
10
|
};
|
|
11
11
|
export default ActionButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/ActionButton.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ActionButton.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/ActionButton.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAe5C,IAAM,YAAY,GAAG,UAAC,EAWF;QAVlB,UAAU,gBAAA,EACV,YAAY,kBAAA,EACZ,MAAM,YAAA,EACN,IAAI,UAAA,EACJ,WAAW,iBAAA,EACX,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA,EAClB,gBAAe,EAAf,QAAQ,mBAAG,IAAI,KAAA,EACf,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,WAAW,iBAAA,EACX,WAAW,iBAAA;IAEX,IAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,CACL,KAAC,OAAO,IAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,KAAK,EAAE,WAAW,YACjD,KAAC,MAAM,IACL,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,QAAQ,IAAI,YAAY,IAAI,KAAC,UAAU,KAAG,EACvD,YAAY,EAAE,MAAM,IAAI,KAAC,MAAM,IAAC,KAAK,EAAC,UAAU,EAAC,IAAI,EAAC,IAAI,GAAG,EAC7D,QAAQ,EAAE,QAAQ,EAClB,SAAS,EACP,WAAW;gBACX,UAAG,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,uBAAuB,cAC1D,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oCAAoC,MAC1D,EAEL,OAAO,EAAE,WAAW,IAAI,MAAM,EAC9B,OAAO,EAAE,WAAW,YAEnB,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,IAAI,IAAI,GACpC,GACD,CACX,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CohortActionButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIlD,QAAA,MAAM,kBAAkB,GAAI,sLAezB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"CohortActionButton.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAIlD,QAAA,MAAM,kBAAkB,GAAI,sLAezB,sBAAsB,4CA+BxB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import useGuppyActionButton from './downloadActionHook';
|
|
3
4
|
import { Modals } from '@gen3/core';
|
|
4
5
|
import ActionButton from './ActionButton';
|
|
@@ -12,8 +13,16 @@ var CohortActionButton = function (_a) {
|
|
|
12
13
|
hideNotification: hideNotification,
|
|
13
14
|
actionFunction: actionFunction,
|
|
14
15
|
actionArgs: actionArgs,
|
|
15
|
-
}), handleClick = _h.handleClick, icon = _h.icon, active = _h.active;
|
|
16
|
-
|
|
16
|
+
}), handleClick = _h.handleClick, cancel = _h.cancel, icon = _h.icon, active = _h.active;
|
|
17
|
+
var clickHandler = useCallback(function () {
|
|
18
|
+
if (disabled)
|
|
19
|
+
return;
|
|
20
|
+
if (!active)
|
|
21
|
+
handleClick();
|
|
22
|
+
else
|
|
23
|
+
cancel();
|
|
24
|
+
}, [active, disabled, handleClick, cancel]);
|
|
25
|
+
return (_jsx(ActionButton, { activeText: activeText, inactiveText: inactiveText, active: active, icon: icon, handleClick: clickHandler, customStyle: customStyle, showLoading: showLoading, showIcon: showIcon, disabled: disabled, tooltipText: tooltipText }));
|
|
17
26
|
};
|
|
18
27
|
export default CohortActionButton;
|
|
19
28
|
//# sourceMappingURL=CohortActionButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CohortActionButton.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CohortActionButton.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,oBAAoB,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACpC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAE1C,IAAM,kBAAkB,GAAG,UAAC,EAeH;QAdvB,UAAU,gBAAA,EACV,YAAY,kBAAA,EACZ,WAAW,iBAAA,EACX,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA,EAClB,gBAAe,EAAf,QAAQ,mBAAG,IAAI,KAAA,EACf,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,gBAA+B,EAA/B,QAAQ,mBAAG,MAAM,CAAC,aAAa,KAAA,EAC/B,gBAAmC,EAAnC,QAAQ,mBAAG,MAAM,CAAC,iBAAiB,KAAA,EACnC,WAAW,iBAAA,EACX,IAAI,UAAA,EACJ,kBAAkB,wBAAA,EAClB,wBAAwB,EAAxB,gBAAgB,mBAAG,KAAK,KAAA,EACxB,cAAc,oBAAA,EACd,UAAU,gBAAA;IAEJ,IAAA,KAAwC,oBAAoB,CAAC;QACjE,QAAQ,UAAA;QACR,QAAQ,UAAA;QACR,IAAI,MAAA;QACJ,kBAAkB,oBAAA;QAClB,gBAAgB,kBAAA;QAChB,cAAc,gBAAA;QACd,UAAU,YAAA;KACX,CAAC,EARM,WAAW,iBAAA,EAAE,MAAM,YAAA,EAAE,IAAI,UAAA,EAAE,MAAM,YAQvC,CAAC;IAEH,IAAM,YAAY,GAAG,WAAW,CAAC;QAC/B,IAAI,QAAQ;YAAE,OAAO;QACrB,IAAI,CAAC,MAAM;YAAE,WAAW,EAAE,CAAC;;YACtB,MAAM,EAAE,CAAC;IAChB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAE5C,OAAO,CACL,KAAC,YAAY,IACX,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,YAAY,EACzB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,GACxB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/nextjs';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
component: ({ activeText, inactiveText, customStyle, showLoading, showIcon, disabled, Modal403, Modal400, tooltipText, done, customErrorMessage, hideNotification, actionFunction, actionArgs, }: import("../types").GuppyActionButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
6
|
+
disabled?: boolean | undefined;
|
|
7
|
+
inactiveText: string;
|
|
8
|
+
activeText: string;
|
|
9
|
+
customStyle?: string | undefined;
|
|
10
|
+
showLoading?: boolean | undefined;
|
|
11
|
+
showIcon?: boolean | undefined;
|
|
12
|
+
preventClickEvent?: boolean | undefined;
|
|
13
|
+
onClick?: (() => void) | undefined;
|
|
14
|
+
setActive?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
|
|
15
|
+
active?: boolean | undefined;
|
|
16
|
+
Modal403?: import("@gen3/core").Modals | undefined;
|
|
17
|
+
Modal400?: import("@gen3/core").Modals | undefined;
|
|
18
|
+
tooltipText?: string | undefined;
|
|
19
|
+
done?: (() => void) | undefined;
|
|
20
|
+
actionFunction: import("../types").ActionButtonWithArgsFunction;
|
|
21
|
+
actionArgs: Record<string, any>;
|
|
22
|
+
customErrorMessage?: string | undefined;
|
|
23
|
+
hideNotification?: boolean | undefined;
|
|
24
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
export declare const Default: Story;
|
|
29
|
+
//# sourceMappingURL=CohortActionButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CohortActionButton.stories.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;CASiC,CAAC;AAE5C,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
+
import CohortActionButton from './CohortActionButton';
|
|
39
|
+
var actionFunction = function (_params, _done, _onError, _onAbort, _signal, _onCompleted) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
40
|
+
return [2 /*return*/];
|
|
41
|
+
}); }); };
|
|
42
|
+
var meta = {
|
|
43
|
+
component: CohortActionButton,
|
|
44
|
+
decorators: [
|
|
45
|
+
function (Story) { return (_jsx("div", { className: "bg-base-lightest p-4", children: _jsx(Story, {}) })); },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
export default meta;
|
|
49
|
+
export var Default = {
|
|
50
|
+
args: {
|
|
51
|
+
activeText: 'Cancel',
|
|
52
|
+
inactiveText: 'Download',
|
|
53
|
+
actionFunction: actionFunction,
|
|
54
|
+
actionArgs: {},
|
|
55
|
+
showLoading: false,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=CohortActionButton.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CohortActionButton.stories.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/CohortActionButton.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAGtD,IAAM,cAAc,GAAG,UACrB,OAA4B,EAC5B,KAAkB,EAClB,QAAiC,EACjC,QAAqB,EACrB,OAAqB,EACrB,YAAkC;;SAC7B,CAAC;AAER,IAAM,IAAI,GAAG;IACX,SAAS,EAAE,kBAAkB;IAC7B,UAAU,EAAE;QACV,UAAC,KAAK,IAAK,OAAA,CACT,cAAK,SAAS,EAAC,sBAAsB,YACnC,KAAC,KAAK,KAAG,GACL,CACP,EAJU,CAIV;KACF;CACwC,CAAC;AAE5C,eAAe,IAAI,CAAC;AAIpB,MAAM,CAAC,IAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,UAAU;QACxB,cAAc,EAAE,cAAc;QAC9B,UAAU,EAAE,EAAE;QACd,WAAW,EAAE,KAAK;KACnB;CACF,CAAC"}
|
|
@@ -3,8 +3,30 @@ interface GuppyDownloadActionHookProps extends Pick<GuppyActionButtonProps, 'Mod
|
|
|
3
3
|
setIsActive?: (active: boolean) => void;
|
|
4
4
|
onCompleted?: (args?: unknown) => void;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* useGuppyActionButton is a custom hook that provides functionality for handling
|
|
8
|
+
* asynchronous actions with error handling, notifications, and a loading state.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} config - Configuration options for the hook.
|
|
11
|
+
* @param {React.Component} [config.Modal403=Modals.NoAccessModal] - The modal to display for 403 error scenarios.
|
|
12
|
+
* @param {React.Component} [config.Modal400=Modals.GeneralErrorModal] - The modal to display for general 400 error scenarios.
|
|
13
|
+
* @param {Function} [config.done] - Callback function to execute when an action is completed or canceled.
|
|
14
|
+
* @param {string} [config.customErrorMessage] - Custom error message to override the default error message.
|
|
15
|
+
* @param {boolean} [config.hideNotification=false] - Whether to hide notification during action execution.
|
|
16
|
+
* @param {Function} config.actionFunction - The asynchronous function to execute.
|
|
17
|
+
* @param {any} config.actionArgs - Arguments to be passed to the `actionFunction`.
|
|
18
|
+
* @param {Function} [config.setIsActive] - Callback function to track active state changes.
|
|
19
|
+
* @param {Function} [config.onCompleted] - Callback function to execute after the action completes successfully.
|
|
20
|
+
*
|
|
21
|
+
* @returns {Object} - Hook utilities.
|
|
22
|
+
* @returns {Function} handleClick - Function that triggers the primary action when invoked.
|
|
23
|
+
* @returns {Function} cancel - Function to cancel the in-progress action.
|
|
24
|
+
* @returns {React.ReactNode} icon - The icon rendered based on the active state (loading or ready).
|
|
25
|
+
* @returns {boolean} active - The current active/busy state of the hook.
|
|
26
|
+
*/
|
|
6
27
|
declare const useGuppyActionButton: ({ Modal403, Modal400, done, customErrorMessage, hideNotification, actionFunction, actionArgs, setIsActive, onCompleted, }: GuppyDownloadActionHookProps) => {
|
|
7
28
|
handleClick: () => Promise<void>;
|
|
29
|
+
cancel: () => void;
|
|
8
30
|
icon: import("react/jsx-runtime").JSX.Element;
|
|
9
31
|
active: boolean;
|
|
10
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadActionHook.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/downloadActionHook.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAalD,UAAU,4BAA6B,SAAQ,IAAI,CACjD,sBAAsB,EACpB,UAAU,GACV,UAAU,GACV,MAAM,GACN,oBAAoB,GACpB,kBAAkB,GAClB,gBAAgB,GAChB,YAAY,CACf;IACC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,QAAA,MAAM,oBAAoB,GAAI,2HAU3B,4BAA4B
|
|
1
|
+
{"version":3,"file":"downloadActionHook.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/downloadActionHook.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAalD,UAAU,4BAA6B,SAAQ,IAAI,CACjD,sBAAsB,EACpB,UAAU,GACV,UAAU,GACV,MAAM,GACN,oBAAoB,GACpB,kBAAkB,GAClB,gBAAgB,GAChB,YAAY,CACf;IACC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,oBAAoB,GAAI,2HAU3B,4BAA4B;;;;;CA2H9B,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -35,7 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
-
import { useCallback, useState } from 'react';
|
|
38
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
39
39
|
import { Modals, showModal, useCoreDispatch } from '@gen3/core';
|
|
40
40
|
import { cleanNotifications, showNotification } from '@mantine/notifications';
|
|
41
41
|
import { DownloadNotification } from '../../../utils/download';
|
|
@@ -47,10 +47,38 @@ var showErrorMessage = function (error) {
|
|
|
47
47
|
message: error.message,
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* useGuppyActionButton is a custom hook that provides functionality for handling
|
|
52
|
+
* asynchronous actions with error handling, notifications, and a loading state.
|
|
53
|
+
*
|
|
54
|
+
* @param {Object} config - Configuration options for the hook.
|
|
55
|
+
* @param {React.Component} [config.Modal403=Modals.NoAccessModal] - The modal to display for 403 error scenarios.
|
|
56
|
+
* @param {React.Component} [config.Modal400=Modals.GeneralErrorModal] - The modal to display for general 400 error scenarios.
|
|
57
|
+
* @param {Function} [config.done] - Callback function to execute when an action is completed or canceled.
|
|
58
|
+
* @param {string} [config.customErrorMessage] - Custom error message to override the default error message.
|
|
59
|
+
* @param {boolean} [config.hideNotification=false] - Whether to hide notification during action execution.
|
|
60
|
+
* @param {Function} config.actionFunction - The asynchronous function to execute.
|
|
61
|
+
* @param {any} config.actionArgs - Arguments to be passed to the `actionFunction`.
|
|
62
|
+
* @param {Function} [config.setIsActive] - Callback function to track active state changes.
|
|
63
|
+
* @param {Function} [config.onCompleted] - Callback function to execute after the action completes successfully.
|
|
64
|
+
*
|
|
65
|
+
* @returns {Object} - Hook utilities.
|
|
66
|
+
* @returns {Function} handleClick - Function that triggers the primary action when invoked.
|
|
67
|
+
* @returns {Function} cancel - Function to cancel the in-progress action.
|
|
68
|
+
* @returns {React.ReactNode} icon - The icon rendered based on the active state (loading or ready).
|
|
69
|
+
* @returns {boolean} active - The current active/busy state of the hook.
|
|
70
|
+
*/
|
|
50
71
|
var useGuppyActionButton = function (_a) {
|
|
51
72
|
var _b = _a.Modal403, Modal403 = _b === void 0 ? Modals.NoAccessModal : _b, _c = _a.Modal400, Modal400 = _c === void 0 ? Modals.GeneralErrorModal : _c, done = _a.done, customErrorMessage = _a.customErrorMessage, _d = _a.hideNotification, hideNotification = _d === void 0 ? false : _d, actionFunction = _a.actionFunction, actionArgs = _a.actionArgs, _e = _a.setIsActive, setIsActive = _e === void 0 ? function (_) { return null; } : _e, _f = _a.onCompleted, onCompleted = _f === void 0 ? function () { return null; } : _f;
|
|
52
73
|
var _g = useState(false), active = _g[0], setActive = _g[1];
|
|
53
74
|
var dispatch = useCoreDispatch();
|
|
75
|
+
var controllerRef = useRef(null);
|
|
76
|
+
var setBusy = useCallback(function (isBusy) {
|
|
77
|
+
setActive(isBusy);
|
|
78
|
+
setIsActive === null || setIsActive === void 0 ? void 0 : setIsActive(isBusy);
|
|
79
|
+
if (!isBusy)
|
|
80
|
+
cleanNotifications();
|
|
81
|
+
}, [setIsActive]);
|
|
54
82
|
var handleError = useDeepCompareCallback(function (error) {
|
|
55
83
|
var errorMessage = error.message;
|
|
56
84
|
if (errorMessage === 'internal server error' ||
|
|
@@ -73,69 +101,73 @@ var useGuppyActionButton = function (_a) {
|
|
|
73
101
|
}, [Modal400, Modal403, customErrorMessage, dispatch]);
|
|
74
102
|
var showDownloadNotification = useCallback(function (controller) {
|
|
75
103
|
showNotification({
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
cleanNotifications();
|
|
79
|
-
if (done) {
|
|
80
|
-
done();
|
|
81
|
-
}
|
|
82
|
-
} })),
|
|
83
|
-
styles: function () { return ({
|
|
84
|
-
root: {
|
|
85
|
-
textAlign: 'center',
|
|
86
|
-
display: hideNotification ? 'none' : 'block',
|
|
87
|
-
},
|
|
88
|
-
closeButton: {
|
|
89
|
-
color: 'black',
|
|
90
|
-
'&:hover': {
|
|
91
|
-
backgroundColor: 'lightslategray',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
}); },
|
|
104
|
+
title: 'Downloading',
|
|
105
|
+
message: _jsx(DownloadNotification, {}),
|
|
95
106
|
closeButtonProps: { 'aria-label': 'Close notification' },
|
|
96
107
|
autoClose: false,
|
|
97
108
|
});
|
|
98
|
-
}, [
|
|
99
|
-
var
|
|
109
|
+
}, [hideNotification]);
|
|
110
|
+
var cancel = useCallback(function () {
|
|
111
|
+
var _a;
|
|
112
|
+
(_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.abort();
|
|
113
|
+
controllerRef.current = null;
|
|
114
|
+
setBusy(false);
|
|
115
|
+
done === null || done === void 0 ? void 0 : done(); // optional: only keep this if "cancel implies done" is intended
|
|
116
|
+
}, [done, setBusy]);
|
|
117
|
+
useEffect(function () {
|
|
118
|
+
// Abort if the component using this hook unmounts mid-request
|
|
119
|
+
return function () { var _a; return (_a = controllerRef.current) === null || _a === void 0 ? void 0 : _a.abort(); };
|
|
120
|
+
}, []);
|
|
121
|
+
var handleClick = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
100
122
|
var controller;
|
|
101
123
|
return __generator(this, function (_a) {
|
|
102
124
|
switch (_a.label) {
|
|
103
125
|
case 0:
|
|
126
|
+
// Optional: prevent multiple concurrent requests
|
|
127
|
+
if (active)
|
|
128
|
+
return [2 /*return*/];
|
|
104
129
|
controller = new AbortController();
|
|
130
|
+
controllerRef.current = controller;
|
|
105
131
|
showDownloadNotification(controller);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
132
|
+
setBusy(true);
|
|
133
|
+
_a.label = 1;
|
|
134
|
+
case 1:
|
|
135
|
+
_a.trys.push([1, , 3, 4]);
|
|
109
136
|
return [4 /*yield*/, actionFunction(actionArgs, function () {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
setIsActive(false);
|
|
113
|
-
// Clean up notifications...
|
|
114
|
-
cleanNotifications();
|
|
137
|
+
controllerRef.current = null;
|
|
138
|
+
setBusy(false);
|
|
115
139
|
}, function (error) {
|
|
140
|
+
controllerRef.current = null;
|
|
116
141
|
handleError(error);
|
|
117
|
-
|
|
118
|
-
if (setIsActive)
|
|
119
|
-
setIsActive(false);
|
|
120
|
-
// Clean up notifications...
|
|
121
|
-
cleanNotifications();
|
|
142
|
+
setBusy(false);
|
|
122
143
|
showErrorMessage(error);
|
|
123
144
|
}, function () {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
setIsActive(false);
|
|
127
|
-
// Clean up notifications...
|
|
128
|
-
cleanNotifications();
|
|
145
|
+
controllerRef.current = null;
|
|
146
|
+
setBusy(false);
|
|
129
147
|
}, controller.signal, onCompleted)];
|
|
130
|
-
case
|
|
148
|
+
case 2:
|
|
131
149
|
_a.sent();
|
|
132
|
-
return [
|
|
150
|
+
return [3 /*break*/, 4];
|
|
151
|
+
case 3:
|
|
152
|
+
// In case actionFunction throws before it calls your callbacks
|
|
153
|
+
controllerRef.current = null;
|
|
154
|
+
return [7 /*endfinally*/];
|
|
155
|
+
case 4: return [2 /*return*/];
|
|
133
156
|
}
|
|
134
157
|
});
|
|
135
|
-
}); }
|
|
158
|
+
}); }, [
|
|
159
|
+
active,
|
|
160
|
+
actionArgs,
|
|
161
|
+
actionFunction,
|
|
162
|
+
handleError,
|
|
163
|
+
onCompleted,
|
|
164
|
+
setBusy,
|
|
165
|
+
showDownloadNotification,
|
|
166
|
+
]);
|
|
136
167
|
var icon = active ? (_jsx(Loader, { size: "sm", className: "p-1" })) : (_jsx(FiDownload, { title: "download", size: 16 }));
|
|
137
168
|
return {
|
|
138
169
|
handleClick: handleClick,
|
|
170
|
+
cancel: cancel,
|
|
139
171
|
icon: icon,
|
|
140
172
|
active: active,
|
|
141
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"downloadActionHook.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/downloadActionHook.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"downloadActionHook.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/downloads/downloadActionHook.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,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CAAC,CACpB,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAC,KAAK,GAAG,CACrC,CAAC,CAAC,CAAC,CACF,KAAC,UAAU,IAAC,KAAK,EAAC,UAAU,EAAC,IAAI,EAAE,EAAE,GAAI,CAC1C,CAAC;IAEF,OAAO;QACL,WAAW,aAAA;QACX,MAAM,QAAA;QACN,IAAI,MAAA;QACJ,MAAM,QAAA;KACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DiscoverDataHookResponse, DiscoveryDataLoaderProps } from '../../types';
|
|
2
|
+
export declare const useAggMetaMDSProxy: ({ pagination, searchTerms, advancedSearchTerms, discoveryConfig, sorting, guidType, maxStudies, studyField, }: DiscoveryDataLoaderProps) => DiscoverDataHookResponse;
|
|
3
|
+
//# sourceMappingURL=DataLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataLoader.d.ts","sourceRoot":"","sources":["../../../../../../src/features/Discovery/DataLoaders/AggMetaMDSProxy/DataLoader.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAYrB,eAAO,MAAM,kBAAkB,GAAI,+GAShC,wBAAwB,KAAG,wBA8F7B,CAAC"}
|