Skip to content

Commit 5bef701

Browse files
committed
Displayed list of images in run workflow modal
1 parent 05c4ab3 commit 5bef701

File tree

12 files changed

+1007
-646
lines changed

12 files changed

+1007
-646
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ LOG_LEVEL_CONSOLE=warn
2020

2121
FRACTAL_RUNNER_BACKEND=local
2222
#WARNING_BANNER_PATH=/path/to/banner.txt
23+
ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS=false

.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ LOG_LEVEL_CONSOLE=info
1919

2020
FRACTAL_RUNNER_BACKEND=local
2121
#WARNING_BANNER_PATH=/path/to/banner.txt
22+
ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS=false

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
*Note: Numbers like (\#123) point to closed Pull Requests on the fractal-web repository.*
22

33
# Unreleased
4+
5+
* Displayed list of images that would be processed by the first task of a job (\#686);
6+
* Added environment variable `ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS`, to enable attribute filters on the "Run workflow" modal (\#686);
47
* Fixed findings based on `zizmor 1.0.1` audit (\#687).
58

69
# 1.14.0

__tests__/v2/RunWorkflowModal.test.js

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
import { describe, it, expect, vi } from 'vitest';
1+
import { describe, beforeEach, it, expect, vi } from 'vitest';
22
import { fireEvent, render } from '@testing-library/svelte';
33

44
// Mocking fetch
55
global.fetch = vi.fn();
66

7-
fetch.mockResolvedValue({
8-
ok: true,
9-
status: 200,
10-
json: () => new Promise((resolve) => resolve({ slurm_accounts: [] }))
11-
});
12-
137
// Mocking bootstrap.Modal
148
class MockModal {
159
constructor() {
@@ -54,14 +48,39 @@ const workflow1 = {
5448
};
5549

5650
describe('RunWorkflowModal', () => {
51+
beforeEach(() => {
52+
fetch
53+
.mockResolvedValueOnce({
54+
ok: true,
55+
status: 200,
56+
json: () => new Promise((resolve) => resolve({ slurm_accounts: [] }))
57+
})
58+
.mockResolvedValue({
59+
ok: true,
60+
status: 200,
61+
json: () =>
62+
new Promise((resolve) =>
63+
resolve({
64+
total_count: 0,
65+
page_size: 10,
66+
current_page: 1,
67+
attributes: {},
68+
types: [],
69+
images: []
70+
})
71+
)
72+
});
73+
});
74+
5775
it('When continuing a workflow, show applied filters prioritizing the first workflow task filters', async () => {
5876
const result = render(RunWorkflowModal, {
5977
datasets: [dataset1],
6078
selectedDatasetId: 1,
6179
workflow: workflow1,
6280
onJobSubmitted: vi.fn(),
6381
onDatasetsUpdated: vi.fn(),
64-
statuses: { 1: 'failed' }
82+
statuses: { 1: 'failed' },
83+
attributeFiltersEnabled: false
6584
});
6685

6786
result.component.open('continue');
@@ -85,7 +104,8 @@ describe('RunWorkflowModal', () => {
85104
workflow: workflow1,
86105
onJobSubmitted: vi.fn(),
87106
onDatasetsUpdated: vi.fn(),
88-
statuses: { 1: 'done' }
107+
statuses: { 1: 'done' },
108+
attributeFiltersEnabled: false
89109
});
90110

91111
result.component.open('restart');
@@ -121,7 +141,8 @@ describe('RunWorkflowModal', () => {
121141
},
122142
onJobSubmitted: vi.fn(),
123143
onDatasetsUpdated: vi.fn(),
124-
statuses: { 1: 'failed' }
144+
statuses: { 1: 'failed' },
145+
attributeFiltersEnabled: false
125146
});
126147

127148
result.component.open('continue');

docs/environment-variables.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ The following environment variables can be used to configure fractal-web.
1818
* `LOG_LEVEL_CONSOLE`: the log level of logs that will be written to the console; the default value is `warn`;
1919
* `FRACTAL_RUNNER_BACKEND`: specifies which runner backend is used; supported values are: `local`, `local_experimental`, `slurm`, `slurm_ssh`; setting this variable is mandatory;
2020
* `PUBLIC_FRACTAL_VIZARR_VIEWER_URL`: URL to [fractal-vizarr-viewer](https://github.com/fractal-analytics-platform/fractal-vizarr-viewer) service (e.g. http://localhost:3000/vizarr for testing);
21-
* `WARNING_BANNER_PATH`: specifies the path to a text file containing the warning banner message displayed on the site; the banner is used to inform users about important issues, such as external resources downtime or maintenance alerts; if the variable is empty or unset no banner is displayed.
21+
* `WARNING_BANNER_PATH`: specifies the path to a text file containing the warning banner message displayed on the site; the banner is used to inform users about important issues, such as external resources downtime or maintenance alerts; if the variable is empty or unset no banner is displayed;
22+
* `ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS`: enable attribute filters interactive editing from the job-submission modal; supported values are `true` or `false`; default value is `false`.
2223

2324
When running directly using `node` command these extra variables can also be configured:
2425

docs/quickstart.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export FRACTAL_RUNNER_BACKEND=local
6565
#export AUTH_COOKIE_PATH=/
6666
#export AUTH_COOKIE_SAME_SITE=lax
6767
#export PUBLIC_UPDATE_JOBS_INTERVAL=3000
68+
#export ENABLE_INTERACTIVE_ATTRIBUTE_FILTERS=false
6869

6970
node build/
7071
```

0 commit comments

Comments
 (0)