Skip to content

Commit 90944e7

Browse files
authored
Merge pull request #876 from fractal-analytics-platform/pagination
Added paginator to admin tasks and jobs pages
2 parents 362a9c9 + 88e7c13 commit 90944e7

File tree

10 files changed

+300
-171
lines changed

10 files changed

+300
-171
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Added support for oneOf and discriminator (\#867);
1818
* Added resource filter on admin task and task-group pages (\#867);
1919
* Handled `FRACTAL_DEFAULT_GROUP_NAME` environment variable, to specify if a default group is used (\#870);
20+
* Renamed "Restart workflow" to "Reset workflow" (\#876);
21+
* Added paginator to admin tasks and jobs pages (\#876);
2022

2123
# 1.20.0
2224

playwright.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default defineConfig({
8888

8989
webServer: [
9090
{
91-
command: './tests/start-test-server.sh --branch main',
91+
command: './tests/start-test-server.sh --branch pagination',
9292
port: 8000,
9393
waitForPort: true,
9494
stdout: 'pipe',

src/lib/components/v2/jobs/JobsList.svelte

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@
139139
* @param {Array<import('fractal-components/types/api').ApplyWorkflowV2>} jobs
140140
*/
141141
function getSortedJobs(jobs) {
142+
if (admin) {
143+
return jobs;
144+
}
142145
const sortedRows = [...jobs];
143146
const sortColumns = columns.filter(
144147
(c) => c.direction !== undefined && c.priority !== undefined && c.field
@@ -413,12 +416,14 @@
413416
{#if column.field}
414417
<th onclick={() => updateSortField(column)} style="cursor: pointer">
415418
{column.label}
416-
{#if column.direction === 'asc'}
417-
418-
{:else if column.direction === 'desc'}
419-
420-
{:else}
421-
419+
{#if !admin}
420+
{#if column.direction === 'asc'}
421+
422+
{:else if column.direction === 'desc'}
423+
424+
{:else}
425+
426+
{/if}
422427
{/if}
423428
</th>
424429
{:else}
@@ -480,23 +485,29 @@
480485
<td>
481486
<button
482487
class="btn btn-info"
488+
aria-label="Info"
483489
onclick={(event) => {
484490
event.preventDefault();
485491
jobInfoModal.show(row);
486492
}}
487493
>
488494
<i class="bi-info-circle"></i>
489-
Info
495+
{#if !admin}
496+
Info
497+
{/if}
490498
</button>
491499
<button
492500
class="btn btn-light"
501+
aria-label="Logs"
493502
onclick={(event) => {
494503
event.preventDefault();
495504
jobLogsModal.show(row, admin);
496505
}}
497506
>
498507
<i class="bi-list-columns-reverse"></i>
499-
Logs
508+
{#if !admin}
509+
Logs
510+
{/if}
500511
</button>
501512
{#if (admin && row.id) || (row.project_id !== null && row.user_email === currentUserEmail)}
502513
<a

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@
526526
{:else if mode === 'continue'}
527527
Continue workflow
528528
{:else}
529-
Restart workflow
529+
Reset workflow
530530
{/if}
531531
</h5>
532532
{/snippet}
@@ -535,10 +535,10 @@
535535
<form id="runWorkflowForm">
536536
{#if mode === 'restart'}
537537
<div class="alert alert-warning">
538-
<strong>WARNING</strong>: Restarting a workflow will create a new dataset and optionally
539-
delete the old dataset with its image list, filters & history. It does not remove the
540-
existing Zarr data though. Either remove it yourself before rerunning or set the overwrite
541-
option to True in the corresponding tasks.
538+
<strong>WARNING</strong>: Restarting a workflow will reset your dataset and its processing
539+
history. It deletes the existing dataset and creates a new one. Thus, you should only
540+
restart a workflow if you don't need access anymore to the dataset and its processing
541+
history. Be aware that resetting the dataset will not remove the on-disk Zarr data though.
542542
</div>
543543
{/if}
544544
{#if mode === 'restart'}
@@ -600,7 +600,7 @@
600600
name="firstTaskIndex"
601601
id="firstTaskIndex"
602602
class="form-select"
603-
disabled={checkingConfiguration}
603+
disabled={checkingConfiguration || mode === 'restart'}
604604
bind:value={firstTaskIndex}
605605
onchange={firstTaskIndexChanged}
606606
class:is-invalid={mode === 'continue' && firstTaskIndex === undefined}

0 commit comments

Comments
 (0)