Skip to content

Commit 8348707

Browse files
committed
Fixed attribute filters sent in run workflow request
1 parent b9878e2 commit 8348707

File tree

2 files changed

+30
-13
lines changed

2 files changed

+30
-13
lines changed

src/lib/components/v2/projects/datasets/DatasetImagesTable.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
/** @type {{ [key: string]: Array<string | number | boolean> | null}} */
4040
let attributeFilters = getAttributeFilterBaseValues(imagePage);
4141
42+
export function getAttributeFilters() {
43+
return attributeFilters;
44+
}
45+
4246
/** @type {{ [key: string]: boolean | null }}} */
4347
let typeFilters = getTypeFilterBaseValues(imagePage);
4448
/** @type {import('$lib/components/common/StandardErrorAlert.svelte').default|undefined} */
@@ -494,7 +498,7 @@
494498
</label>
495499
<button
496500
class="ps-0 btn btn-link"
497-
on:click={() => toggleAll(attributeKey)}
501+
on:click|preventDefault={() => toggleAll(attributeKey)}
498502
title="Toggle all"
499503
>
500504
<i class="bi bi-check-all" />

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

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
/** @type {Modal} */
2828
let modal;
2929
30+
/** @type {DatasetImagesTable|undefined} */
31+
let datasetImagesTable;
32+
3033
let applyingWorkflow = false;
3134
let checkingConfiguration = false;
3235
let setSlurmAccount = true;
@@ -209,7 +212,6 @@
209212
let appliedTypeFilters = {};
210213
211214
function showConfirmRun() {
212-
checkingConfiguration = true;
213215
const wft = workflow.task_list[firstTaskIndex || 0];
214216
if (mode === 'restart') {
215217
appliedAttributeFilters = { ...selectedDataset?.attribute_filters };
@@ -218,9 +220,14 @@
218220
const dataset = /** @type {import('fractal-components/types/api').DatasetV2} */ (
219221
selectedDataset
220222
);
221-
appliedAttributeFilters = { ...dataset.attribute_filters };
223+
if (datasetImagesTable) {
224+
appliedAttributeFilters = datasetImagesTable.getAttributeFilters();
225+
} else {
226+
appliedAttributeFilters = { ...dataset.attribute_filters };
227+
}
222228
appliedTypeFilters = { ...dataset.type_filters, ...wft.type_filters };
223229
}
230+
checkingConfiguration = true;
224231
}
225232
226233
function computeNewDatasetName() {
@@ -478,7 +485,7 @@
478485
</div>
479486
</div>
480487
</div>
481-
{#if selectedDataset && imagePage && imagePage.images.length > 0 && firstTaskIndex !== undefined}
488+
{#if selectedDataset && imagePage && imagePage.images.length > 0 && firstTaskIndex !== undefined && mode !== 'restart'}
482489
<div class="accordion-item">
483490
<h2 class="accordion-header">
484491
<button
@@ -498,15 +505,21 @@
498505
data-bs-parent="#accordion-run-workflow"
499506
>
500507
<div class="accordion-body">
501-
<DatasetImagesTable
502-
dataset={selectedDataset}
503-
{imagePage}
504-
{initialFilterValues}
505-
{attributeFiltersEnabled}
506-
useDatasetFilters={false}
507-
vizarrViewerUrl={null}
508-
runWorkflowModal={true}
509-
/>
508+
{#if checkingConfiguration}
509+
This job will process {imagePage.total_count}
510+
{imagePage.total_count === 1 ? 'image' : 'images'}.
511+
{:else}
512+
<DatasetImagesTable
513+
bind:this={datasetImagesTable}
514+
dataset={selectedDataset}
515+
bind:imagePage
516+
{initialFilterValues}
517+
{attributeFiltersEnabled}
518+
useDatasetFilters={false}
519+
vizarrViewerUrl={null}
520+
runWorkflowModal={true}
521+
/>
522+
{/if}
510523
</div>
511524
</div>
512525
</div>

0 commit comments

Comments
 (0)