pollination-react-io 1.68.1 → 1.68.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 +38 -34
- package/build/index.esm.js.map +1 -1
- package/build/index.js +38 -34
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
@@ -44774,6 +44774,7 @@ var RecipeForm = function (_a) {
|
|
44774
44774
|
var _b, _c;
|
44775
44775
|
var recipe = _a.recipe, projectName = _a.projectName, projectOwner = _a.projectOwner, client = _a.client, onSubmit = _a.onSubmit, _d = _a.style, style = _d === void 0 ? {} : _d;
|
44776
44776
|
var getJob = usePollinationPanel().getJob;
|
44777
|
+
var _e = React.useState(false), loading = _e[0], setLoading = _e[1];
|
44777
44778
|
/**
|
44778
44779
|
* Input mapping
|
44779
44780
|
*/
|
@@ -44814,17 +44815,18 @@ var RecipeForm = function (_a) {
|
|
44814
44815
|
/**
|
44815
44816
|
* Hooks
|
44816
44817
|
*/
|
44817
|
-
var
|
44818
|
+
var _f = useForm({
|
44818
44819
|
resolver: Oe(schema),
|
44819
44820
|
mode: 'onChange'
|
44820
|
-
}), control =
|
44821
|
+
}), control = _f.control, register = _f.register, handleSubmit = _f.handleSubmit, resetField = _f.resetField, watch = _f.watch, _g = _f.formState, errors = _g.errors, isValid = _g.isValid;
|
44821
44822
|
var watchStudyName = watch('study-name');
|
44822
44823
|
/**
|
44823
44824
|
* Form actions
|
44824
44825
|
* @param data Output data
|
44825
44826
|
*/
|
44826
44827
|
var _onSubmit = function (data) {
|
44827
|
-
console.log(data)
|
44828
|
+
// console.log(data)
|
44829
|
+
setLoading(true);
|
44828
44830
|
// Get study name and description
|
44829
44831
|
// Remove them from inputs
|
44830
44832
|
var studyName = data['study-name'];
|
@@ -44837,7 +44839,10 @@ var RecipeForm = function (_a) {
|
|
44837
44839
|
if (!val)
|
44838
44840
|
delete data[key];
|
44839
44841
|
});
|
44840
|
-
onSubmit(studyName, data, studyDescription, localConfig)
|
44842
|
+
onSubmit(studyName, data, studyDescription, localConfig)
|
44843
|
+
.finally(function () {
|
44844
|
+
setLoading(false);
|
44845
|
+
});
|
44841
44846
|
};
|
44842
44847
|
var onErrors = function (err) {
|
44843
44848
|
console.log(err);
|
@@ -44890,7 +44895,7 @@ var RecipeForm = function (_a) {
|
|
44890
44895
|
/**
|
44891
44896
|
* Local study
|
44892
44897
|
*/
|
44893
|
-
var
|
44898
|
+
var _h = React.useState(__assign(__assign({}, _defaultConfig), { cloudProjectName: projectName, cloudProjectOwner: projectOwner })), localConfig = _h[0], setLocalConfig = _h[1];
|
44894
44899
|
/**
|
44895
44900
|
* Warning for local study folder
|
44896
44901
|
*/
|
@@ -44986,13 +44991,13 @@ var RecipeForm = function (_a) {
|
|
44986
44991
|
React__default["default"].createElement(Ie, null),
|
44987
44992
|
host === 'web' && React__default["default"].createElement(Button, { type: 'submit', style: { width: '100%',
|
44988
44993
|
margin: '10px 0 0 0',
|
44989
|
-
justifyContent: 'center' }, disabled: isValid
|
44994
|
+
justifyContent: 'center' }, disabled: !isValid || loading, form: recipe.metadata.name, loading: loading }, "Create Study"),
|
44990
44995
|
host !== 'web' && React__default["default"].createElement(Button, { type: 'submit', style: { width: '100%',
|
44991
44996
|
margin: '10px 0 0 0',
|
44992
|
-
justifyContent: 'center' }, disabled: isValid
|
44997
|
+
justifyContent: 'center' }, disabled: !isValid || loading ||
|
44993
44998
|
localConfig.isLocalJob
|
44994
44999
|
? localConfig.localRunFolder == null
|
44995
|
-
: false, form: recipe.metadata.name }, "Create Study")));
|
45000
|
+
: false, form: recipe.metadata.name, loading: loading }, "Create Study")));
|
44996
45001
|
};
|
44997
45002
|
|
44998
45003
|
var defaultStyle = {
|
@@ -47244,7 +47249,7 @@ var JobTabs;
|
|
47244
47249
|
JobTabs["workspace"] = "workspace";
|
47245
47250
|
})(JobTabs || (JobTabs = {}));
|
47246
47251
|
|
47247
|
-
var css_248z$6 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space:
|
47252
|
+
var css_248z$6 = ":root {\n --background: #FFFAEE;\n --primary: #1890ff;\n --primary2: #40a9ff;\n --primary1: #cceefe;\n --primary0: #e6f7ff;\n --secondary: #fff566;\n --primary3: #000;\n --success: #46A758;\n --warning: #F76809;\n --danger: #FF4616;\n /* radix-ui/colors */\n --slate1: hsl(206, 30.0%, 98.8%);\n --slate2: hsl(210, 16.7%, 97.6%);\n --slate3: hsl(209, 13.3%, 95.3%);\n --slate4: hsl(209, 12.2%, 93.2%);\n --slate5: hsl(208, 11.7%, 91.1%);\n --slate6: hsl(208, 11.3%, 88.9%);\n --slate7: hsl(207, 11.1%, 85.9%);\n --slate8: hsl(205, 10.7%, 78.0%);\n --slate9: hsl(206, 6.0%, 56.1%);\n --slate10: hsl(206, 5.8%, 52.3%);\n --slate11: hsl(206, 6.0%, 43.5%);\n --slate12: hsl(206, 24.0%, 9.0%);\n}\n\n@keyframes spin {\n from {\n transform: rotate(0);\n }\n to {\n transform: rotate(360deg);\n }\n}\n.spin {\n animation: spin 1s linear 0s infinite;\n}\n\n@keyframes Animation {\n 0% {\n background-position: 200%;\n }\n 50% {\n background-position: 100%;\n }\n 100% {\n background-position: 0%;\n }\n}\n.loading {\n background: linear-gradient(45deg, transparent, var(--primary), 12%, transparent);\n background-size: 200%;\n animation: Animation 3s ease infinite;\n}\n\n@keyframes open {\n from {\n height: 0;\n }\n to {\n height: var(--radix-collapsible-content-height);\n }\n}\n@keyframes close {\n from {\n height: var(--radix-collapsible-content-height);\n }\n to {\n height: 0;\n }\n}\n.collapse-content {\n overflow: hidden;\n font-size: inherit;\n color: inherit;\n}\n\n.collapse-content[data-state=open] {\n animation: open 300ms ease-out;\n}\n\n.collapse-content[data-state=closed] {\n animation: close 300ms ease-out;\n}\n\n.item1 {\n grid-area: accountprj;\n font-size: 1rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item2 {\n grid-area: runworkspacedebug;\n text-align: right !important;\n font-size: 1.25rem;\n white-space: nowrap;\n}\n\n.item3 {\n grid-area: studyrun;\n font-size: 1.25rem;\n font-weight: 500;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item4 {\n grid-area: date;\n color: var(--slate10);\n font-size: 0.9rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n text-align: right !important;\n}\n\n.item5 {\n grid-area: author;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item6 {\n grid-area: recipe;\n white-space: wrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item7 {\n grid-area: description;\n white-space: wrap;\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.item8 {\n grid-area: status;\n font-size: 0.9rem;\n}\n\n.status-label {\n font-weight: 500;\n}\n\n.item9 {\n grid-area: time;\n text-align: right !important;\n white-space: wrap;\n}\n\n.item10 {\n grid-area: cpu;\n text-align: right !important;\n white-space: wrap;\n}\n\n.link {\n text-decoration: none;\n color: var(--primary3);\n cursor: pointer;\n}\n\n.link:hover {\n color: var(--primary3);\n}\n\n.light-text {\n color: var(--slate10);\n font-size: 0.9rem;\n}\n\n.grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun date date\" \"author recipe recipe recipe recipe recipe\" \"status status status status cpu time\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.35rem;\n transition: box-shadow 0.3s ease 0s, border-color 0.3s ease 0s;\n grid-template-rows: 52px 38px 46px 46px auto;\n border-radius: 6px;\n line-height: 1.5;\n}\n\n.grid-container:hover {\n box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 2px -2px, rgba(0, 0, 0, 0.12) 0px 3px 6px 0px, rgba(0, 0, 0, 0.09) 0px 5px 12px 4px;\n cursor: pointer;\n}\n\n.disable-click {\n box-shadow: none !important;\n cursor: default !important;\n}\n\n.grid-container > div {\n text-align: left;\n padding: 1rem;\n vertical-align: middle;\n}\n\n.description-expander {\n all: unset;\n}\n\n.description-expander:focus {\n outline: 0 !important;\n}\n\n@media (max-width: 600px) {\n .grid-container {\n display: grid;\n grid-template-areas: \"accountprj accountprj accountprj accountprj runworkspacedebug runworkspacedebug\" \"studyrun studyrun studyrun studyrun studyrun studyrun\" \"date date date date date date\" \"author author author recipe recipe recipe\" \"status status status status status status\" \"time time time cpu cpu cpu\" \"description description description description description description\";\n gap: 0.35rem;\n border: 0.1rem solid;\n align-items: center;\n padding: 0.15rem;\n transition: box-shadow 0.3s;\n grid-template-rows: 52px 52px 32px 32px 32px 32px auto;\n }\n .item1 {\n text-align: left !important;\n }\n .item2 {\n text-align: right !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item3, .item4 {\n text-align: center !important;\n }\n .item5 {\n font-size: 0.8rem;\n }\n .item6 {\n white-space: nowrap;\n font-size: 0.8rem;\n }\n .item7 {\n font-size: 0.8rem;\n text-align: center !important;\n }\n .item8 {\n font-size: 1rem;\n text-align: center !important;\n }\n .item9 {\n text-align: left !important;\n font-size: 1rem;\n white-space: nowrap;\n }\n .item10 {\n text-align: right !important;\n }\n .grid-container > div {\n text-align: left;\n vertical-align: middle;\n }\n}\n.blink-effect {\n animation: blinker 5s linear infinite;\n}\n\n@keyframes blinker {\n 50% {\n border: 0.1rem solid white;\n }\n}";
|
47248
47253
|
styleInject(css_248z$6);
|
47249
47254
|
|
47250
47255
|
var IconContext = /*#__PURE__*/React.createContext({});
|
@@ -48974,15 +48979,15 @@ var StudyCard = function (_a) {
|
|
48974
48979
|
? '#40a9ff' : '#000')
|
48975
48980
|
} }))))),
|
48976
48981
|
React__default["default"].createElement("div", { className: 'item3' },
|
48977
|
-
React__default["default"].createElement("
|
48982
|
+
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 8px 0 0', cursor: 'pointer' }, title: 'See study info', onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
48983
|
+
e.stopPropagation();
|
48984
|
+
setSeeDescription(function (prev) { return !prev; });
|
48985
|
+
setSeeAction(false);
|
48986
|
+
} },
|
48987
|
+
React__default["default"].createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })),
|
48988
|
+
React__default["default"].createElement("span", null,
|
48978
48989
|
study ? (_g = study.spec.name) !== null && _g !== void 0 ? _g : "Study: ".concat(study.id) : '--',
|
48979
|
-
study && total > 1 && "(#".concat(total, ")"),
|
48980
|
-
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 0 0 8px', cursor: 'pointer' }, title: 'See study info', onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
48981
|
-
e.stopPropagation();
|
48982
|
-
setSeeDescription(function (prev) { return !prev; });
|
48983
|
-
setSeeAction(false);
|
48984
|
-
} },
|
48985
|
-
React__default["default"].createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })))),
|
48990
|
+
study && total > 1 && "(#".concat(total, ")"))),
|
48986
48991
|
React__default["default"].createElement("div", { className: 'item4', title: study && dayjs_min(study.status.started_at).format('[on] MMM DD YYYY [at] hh:mm') }, study ? dayjs_min(study.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
48987
48992
|
React__default["default"].createElement("div", { className: 'item5' },
|
48988
48993
|
React__default["default"].createElement("span", { style: { marginRight: '0.75rem' } },
|
@@ -49296,23 +49301,22 @@ var RunCard = function (_a) {
|
|
49296
49301
|
? '#40a9ff' : '#000')
|
49297
49302
|
} }))))),
|
49298
49303
|
React__default["default"].createElement("div", { className: 'item3' },
|
49299
|
-
React__default["default"].createElement("
|
49300
|
-
|
49301
|
-
|
49302
|
-
|
49303
|
-
|
49304
|
-
|
49305
|
-
|
49306
|
-
|
49307
|
-
|
49308
|
-
|
49309
|
-
|
49310
|
-
|
49311
|
-
|
49312
|
-
|
49313
|
-
|
49314
|
-
|
49315
|
-
React__default["default"].createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })))),
|
49304
|
+
React__default["default"].createElement("button", { style: { all: 'unset', margin: '0 8px 0 0', cursor: 'pointer' }, onMouseOver: function (e) { return toggleHover('info', true); }, onMouseLeave: function (e) { return toggleHover('info', false); }, onClick: function (e) {
|
49305
|
+
e.stopPropagation();
|
49306
|
+
setSeeDescription(function (prev) { return !prev; });
|
49307
|
+
setSeeAction(false);
|
49308
|
+
} },
|
49309
|
+
React__default["default"].createElement(InfoCircle$1, { size: 14, style: hover.info ? { color: '#40a9ff' } : {} })),
|
49310
|
+
React__default["default"].createElement("a", { className: 'link', title: 'Go to study page', onMouseOver: function (e) { return toggleHover('study', true); }, onMouseLeave: function (e) { return toggleHover('study', false); }, onClick: function (e) {
|
49311
|
+
e.stopPropagation();
|
49312
|
+
if (!localRun) {
|
49313
|
+
if (!projectName || !study)
|
49314
|
+
return;
|
49315
|
+
window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id);
|
49316
|
+
}
|
49317
|
+
}, style: { all: 'unset', cursor: 'pointer', color: "".concat(hover.study
|
49318
|
+
? '#40a9ff' : '#000') } }, localRun ? (localStudy ? localStudy.name : _run['studyName'] // Get name from _run
|
49319
|
+
) : (study ? (_h = study.spec.name) !== null && _h !== void 0 ? _h : "Study: ".concat(study.id) : '--'))),
|
49316
49320
|
React__default["default"].createElement("div", { className: 'item4', title: run && dayjs_min(run.status.started_at).format('[on] MMM DD YYYY [at] hh:mm') }, run ? dayjs_min(run.status.started_at).format('[on] MMM DD YYYY') : '--'),
|
49317
49321
|
React__default["default"].createElement("div", { className: 'item5' },
|
49318
49322
|
React__default["default"].createElement("span", { style: { marginRight: '0.75rem' } },
|