Skip to content

Commit 27ee3bf

Browse files
committed
Implemented continue/restart workflow
1 parent 4cd7b48 commit 27ee3bf

File tree

5 files changed

+460
-228
lines changed

5 files changed

+460
-228
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* moved editing of dataset inside dataset page (\#452);
1919
* supported editing of single dataset images (\#457);
2020
* used switches to represent boolean flags (\#457);
21+
* implemented continue/restart workflow (\#465);
2122

2223
# 0.10.2
2324

src/lib/common/job_utilities.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,22 @@ export function extractRelevantJobError(completeJobError, maxLines = undefined)
114114
}
115115
return relevantError;
116116
}
117+
118+
/**
119+
* @param {import("$lib/types-v2").DatasetV2[]} datasets
120+
* @param {string} selectedDatasetName
121+
* @returns {string}
122+
*/
123+
export function generateNewUniqueDatasetName(datasets, selectedDatasetName) {
124+
let i = 1;
125+
const match = selectedDatasetName.match(/^(.*)_(\d+)$/);
126+
if (match) {
127+
selectedDatasetName = match[1];
128+
}
129+
let newDatasetName;
130+
do {
131+
newDatasetName = `${selectedDatasetName}_${i}`;
132+
i++;
133+
} while (datasets.filter((d) => d.name === newDatasetName).length > 0);
134+
return newDatasetName;
135+
}

src/lib/components/v2/workflow/InputFiltersTab.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
});
3939
4040
export async function init() {
41-
form.init(workflowTask.input_filters.attributes, workflowTask.input_filters.types);
41+
if (!form.hasUnsavedChanges()) {
42+
form.init(workflowTask.input_filters.attributes, workflowTask.input_filters.types);
43+
}
4244
4345
if (selectedDatasetId === undefined) {
4446
datasetAttributes = {};

0 commit comments

Comments
 (0)