pollination-react-io 1.67.0 → 1.67.2

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
@@ -38098,12 +38098,13 @@ var usePollinationPanel = function () {
38098
38098
  /**
38099
38099
  * Fetch local run
38100
38100
  */
38101
- var fetchLocalRun = React.useCallback(function (path) {
38101
+ var fetchLocalRun = React.useCallback(function (path, subfolder) {
38102
38102
  if (path === void 0) { path = ''; }
38103
+ if (subfolder === void 0) { subfolder = undefined; }
38103
38104
  if (!panel)
38104
38105
  return;
38105
38106
  try {
38106
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.status]);
38107
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.status]);
38107
38108
  var run = JSON.parse(message.data);
38108
38109
  return run;
38109
38110
  }
@@ -38114,13 +38115,14 @@ var usePollinationPanel = function () {
38114
38115
  /**
38115
38116
  * Fetch local job
38116
38117
  */
38117
- var fetchLocalJob = React.useCallback(function (path) {
38118
+ var fetchLocalJob = React.useCallback(function (path, subfolder) {
38118
38119
  var _a;
38119
38120
  if (path === void 0) { path = ''; }
38121
+ if (subfolder === void 0) { subfolder = undefined; }
38120
38122
  if (!panel)
38121
38123
  return;
38122
38124
  try {
38123
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.job]);
38125
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.job]);
38124
38126
  var localJob = JSON.parse(message.data);
38125
38127
  var job = (_a = localJob === null || localJob === void 0 ? void 0 : localJob.LocalJob) === null || _a === void 0 ? void 0 : _a.Job;
38126
38128
  return job;
@@ -38133,12 +38135,13 @@ var usePollinationPanel = function () {
38133
38135
  /**
38134
38136
  * Fetch local log
38135
38137
  */
38136
- var fetchLocalLog = React.useCallback(function (path) {
38138
+ var fetchLocalLog = React.useCallback(function (path, subfolder) {
38137
38139
  if (path === void 0) { path = ''; }
38140
+ if (subfolder === void 0) { subfolder = undefined; }
38138
38141
  if (!panel)
38139
38142
  return;
38140
38143
  try {
38141
- var message = panel.FetchSimulationFile(path, SimulationFileType[SimulationFileType.logs]);
38144
+ var message = panel.FetchSimulationFile(path, subfolder, SimulationFileType[SimulationFileType.logs]);
38142
38145
  return message.data;
38143
38146
  }
38144
38147
  catch (error) {
@@ -38208,13 +38211,14 @@ var usePollinationPanel = function () {
38208
38211
  * Delete job with the same input/ouput folder from DB
38209
38212
  * @param projectSlug Project slug
38210
38213
  * @param path Location where files are
38214
+ * @param subfolder Subfolder
38211
38215
  * @returns Message with number of deleted records
38212
38216
  */
38213
- var deleteJob = function (projectSlug, path) {
38217
+ var deleteJob = function (projectSlug, path, subfolder) {
38214
38218
  if (!panel)
38215
38219
  return;
38216
38220
  try {
38217
- var message = panel.DeleteJob(projectSlug, path);
38221
+ var message = panel.DeleteJob(projectSlug, path, subfolder);
38218
38222
  var count = JSON.parse(message.data);
38219
38223
  return count;
38220
38224
  }
@@ -44890,9 +44894,9 @@ var RecipeForm = function (_a) {
44890
44894
  React.useEffect(function () {
44891
44895
  if (!localStudyWarning)
44892
44896
  return;
44893
- n$1("Study with the same name and Local run folder detected. \n If the study will be submitted it will override the previous data. \n You can change the study name or Local run folder to avoid the loss of data.", {
44897
+ n$1("A local run with the same name exists. \n Try to change the study name or local run folder to avoid the overwrite.", {
44894
44898
  duration: 8000,
44895
- position: 'top-center',
44899
+ position: 'bottom-left',
44896
44900
  icon: '⚠️',
44897
44901
  style: { fontSize: '14px' },
44898
44902
  iconTheme: {
@@ -49045,14 +49049,14 @@ var RunCard = function (_a) {
49045
49049
  /*
49046
49050
  * From run and stop when it is done
49047
49051
  */
49048
- var _4 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id]) : undefined, localRun ? fetchLocalRun : fetchRun, {
49052
+ var _4 = useSWR(authUser && _run ? (!localRun ? [projectOwner, projectName, _run.id] : [_run.id, _run['subfolder']]) : undefined, localRun ? fetchLocalRun : fetchRun, {
49049
49053
  revalidateOnFocus: false,
49050
49054
  refreshInterval: stopRefresh ? undefined : interval,
49051
49055
  fallbackData: localRun ? undefined : _run,
49052
49056
  errorRetryCount: 3,
49053
49057
  onSuccess: function (run, key, config) {
49054
49058
  if (localRun) {
49055
- var jobInfo = fetchLocalJob(_run.id);
49059
+ var jobInfo = fetchLocalJob(_run.id, _run['subfolder']);
49056
49060
  setLocalStudy(jobInfo);
49057
49061
  } // It is written at the end of the simulation
49058
49062
  sendRun(run);
@@ -49167,7 +49171,7 @@ var RunCard = function (_a) {
49167
49171
  window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/studies/").concat(study.id, "/runs/").concat(run.id);
49168
49172
  }
49169
49173
  else {
49170
- window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/localStudies/").concat(localStudyURLname, "/?path=").concat(_run.id);
49174
+ window.location.href = "/".concat(projectOwner, "/projects/").concat(projectName, "/localStudies/").concat(localStudyURLname, "/?path=").concat(_run.id, "&subfolder=").concat(_run['subfolder']);
49171
49175
  }
49172
49176
  } },
49173
49177
  React__default["default"].createElement("div", { className: 'item1' },
@@ -49238,7 +49242,9 @@ var RunCard = function (_a) {
49238
49242
  getTab(RunTabs.debug);
49239
49243
  if (localRun) {
49240
49244
  // Get study name
49241
- var path = "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log");
49245
+ var path = !_run['subfolder']
49246
+ ? "".concat(_run.id, "/").concat(localStudyURLname, "/__logs__/logs.log")
49247
+ : "".concat(_run.id, "/").concat(_run['subfolder'], "/").concat(localStudyURLname, "/__logs__/logs.log");
49242
49248
  fileExplorer(path);
49243
49249
  }
49244
49250
  else {
@@ -49345,9 +49351,9 @@ var RunCard = function (_a) {
49345
49351
  e.stopPropagation();
49346
49352
  if (!run)
49347
49353
  return;
49348
- var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id);
49354
+ var count = deleteJob("".concat(projectOwner, "/").concat(projectName), _run.id, _run['subfolder']);
49349
49355
  if (count > 0) {
49350
- if (window.location.href.includes("?path=".concat(_run.id))) {
49356
+ if (window.location.href.includes("?path=")) {
49351
49357
  window.history.back();
49352
49358
  }
49353
49359
  else {