pollination-react-io 1.79.0 → 1.79.1

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.js CHANGED
@@ -40870,9 +40870,9 @@ var useRuns = function (client) {
40870
40870
  };
40871
40871
  var getTrigger = function (item) {
40872
40872
  var _a;
40873
- if (!((_a = item === null || item === void 0 ? void 0 : item.status) === null || _a === void 0 ? void 0 : _a.finished_at))
40873
+ if (!((_a = item === null || item === void 0 ? void 0 : item.status) === null || _a === void 0 ? void 0 : _a.started_at))
40874
40874
  return;
40875
- var days = dayjs_min().diff(item.status.finished_at, 'days');
40875
+ var days = dayjs_min().diff(item.status.started_at, 'days');
40876
40876
  return days >= 14;
40877
40877
  };
40878
40878
  var listRuns = React.useCallback(function (projectOwner, projectName, jobId, page, perPage, statusFilter) {
@@ -55051,16 +55051,16 @@ var StudyCard = function (_a) {
55051
55051
  * Fetch hooks
55052
55052
  */
55053
55053
  var _6 = useJobs(client), fetchJob = _6.fetchJob, getDuration = _6.getDuration, statusMap = _6.statusMap, deleteJob = _6.deleteJob, cancelJob = _6.cancelJob;
55054
- var listRuns = useRuns(client).listRuns;
55055
- var _7 = useWindowDimensions(), width = _7.width; _7.height;
55056
- var _8 = React.useState(false), seeDescription = _8[0], setSeeDescription = _8[1];
55057
- var _9 = React.useState(false), seeAction = _9[0], setSeeAction = _9[1];
55058
- var _10 = React.useState(false), stopRefresh = _10[0], setStopRefresh = _10[1];
55059
- var _11 = React.useState(false), isReady = _11[0], setIsReady = _11[1];
55054
+ var _7 = useRuns(client), listRuns = _7.listRuns, getTrigger = _7.getTrigger;
55055
+ var _8 = useWindowDimensions(), width = _8.width; _8.height;
55056
+ var _9 = React.useState(false), seeDescription = _9[0], setSeeDescription = _9[1];
55057
+ var _10 = React.useState(false), seeAction = _10[0], setSeeAction = _10[1];
55058
+ var _11 = React.useState(false), stopRefresh = _11[0], setStopRefresh = _11[1];
55059
+ var _12 = React.useState(false), isReady = _12[0], setIsReady = _12[1];
55060
55060
  /**
55061
55061
  * From job to run
55062
55062
  */
55063
- var _12 = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
55063
+ var _13 = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
55064
55064
  revalidateOnFocus: true,
55065
55065
  refreshWhenHidden: true,
55066
55066
  refreshInterval: stopRefresh ? undefined : interval,
@@ -55094,7 +55094,7 @@ var StudyCard = function (_a) {
55094
55094
  if (study.status.finished_at)
55095
55095
  setStopRefresh(true);
55096
55096
  }
55097
- }), study = _12.data; _12.error; _12.isValidating;
55097
+ }), study = _13.data; _13.error; _13.isValidating;
55098
55098
  var sendJob = React.useCallback(function (job) { return getValue(job); }, [study]);
55099
55099
  var total = React.useMemo(function () {
55100
55100
  if (!study)
@@ -55118,8 +55118,8 @@ var StudyCard = function (_a) {
55118
55118
  }
55119
55119
  return study.status.status.toLocaleLowerCase();
55120
55120
  }, [study]);
55121
- var _13 = React.useState(), run = _13[0], setRun = _13[1];
55122
- var _14 = React.useState(getDuration(study)), duration = _14[0], setDuration = _14[1];
55121
+ var _14 = React.useState(), run = _14[0], setRun = _14[1];
55122
+ var _15 = React.useState(getDuration(study)), duration = _15[0], setDuration = _15[1];
55123
55123
  React.useEffect(function () {
55124
55124
  setRun(undefined);
55125
55125
  if (!study)
@@ -55150,7 +55150,7 @@ var StudyCard = function (_a) {
55150
55150
  info: false,
55151
55151
  settings: false
55152
55152
  };
55153
- var _15 = React.useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _15[0], setHover = _15[1];
55153
+ var _16 = React.useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _16[0], setHover = _16[1];
55154
55154
  var toggleHover = React.useCallback(function (id, value) {
55155
55155
  if (value === void 0) { value = false; }
55156
55156
  setHover(function (prevHover) {
@@ -55201,7 +55201,9 @@ var StudyCard = function (_a) {
55201
55201
  React__default["default"].createElement("span", { title: 'Go to workspace page' },
55202
55202
  React__default["default"].createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
55203
55203
  e.stopPropagation();
55204
- document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?tab=workspace&path=runs/").concat(run.id, "/workspace");
55204
+ var trigger = getTrigger(run);
55205
+ var q = trigger ? 'tab=workspace' : "tab=workspace&path=runs/".concat(run.id, "/workspace");
55206
+ document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?").concat(q);
55205
55207
  }, onMouseOver: function (e) {
55206
55208
  toggleHover('workspaceOver', true);
55207
55209
  }, onMouseLeave: function (e) {