pollination-react-io 1.25.1 → 1.25.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/build/index.esm.js +22 -12
- package/build/index.esm.js.map +1 -1
- package/build/index.js +22 -12
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -44183,23 +44183,33 @@ var CreateStudy = function (_a) {
|
|
|
44183
44183
|
if (!basePath) {
|
|
44184
44184
|
throw new Error('CreateStudy: client.configuration.basepath not defined.');
|
|
44185
44185
|
}
|
|
44186
|
-
|
|
44187
|
-
|
|
44188
|
-
|
|
44189
|
-
|
|
44186
|
+
window.location.href = "".concat(basePath, "/").concat(accountName, "/projects/").concat(projectName, "/studies/").concat(studyId);
|
|
44187
|
+
}, []);
|
|
44188
|
+
var handleCreateStudySuccessLocal = useCallback(function (accountName, projectName, studyId) {
|
|
44189
|
+
console.log("Study is running! Do not close the console.\nYou will find output here ".concat(studyId, "."));
|
|
44190
|
+
}, []);
|
|
44191
|
+
var handleCreateStudy = useCallback(function (name, jobArgs, description, localConfig) {
|
|
44190
44192
|
if (!selRecipe) {
|
|
44191
|
-
return
|
|
44193
|
+
return Promise.reject();
|
|
44192
44194
|
}
|
|
44193
|
-
|
|
44194
|
-
|
|
44195
|
-
var
|
|
44196
|
-
if (host !== 'web') {
|
|
44197
|
-
return createLocalStudy({
|
|
44195
|
+
// Custom cloud action
|
|
44196
|
+
var handleCloudSuccess = createStudySuccess !== null && createStudySuccess !== void 0 ? createStudySuccess : handleCreateStudySuccess;
|
|
44197
|
+
var handleSuccess = localConfig && localConfig.isLocalJob ? handleCreateStudySuccessLocal : handleCloudSuccess;
|
|
44198
|
+
if (host !== 'web' && localConfig) {
|
|
44199
|
+
return createLocalStudy({
|
|
44200
|
+
name: name,
|
|
44201
|
+
recipe: selRecipe,
|
|
44202
|
+
description: description !== null && description !== void 0 ? description : 'Study created from pollination',
|
|
44203
|
+
}, jobArgs, localConfig, handleSuccess);
|
|
44198
44204
|
}
|
|
44199
44205
|
else {
|
|
44200
|
-
return createStudy({
|
|
44206
|
+
return createStudy({
|
|
44207
|
+
name: name,
|
|
44208
|
+
recipe: selRecipe,
|
|
44209
|
+
description: description !== null && description !== void 0 ? description : 'Study created from pollination',
|
|
44210
|
+
}, jobArgs, handleCloudSuccess);
|
|
44201
44211
|
}
|
|
44202
|
-
}, [
|
|
44212
|
+
}, [selRecipe, host, createLocalStudy, handleCreateStudySuccess, createStudySuccess, createStudy]);
|
|
44203
44213
|
return (React__default.createElement("div", { "data-testid": "CreateProject", style: __assign(__assign({}, defaultStyle), style) },
|
|
44204
44214
|
React__default.createElement(Tabs, { selectedIndex: activeTabIndex, onSelect: function (index) { return setActiveTabIndex(index); }, forceRenderTabPanel: true },
|
|
44205
44215
|
React__default.createElement("div", { style: {
|