pollination-react-io 1.71.1 → 1.72.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.
@@ -37976,6 +37976,8 @@ function getHost(key, defaultValue) {
37976
37976
  return typeof retrieved === 'string' ? retrieved.toLowerCase() : JSON.parse(retrieved).toLowerCase();
37977
37977
  }
37978
37978
  var recipeLinkFromSource = function (source) {
37979
+ if (!source)
37980
+ return;
37979
37981
  var splitSource = source.split('/');
37980
37982
  var tag = splitSource.pop();
37981
37983
  var name = splitSource.pop();
@@ -41416,7 +41418,7 @@ var ConfigureLocalRun = function (_a) {
41416
41418
  } },
41417
41419
  React__default.createElement(Laptop$1, null),
41418
41420
  "Local"))),
41419
- React__default.createElement(Label, { label: "Number of CPUs", disabled: !localConfig.isLocalJob, style: {
41421
+ localConfig.isLocalJob && React__default.createElement(Label, { label: "Number of CPUs", disabled: !localConfig.isLocalJob, style: {
41420
41422
  backgroundColor: 'white'
41421
41423
  } },
41422
41424
  React__default.createElement(NumberInput, { icon: React__default.createElement(Cpu$1, null), inputProps: {
@@ -41431,7 +41433,7 @@ var ConfigureLocalRun = function (_a) {
41431
41433
  setLocalConfig(function (config) { return (__assign(__assign({}, config), { localCPUCount: event.target.value })); });
41432
41434
  }
41433
41435
  } })),
41434
- React__default.createElement(Label, { label: "Select a Local Run Folder", disabled: !localConfig.isLocalJob },
41436
+ localConfig.isLocalJob && React__default.createElement(Label, { label: "Select a Local Run Folder", disabled: !localConfig.isLocalJob },
41435
41437
  React__default.createElement(SelectLocalArtifactNative, { disabled: !localConfig.isLocalJob, onChange: handleLocalPathChange, mode: 'directory', buttonLabel: 'Local Run Folder', value: localConfig && localConfig.localRunFolder }))));
41436
41438
  };
41437
41439
 
@@ -48753,22 +48755,22 @@ var formatDuration$1 = function (duration) {
48753
48755
  };
48754
48756
  var StudyCard = function (_a) {
48755
48757
  var _b;
48756
- var _c, _d, _e, _f, _g, _h, _j, _k, _l;
48757
- var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _m = _a.getTab, getTab = _m === void 0 ? function (tab) { } : _m, _o = _a.defaultTab, defaultTab = _o === void 0 ? '' : _o, _p = _a.enableLink, enableLink = _p === void 0 ? false : _p, _q = _a.canWrite, canWrite = _q === void 0 ? false : _q, _r = _a.getValue, getValue = _r === void 0 ? function (job) { } : _r, _s = _a.interval, interval = _s === void 0 ? 5000 : _s;
48758
+ var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
48759
+ var projectName = _a.projectName, projectOwner = _a.projectOwner, _study = _a.study, style = _a.style, authUser = _a.authUser, client = _a.client, enableClick = _a.enableClick, _0 = _a.getTab, getTab = _0 === void 0 ? function (tab) { } : _0, _1 = _a.defaultTab, defaultTab = _1 === void 0 ? '' : _1, _2 = _a.enableLink, enableLink = _2 === void 0 ? false : _2, _3 = _a.canWrite, canWrite = _3 === void 0 ? false : _3, _4 = _a.getValue, getValue = _4 === void 0 ? function (job) { } : _4, _5 = _a.interval, interval = _5 === void 0 ? 5000 : _5;
48758
48760
  /**
48759
48761
  * Fetch hooks
48760
48762
  */
48761
- var _t = useJobs(client), fetchJob = _t.fetchJob, getDuration = _t.getDuration, statusMap = _t.statusMap, deleteJob = _t.deleteJob, cancelJob = _t.cancelJob;
48763
+ var _6 = useJobs(client), fetchJob = _6.fetchJob, getDuration = _6.getDuration, statusMap = _6.statusMap, deleteJob = _6.deleteJob, cancelJob = _6.cancelJob;
48762
48764
  var listRuns = useRuns(client).listRuns;
48763
- var _u = useWindowDimensions(), width = _u.width; _u.height;
48764
- var _v = useState(false), seeDescription = _v[0], setSeeDescription = _v[1];
48765
- var _w = useState(false), seeAction = _w[0], setSeeAction = _w[1];
48766
- var _x = useState(false), stopRefresh = _x[0], setStopRefresh = _x[1];
48767
- var _y = useState(false), isReady = _y[0], setIsReady = _y[1];
48765
+ var _7 = useWindowDimensions(), width = _7.width; _7.height;
48766
+ var _8 = useState(false), seeDescription = _8[0], setSeeDescription = _8[1];
48767
+ var _9 = useState(false), seeAction = _9[0], setSeeAction = _9[1];
48768
+ var _10 = useState(false), stopRefresh = _10[0], setStopRefresh = _10[1];
48769
+ var _11 = useState(false), isReady = _11[0], setIsReady = _11[1];
48768
48770
  /**
48769
48771
  * From job to run
48770
48772
  */
48771
- var _z = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
48773
+ var _12 = useSWR(authUser && _study ? [projectOwner, projectName, _study.id] : undefined, fetchJob, {
48772
48774
  revalidateOnFocus: false,
48773
48775
  refreshInterval: stopRefresh ? undefined : interval,
48774
48776
  fallbackData: _study,
@@ -48801,7 +48803,7 @@ var StudyCard = function (_a) {
48801
48803
  if (study.status.finished_at)
48802
48804
  setStopRefresh(true);
48803
48805
  }
48804
- }), study = _z.data; _z.error; _z.isValidating;
48806
+ }), study = _12.data; _12.error; _12.isValidating;
48805
48807
  var sendJob = useCallback(function (job) { return getValue(job); }, [study]);
48806
48808
  var total = useMemo(function () {
48807
48809
  if (!study)
@@ -48825,8 +48827,8 @@ var StudyCard = function (_a) {
48825
48827
  }
48826
48828
  return study.status.status.toLocaleLowerCase();
48827
48829
  }, [study]);
48828
- var _0 = useState(), run = _0[0], setRun = _0[1];
48829
- var _1 = useState(getDuration(study)), duration = _1[0], setDuration = _1[1];
48830
+ var _13 = useState(), run = _13[0], setRun = _13[1];
48831
+ var _14 = useState(getDuration(study)), duration = _14[0], setDuration = _14[1];
48830
48832
  useEffect(function () {
48831
48833
  setRun(undefined);
48832
48834
  if (!study)
@@ -48857,7 +48859,7 @@ var StudyCard = function (_a) {
48857
48859
  info: false,
48858
48860
  settings: false
48859
48861
  };
48860
- var _2 = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _2[0], setHover = _2[1];
48862
+ var _15 = useState(__assign(__assign({}, initialValues), (_b = {}, _b[defaultTab] = true, _b))), hover = _15[0], setHover = _15[1];
48861
48863
  var toggleHover = useCallback(function (id, value) {
48862
48864
  if (value === void 0) { value = false; }
48863
48865
  setHover(function (prevHover) {
@@ -48993,22 +48995,22 @@ var StudyCard = function (_a) {
48993
48995
  React__default.createElement("div", { className: 'item5' },
48994
48996
  React__default.createElement("span", { style: { marginRight: '0.75rem' } },
48995
48997
  React__default.createElement(Avatar, { src: study ? (_h = study.author) === null || _h === void 0 ? void 0 : _h.picture_url : '', size: 24, color: hover.author ? '#40a9ff' : undefined })),
48996
- React__default.createElement("a", { className: 'link', href: study ? "/".concat(study.author.name) : '', title: 'Go to author page', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('author', true); }, onMouseLeave: function (e) { return toggleHover('author', false); }, style: hover.author ? { color: '#40a9ff' } : {} }, study ? ((_j = study.author.display_name) !== null && _j !== void 0 ? _j : study.author.name) : '--')),
48998
+ React__default.createElement("a", { className: 'link', href: study ? "/".concat((_j = study.author) === null || _j === void 0 ? void 0 : _j.name) : '', title: 'Go to author page', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('author', true); }, onMouseLeave: function (e) { return toggleHover('author', false); }, style: hover.author ? { color: '#40a9ff' } : {} }, study ? ((_l = (_k = study.author) === null || _k === void 0 ? void 0 : _k.display_name) !== null && _l !== void 0 ? _l : (_m = study.author) === null || _m === void 0 ? void 0 : _m.name) : '--')),
48997
48999
  React__default.createElement("div", { className: 'item6' },
48998
49000
  React__default.createElement("span", { style: { marginRight: '0.75rem' } },
48999
- React__default.createElement(Avatar, { src: study ? (_l = (_k = study.recipe) === null || _k === void 0 ? void 0 : _k.metadata) === null || _l === void 0 ? void 0 : _l.icon : '', size: 24, color: hover.recipe ? '#40a9ff' : undefined })),
49000
- React__default.createElement("a", { className: 'link', href: study ? recipeLinkFromSource(study.recipe.source) : '', title: 'Go to recipe page', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('recipe', true); }, onMouseLeave: function (e) { return toggleHover('recipe', false); }, style: hover.recipe ? { color: '#40a9ff' } : {} }, study ? study.recipe.metadata.name : '--'),
49001
+ React__default.createElement(Avatar, { src: study ? (_p = (_o = study.recipe) === null || _o === void 0 ? void 0 : _o.metadata) === null || _p === void 0 ? void 0 : _p.icon : '', size: 24, color: hover.recipe ? '#40a9ff' : undefined })),
49002
+ React__default.createElement("a", { className: 'link', href: study ? recipeLinkFromSource((_q = study === null || study === void 0 ? void 0 : study.recipe) === null || _q === void 0 ? void 0 : _q.source) : '', title: 'Go to recipe page', rel: 'noreferrer', onMouseOver: function (e) { return toggleHover('recipe', true); }, onMouseLeave: function (e) { return toggleHover('recipe', false); }, style: hover.recipe ? { color: '#40a9ff' } : {} }, study ? (_s = (_r = study.recipe) === null || _r === void 0 ? void 0 : _r.metadata) === null || _s === void 0 ? void 0 : _s.name : '--'),
49001
49003
  study && React__default.createElement("span", { className: 'light-text' },
49002
- " ",
49003
- study.recipe.metadata.tag)),
49004
+ " ", (_u = (_t = study.recipe) === null || _t === void 0 ? void 0 : _t.metadata) === null || _u === void 0 ? void 0 :
49005
+ _u.tag)),
49004
49006
  React__default.createElement("div", { className: 'item8' },
49005
49007
  React__default.createElement("span", { className: 'status-label', style: { marginRight: '0.75rem' } }, study ? status.charAt(0).toUpperCase() + status.slice(1) : '--'),
49006
49008
  React__default.createElement("span", { className: 'light-text' },
49007
49009
  !isReady && React__default.createElement(LoadingOutlined$1, null),
49008
49010
  (study && total == 1) && run && width > 600 &&
49009
- "".concat(run.meta.progress.completed, " / ").concat(run.meta.progress.total, " steps"),
49011
+ "".concat((_w = (_v = run.meta) === null || _v === void 0 ? void 0 : _v.progress) === null || _w === void 0 ? void 0 : _w.completed, " / ").concat((_y = (_x = run.meta) === null || _x === void 0 ? void 0 : _x.progress) === null || _y === void 0 ? void 0 : _y.total, " steps"),
49010
49012
  (study && total > 1) && width > 600 &&
49011
- "".concat(study.status.runs_completed, " / ").concat(total, " runs"))),
49013
+ "".concat((_z = study.status) === null || _z === void 0 ? void 0 : _z.runs_completed, " / ").concat(total, " runs"))),
49012
49014
  React__default.createElement("div", { className: 'item9', title: 'CPU usage' },
49013
49015
  React__default.createElement(Cpu$1, { size: 18, style: { marginRight: '0.15rem' } }),
49014
49016
  React__default.createElement("span", { className: 'light-text' }, study ? "".concat(formatDuration$1(dayjs_min.duration(study.resources_duration.cpu, 'seconds'))) : '--')),
@@ -49272,8 +49274,8 @@ var RunCard = function (_a) {
49272
49274
  if (localRun) {
49273
49275
  // Get study name
49274
49276
  var path = !_run['subfolder']
49275
- ? "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log")
49276
- : "".concat(_run.id, "/").concat(_run['subfolder'], "/").concat(localStudyURLname, "/__logs__/logs.log");
49277
+ ? "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/err.log")
49278
+ : "".concat(_run.id, "/").concat(_run['subfolder'], "/").concat(localStudyURLname, "/__logs__/err.log");
49277
49279
  fileExplorer(path);
49278
49280
  }
49279
49281
  else {