pollination-react-io 1.78.1 → 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.
@@ -14,6 +14,7 @@ export interface FileCardProps {
14
14
  file?: Blob | File | string | undefined;
15
15
  onClicked?: (card: FileCardProps) => any;
16
16
  isCloud?: boolean;
17
+ name?: string;
17
18
  }
18
19
  export declare const FileCard: React.FC<FileCardProps>;
19
20
  export default FileCard;
@@ -40843,9 +40843,9 @@ var useRuns = function (client) {
40843
40843
  };
40844
40844
  var getTrigger = function (item) {
40845
40845
  var _a;
40846
- if (!((_a = item === null || item === void 0 ? void 0 : item.status) === null || _a === void 0 ? void 0 : _a.finished_at))
40846
+ if (!((_a = item === null || item === void 0 ? void 0 : item.status) === null || _a === void 0 ? void 0 : _a.started_at))
40847
40847
  return;
40848
- var days = dayjs_min().diff(item.status.finished_at, 'days');
40848
+ var days = dayjs_min().diff(item.status.started_at, 'days');
40849
40849
  return days >= 14;
40850
40850
  };
40851
40851
  var listRuns = useCallback(function (projectOwner, projectName, jobId, page, perPage, statusFilter) {
@@ -55024,16 +55024,16 @@ var StudyCard = function (_a) {
55024
55024
  * Fetch hooks
55025
55025
  */
55026
55026
  var _6 = useJobs(client), fetchJob = _6.fetchJob, getDuration = _6.getDuration, statusMap = _6.statusMap, deleteJob = _6.deleteJob, cancelJob = _6.cancelJob;
55027
- var listRuns = useRuns(client).listRuns;
55028
- var _7 = useWindowDimensions(), width = _7.width; _7.height;
55029
- var _8 = useState(false), seeDescription = _8[0], setSeeDescription = _8[1];
55030
- var _9 = useState(false), seeAction = _9[0], setSeeAction = _9[1];
55031
- var _10 = useState(false), stopRefresh = _10[0], setStopRefresh = _10[1];
55032
- var _11 = useState(false), isReady = _11[0], setIsReady = _11[1];
55027
+ var _7 = useRuns(client), listRuns = _7.listRuns, getTrigger = _7.getTrigger;
55028
+ var _8 = useWindowDimensions(), width = _8.width; _8.height;
55029
+ var _9 = useState(false), seeDescription = _9[0], setSeeDescription = _9[1];
55030
+ var _10 = useState(false), seeAction = _10[0], setSeeAction = _10[1];
55031
+ var _11 = useState(false), stopRefresh = _11[0], setStopRefresh = _11[1];
55032
+ var _12 = useState(false), isReady = _12[0], setIsReady = _12[1];
55033
55033
  /**
55034
55034
  * From job to run
55035
55035
  */
55036
- var _12 = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
55036
+ var _13 = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
55037
55037
  revalidateOnFocus: true,
55038
55038
  refreshWhenHidden: true,
55039
55039
  refreshInterval: stopRefresh ? undefined : interval,
@@ -55067,7 +55067,7 @@ var StudyCard = function (_a) {
55067
55067
  if (study.status.finished_at)
55068
55068
  setStopRefresh(true);
55069
55069
  }
55070
- }), study = _12.data; _12.error; _12.isValidating;
55070
+ }), study = _13.data; _13.error; _13.isValidating;
55071
55071
  var sendJob = useCallback(function (job) { return getValue(job); }, [study]);
55072
55072
  var total = useMemo(function () {
55073
55073
  if (!study)
@@ -55091,8 +55091,8 @@ var StudyCard = function (_a) {
55091
55091
  }
55092
55092
  return study.status.status.toLocaleLowerCase();
55093
55093
  }, [study]);
55094
- var _13 = useState(), run = _13[0], setRun = _13[1];
55095
- var _14 = useState(getDuration(study)), duration = _14[0], setDuration = _14[1];
55094
+ var _14 = useState(), run = _14[0], setRun = _14[1];
55095
+ var _15 = useState(getDuration(study)), duration = _15[0], setDuration = _15[1];
55096
55096
  useEffect(function () {
55097
55097
  setRun(undefined);
55098
55098
  if (!study)
@@ -55123,7 +55123,7 @@ var StudyCard = function (_a) {
55123
55123
  info: false,
55124
55124
  settings: false
55125
55125
  };
55126
- var _15 = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _15[0], setHover = _15[1];
55126
+ var _16 = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _16[0], setHover = _16[1];
55127
55127
  var toggleHover = useCallback(function (id, value) {
55128
55128
  if (value === void 0) { value = false; }
55129
55129
  setHover(function (prevHover) {
@@ -55174,7 +55174,9 @@ var StudyCard = function (_a) {
55174
55174
  React__default.createElement("span", { title: 'Go to workspace page' },
55175
55175
  React__default.createElement(FolderOutlined$1, { className: 'link', onClick: function (e) {
55176
55176
  e.stopPropagation();
55177
- document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?tab=workspace&path=runs/").concat(run.id, "/workspace");
55177
+ var trigger = getTrigger(run);
55178
+ var q = trigger ? 'tab=workspace' : "tab=workspace&path=runs/".concat(run.id, "/workspace");
55179
+ document.location = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id, "?").concat(q);
55178
55180
  }, onMouseOver: function (e) {
55179
55181
  toggleHover('workspaceOver', true);
55180
55182
  }, onMouseLeave: function (e) {
@@ -56182,7 +56184,7 @@ var FileCard = function (_a) {
56182
56184
  // Generate Blob on click
56183
56185
  run && downloadArtifact(path, run.status.job_id)
56184
56186
  .then(function (url) { return fetchAndSet(url); })
56185
- .catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description }); });
56187
+ .catch(function () { return onClicked({ label: label, path: path, file: undefined, description: description, name: filename }); });
56186
56188
  }
56187
56189
  else {
56188
56190
  // Some inputs has path == null
@@ -56203,7 +56205,7 @@ var FileCard = function (_a) {
56203
56205
  event.stopPropagation();
56204
56206
  if (isInactive)
56205
56207
  return;
56206
- onClicked({ label: label, path: path, file: currFile, description: description });
56208
+ onClicked({ label: label, path: path, file: currFile, description: description, name: filename });
56207
56209
  } },
56208
56210
  React__default.createElement("div", { className: 'title-param' },
56209
56211
  React__default.createElement("div", { style: { float: 'left', margin: '0 8px 0 0' } }, !isLoading ? React__default.createElement("div", { title: !isInactive