pollination-react-io 1.93.0 → 1.94.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.
@@ -56404,10 +56404,11 @@ var RunCard = function (_a) {
56404
56404
  var _8 = useState(false), seeAction = _8[0], setSeeAction = _8[1];
56405
56405
  var _9 = useState(false), stopRefresh = _9[0], setStopRefresh = _9[1];
56406
56406
  var _10 = useState(false), isReady = _10[0], setIsReady = _10[1];
56407
+ var _11 = useState(false), retryLoading = _11[0], setRetryLoading = _11[1];
56407
56408
  /*
56408
56409
  * From run and stop when it is done
56409
56410
  */
56410
- var _11 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id, _run['subfolder']]) : undefined, localRun ? fetchLocalRun : fetchRun, {
56411
+ var _12 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id, _run['subfolder']]) : undefined, localRun ? fetchLocalRun : fetchRun, {
56411
56412
  revalidateOnFocus: true,
56412
56413
  refreshWhenHidden: true,
56413
56414
  refreshInterval: stopRefresh ? undefined : interval,
@@ -56423,7 +56424,7 @@ var RunCard = function (_a) {
56423
56424
  setStopRefresh(true);
56424
56425
  setIsReady(true);
56425
56426
  }
56426
- }), run = _11.data, error = _11.error;
56427
+ }), run = _12.data, error = _12.error;
56427
56428
  var sendRun = useCallback(function (run) { return getValue(run); }, [getValue]);
56428
56429
  /**
56429
56430
  * Fetch job just one time
@@ -56447,9 +56448,9 @@ var RunCard = function (_a) {
56447
56448
  return undefined;
56448
56449
  return run.status.status;
56449
56450
  }, [run]);
56450
- var _12 = useState(), study = _12[0], setStudy = _12[1];
56451
- var _13 = useState(), localStudy = _13[0], setLocalStudy = _13[1];
56452
- var _14 = useState(getDuration(run)), duration = _14[0], setDuration = _14[1];
56451
+ var _13 = useState(), study = _13[0], setStudy = _13[1];
56452
+ var _14 = useState(), localStudy = _14[0], setLocalStudy = _14[1];
56453
+ var _15 = useState(getDuration(run)), duration = _15[0], setDuration = _15[1];
56453
56454
  useEffect(function () {
56454
56455
  if (!run)
56455
56456
  return;
@@ -56481,7 +56482,7 @@ var RunCard = function (_a) {
56481
56482
  info: false,
56482
56483
  settings: false,
56483
56484
  }); }, []);
56484
- var _15 = useState(__assign(__assign({}, emptyHover), (_b = {}, _b[defaultTab] = true, _b))), hover = _15[0], setHover = _15[1];
56485
+ var _16 = useState(__assign(__assign({}, emptyHover), (_b = {}, _b[defaultTab] = true, _b))), hover = _16[0], setHover = _16[1];
56485
56486
  var toggleHover = useCallback(function (id, value) {
56486
56487
  if (value === void 0) { value = false; }
56487
56488
  setHover(function (prevHover) {
@@ -56715,18 +56716,45 @@ var RunCard = function (_a) {
56715
56716
  } },
56716
56717
  React__default.createElement(XOctagon$1, { style: { display: 'inline', margin: '0 5px 0 0' } }),
56717
56718
  " Cancel"),
56718
- React__default.createElement(Button, { style: { marginRight: '0.75rem' }, disabled: !run || !run.status ||
56719
+ React__default.createElement(Button, { style: { marginRight: '0.75rem' }, loading: retryLoading, disabled: !run || !run.status ||
56719
56720
  ![dist$1.RunStatusEnum.Failed, dist$1.RunStatusEnum.Cancelled].includes(run.status.status) ||
56720
- daysSinceFinished >= 14, onClick: function (e) {
56721
+ daysSinceFinished >= 14 ||
56722
+ retryLoading, onClick: function (e) {
56723
+ setRetryLoading(true);
56721
56724
  e.stopPropagation();
56722
56725
  if (!run)
56723
56726
  return;
56724
- retryRun(projectOwner, projectName, run.id)
56725
- .then(function (d) { return console.log(d); })
56726
- .catch(function (e) { return console.log(e); });
56727
+ n$1.promise(retryRun(projectOwner, projectName, run.id), {
56728
+ loading: 'Loading',
56729
+ success: function (data) {
56730
+ console.log(data);
56731
+ return "Retry in progress. Please wait.";
56732
+ },
56733
+ error: function (err) {
56734
+ console.log(err);
56735
+ return "This just happened: ".concat(err.toString());
56736
+ },
56737
+ }, {
56738
+ style: { minWidth: '300px', fontSize: '12px' },
56739
+ success: {
56740
+ duration: 5000,
56741
+ icon: '🔥',
56742
+ position: 'bottom-left'
56743
+ },
56744
+ error: {
56745
+ duration: 5000,
56746
+ position: 'bottom-left'
56747
+ },
56748
+ loading: {
56749
+ position: 'bottom-left'
56750
+ }
56751
+ }).finally(function () {
56752
+ setRetryLoading(false);
56753
+ });
56727
56754
  } },
56728
56755
  React__default.createElement(Recycle$1, { style: { display: 'inline', margin: '0 5px 0 0' } }),
56729
- " Retry"))),
56756
+ " Retry"),
56757
+ React__default.createElement(Ie, null))),
56730
56758
  localRun && React__default.createElement(Button, { disabled: !run || !run.status.finished_at, onClick: function (e) {
56731
56759
  e.stopPropagation();
56732
56760
  if (!run)