pollination-react-io 1.43.0 → 1.44.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.
- package/build/Cards/StudyCard.types.d.ts +1 -0
- package/build/index.esm.js +26 -17
- package/build/index.esm.js.map +1 -1
- package/build/index.js +26 -17
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.esm.js
CHANGED
|
@@ -48487,14 +48487,14 @@ var formatDuration$1 = function (duration) {
|
|
|
48487
48487
|
var StudyCard = function (_a) {
|
|
48488
48488
|
var _b;
|
|
48489
48489
|
var _c, _d, _e, _f;
|
|
48490
|
-
var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _g = _a.getValue, getValue = _g === void 0 ? function (tab) { } : _g, _h = _a.defaultTab, defaultTab = _h === void 0 ? '' : _h;
|
|
48490
|
+
var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _g = _a.getValue, getValue = _g === void 0 ? function (tab) { } : _g, _h = _a.defaultTab, defaultTab = _h === void 0 ? '' : _h, _j = _a.enableLink, enableLink = _j === void 0 ? false : _j;
|
|
48491
48491
|
// Fetch _study
|
|
48492
|
-
var
|
|
48492
|
+
var _k = useJobs(client), fetchJob = _k.fetchJob, getDuration = _k.getDuration, statusMap = _k.statusMap;
|
|
48493
48493
|
var listRuns = useRuns(client).listRuns;
|
|
48494
|
-
var
|
|
48495
|
-
var
|
|
48494
|
+
var _l = useWindowDimensions(), width = _l.width; _l.height;
|
|
48495
|
+
var _m = useState(false), open = _m[0], setOpen = _m[1];
|
|
48496
48496
|
// From job to run
|
|
48497
|
-
var
|
|
48497
|
+
var _o = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
|
|
48498
48498
|
revalidateOnFocus: false,
|
|
48499
48499
|
refreshInterval: !_study || _study.status.finished_at ? undefined : 5000,
|
|
48500
48500
|
fallbackData: _study,
|
|
@@ -48515,7 +48515,7 @@ var StudyCard = function (_a) {
|
|
|
48515
48515
|
})
|
|
48516
48516
|
.catch(function () { setRun(undefined); });
|
|
48517
48517
|
}
|
|
48518
|
-
}), study =
|
|
48518
|
+
}), study = _o.data; _o.error; _o.isValidating;
|
|
48519
48519
|
var total = useMemo(function () {
|
|
48520
48520
|
if (!study)
|
|
48521
48521
|
return undefined;
|
|
@@ -48538,8 +48538,8 @@ var StudyCard = function (_a) {
|
|
|
48538
48538
|
}
|
|
48539
48539
|
return study.status.status.toLocaleLowerCase();
|
|
48540
48540
|
}, [study]);
|
|
48541
|
-
var
|
|
48542
|
-
var
|
|
48541
|
+
var _p = useState(), run = _p[0], setRun = _p[1];
|
|
48542
|
+
var _q = useState(getDuration(study)), duration = _q[0], setDuration = _q[1];
|
|
48543
48543
|
useEffect(function () {
|
|
48544
48544
|
setRun(undefined);
|
|
48545
48545
|
if (!study)
|
|
@@ -48569,7 +48569,7 @@ var StudyCard = function (_a) {
|
|
|
48569
48569
|
recipe: false,
|
|
48570
48570
|
info: false
|
|
48571
48571
|
};
|
|
48572
|
-
var
|
|
48572
|
+
var _r = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _r[0], setHover = _r[1];
|
|
48573
48573
|
var toggleHover = useCallback(function (id, value) {
|
|
48574
48574
|
if (value === void 0) { value = false; }
|
|
48575
48575
|
setHover(function (prevHover) {
|
|
@@ -48634,9 +48634,14 @@ var StudyCard = function (_a) {
|
|
|
48634
48634
|
React__default.createElement("div", null,
|
|
48635
48635
|
React__default.createElement(InfoCircleOutlined$1, { className: 'link', onClick: function (e) {
|
|
48636
48636
|
e.stopPropagation();
|
|
48637
|
-
|
|
48638
|
-
|
|
48639
|
-
|
|
48637
|
+
if (enableLink) {
|
|
48638
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "?tab=details");
|
|
48639
|
+
}
|
|
48640
|
+
else {
|
|
48641
|
+
getValue(JobTabs.details);
|
|
48642
|
+
toggleHover(JobTabs.workspace, false);
|
|
48643
|
+
toggleHover(JobTabs.details, true);
|
|
48644
|
+
}
|
|
48640
48645
|
}, onMouseOver: function (e) {
|
|
48641
48646
|
toggleHover('detailsOver', true);
|
|
48642
48647
|
}, onMouseLeave: function (e) {
|
|
@@ -48646,15 +48651,19 @@ var StudyCard = function (_a) {
|
|
|
48646
48651
|
? '#40a9ff' : '#000') } }),
|
|
48647
48652
|
React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
|
|
48648
48653
|
e.stopPropagation();
|
|
48649
|
-
|
|
48650
|
-
|
|
48651
|
-
|
|
48654
|
+
if (enableLink) {
|
|
48655
|
+
document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "?tab=workspace");
|
|
48656
|
+
}
|
|
48657
|
+
else {
|
|
48658
|
+
getValue(JobTabs.workspace);
|
|
48659
|
+
toggleHover(JobTabs.workspace, true);
|
|
48660
|
+
toggleHover(JobTabs.details, false);
|
|
48661
|
+
}
|
|
48652
48662
|
}, onMouseOver: function (e) {
|
|
48653
48663
|
toggleHover('workspaceOver', true);
|
|
48654
48664
|
}, onMouseLeave: function (e) {
|
|
48655
48665
|
toggleHover('workspaceOver', false);
|
|
48656
|
-
}, style: {
|
|
48657
|
-
color: "".concat((hover.workspace || hover.workspaceOver)
|
|
48666
|
+
}, style: { color: "".concat((hover.workspace || hover.workspaceOver)
|
|
48658
48667
|
? '#40a9ff' : '#000') } }))),
|
|
48659
48668
|
React__default.createElement("div", { className: 'item3' },
|
|
48660
48669
|
React__default.createElement("div", null,
|