Skip to content

Commit d119616

Browse files
authored
Merge pull request #677 from fractal-analytics-platform/tasks-list-install-info-modal
Install instructions in tasks table and other minor changes
2 parents 227909c + db88e35 commit d119616

File tree

20 files changed

+297
-161
lines changed

20 files changed

+297
-161
lines changed

CHANGELOG.md

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

3+
# Unreleased
4+
5+
* Tasks table improvements (\#677):
6+
* Handled install instructions (\#677);
7+
* Made task name a link pointing to `docs_link` (\#677);
8+
* Removed `input_types` column (\#677);
9+
* Fixed task group activity wrong admin API call (\#677);
10+
* Used new replace-task endpoint for version update (\#677);
11+
* Fixed version update for deactivated tasks (\#677);
12+
313
# 1.13.0
414

515
* Moved `jschema` and other common components to a dedicated`components` module (\#671);

__tests__/v2/VersionUpdate.test.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ const taskGroups = [
5555
args_schema_parallel: null,
5656
taskgroupv2_id: 1
5757
}
58-
]
58+
],
59+
active: true
5960
},
6061
{
6162
id: 2,
@@ -70,7 +71,8 @@ const taskGroups = [
7071
args_schema_parallel: null,
7172
taskgroupv2_id: 2
7273
}
73-
]
74+
],
75+
active: true
7476
},
7577
{
7678
id: 3,
@@ -85,7 +87,8 @@ const taskGroups = [
8587
args_schema_parallel: null,
8688
taskgroupv2_id: 3
8789
}
88-
]
90+
],
91+
active: true
8992
},
9093
{
9194
id: 4,
@@ -100,7 +103,8 @@ const taskGroups = [
100103
args_schema_parallel: {},
101104
taskgroupv2_id: 4
102105
}
103-
]
106+
],
107+
active: true
104108
},
105109
{
106110
id: 5,
@@ -115,7 +119,8 @@ const taskGroups = [
115119
args_schema_parallel: {},
116120
taskgroupv2_id: 5
117121
}
118-
]
122+
],
123+
active: true
119124
},
120125
{
121126
id: 6,
@@ -130,7 +135,8 @@ const taskGroups = [
130135
args_schema_parallel: {},
131136
taskgroupv2_id: 6
132137
}
133-
]
138+
],
139+
active: true
134140
},
135141
{
136142
id: 7,
@@ -145,7 +151,8 @@ const taskGroups = [
145151
args_schema_parallel: {},
146152
taskgroupv2_id: 7
147153
}
148-
]
154+
],
155+
active: true
149156
},
150157
{
151158
id: 8,
@@ -160,7 +167,8 @@ const taskGroups = [
160167
args_schema_parallel: null,
161168
taskgroupv2_id: 8
162169
}
163-
]
170+
],
171+
active: true
164172
}
165173
];
166174

__tests__/v2/version-checker.test.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ describe('Version checker', () => {
4747
taskgroupv2_id: 1
4848
}
4949
],
50-
pkg_name: 'group1'
50+
pkg_name: 'group1',
51+
active: true
5152
},
5253
{
5354
id: 2,
@@ -61,7 +62,8 @@ describe('Version checker', () => {
6162
taskgroupv2_id: 2
6263
}
6364
],
64-
pkg_name: 'group1'
65+
pkg_name: 'group1',
66+
active: true
6567
},
6668
{
6769
id: 3,
@@ -75,7 +77,8 @@ describe('Version checker', () => {
7577
taskgroupv2_id: 3
7678
}
7779
],
78-
pkg_name: 'group2'
80+
pkg_name: 'group2',
81+
active: true
7982
}
8083
];
8184

@@ -131,7 +134,8 @@ describe('Version checker', () => {
131134
taskgroupv2_id: 1
132135
}
133136
],
134-
pkg_name: 'group1'
137+
pkg_name: 'group1',
138+
active: true
135139
},
136140
{
137141
id: 2,
@@ -145,7 +149,8 @@ describe('Version checker', () => {
145149
taskgroupv2_id: 2
146150
}
147151
],
148-
pkg_name: 'group1'
152+
pkg_name: 'group1',
153+
active: true
149154
},
150155
{
151156
id: 3,
@@ -159,7 +164,8 @@ describe('Version checker', () => {
159164
taskgroupv2_id: 3
160165
}
161166
],
162-
pkg_name: 'group1'
167+
pkg_name: 'group1',
168+
active: true
163169
}
164170
];
165171

@@ -208,7 +214,8 @@ describe('Version checker', () => {
208214
taskgroupv2_id: 1
209215
}
210216
],
211-
pkg_name: 'group1'
217+
pkg_name: 'group1',
218+
active: true
212219
},
213220
{
214221
id: 2,
@@ -222,7 +229,8 @@ describe('Version checker', () => {
222229
taskgroupv2_id: 2
223230
}
224231
],
225-
pkg_name: 'group1'
232+
pkg_name: 'group1',
233+
active: true
226234
}
227235
];
228236

@@ -280,7 +288,8 @@ describe('Version checker', () => {
280288
taskgroupv2_id: 1
281289
}
282290
],
283-
pkg_name: 'group1'
291+
pkg_name: 'group1',
292+
active: true
284293
},
285294
{
286295
id: 2,
@@ -295,7 +304,8 @@ describe('Version checker', () => {
295304
taskgroupv2_id: 2
296305
}
297306
],
298-
pkg_name: 'group1'
307+
pkg_name: 'group1',
308+
active: true
299309
},
300310
{
301311
id: 3,
@@ -310,7 +320,8 @@ describe('Version checker', () => {
310320
taskgroupv2_id: 3
311321
}
312322
],
313-
pkg_name: 'group1'
323+
pkg_name: 'group1',
324+
active: true
314325
}
315326
];
316327

__tests__/v2/workflow_page.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('Workflow page', () => {
5757
status: 200,
5858
json: async () => {
5959
switch (url) {
60-
case '/api/v2/task-group?only_active=true':
60+
case '/api/v2/task-group?only_active=false':
6161
return [
6262
{
6363
id: 1,

components/src/lib/tasks/FilteredTasksTable.svelte

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { buildWorkflowTaskTableRows, sortVersions } from '../tasks/task_group_utilities';
44
import SlimSelect from 'slim-select';
55
import ColouredBadge from '../common/ColouredBadge.svelte';
6-
import BooleanIcon from '../common/BooleanIcon.svelte';
76
87
/** @type {Array<import('../types/api').TaskGroupV2>} */
98
export let taskGroups;
@@ -27,8 +26,6 @@
2726
/** @type {SlimSelect|undefined} */
2827
let tagSelector = undefined;
2928
let tagFilter = '';
30-
/** @type {SlimSelect|undefined} */
31-
let inputTypeSelector = undefined;
3229
let inputTypeFilter = '';
3330
3431
let groupByLabels = {
@@ -172,7 +169,6 @@
172169
modalitySelector?.setSelected('');
173170
packageSelector?.setSelected('');
174171
tagSelector?.setSelected('');
175-
inputTypeSelector?.setSelected('');
176172
}
177173
178174
/**
@@ -206,15 +202,6 @@
206202
]),
207203
'Tag'
208204
);
209-
setSelectorData(
210-
inputTypeSelector,
211-
buildSlimSelectOptions([
212-
...new Set(
213-
taskGroups.flatMap((tg) => tg.task_list).flatMap((t) => Object.keys(t.input_types))
214-
)
215-
]),
216-
'Input type'
217-
);
218205
}
219206
220207
/**
@@ -275,14 +262,6 @@
275262
tagSelector = setSlimSelect('tag-filter', 'Select tag', 'Tag', (value) => {
276263
tagFilter = value;
277264
});
278-
inputTypeSelector = setSlimSelect(
279-
'input-type-filter',
280-
'Select input type',
281-
'Input type',
282-
(value) => {
283-
inputTypeFilter = value;
284-
}
285-
);
286265
setup();
287266
});
288267
@@ -349,9 +328,6 @@
349328
<div class="col">
350329
<select id="modality-filter" class="invisible" />
351330
</div>
352-
<div class="col">
353-
<select id="input-type-filter" class="invisible" />
354-
</div>
355331
<div class="col">
356332
<select id="tag-filter" class="invisible" />
357333
</div>
@@ -367,14 +343,21 @@
367343
<div class="card">
368344
<div class="card-body p-0">
369345
<table class="table table-borderless" id="filtered-tasks-table">
346+
<colgroup>
347+
<col />
348+
<col />
349+
<col />
350+
<col />
351+
<col width="120" />
352+
<slot name="extra-columns-colgroup" />
353+
</colgroup>
370354
<thead>
371355
<tr>
372356
<th>{groupByLabels[groupBy]}</th>
373357
<th>Category</th>
374358
<th>Modality</th>
375-
<th>Input Types</th>
376359
<th>Metadata</th>
377-
<th colspan="2">Version</th>
360+
<th>Version</th>
378361
<slot name="extra-columns-header" />
379362
</tr>
380363
</thead>
@@ -386,7 +369,15 @@
386369
{#each row.tasks as task}
387370
{#if task.taskVersions[task.selectedVersion]}
388371
<tr>
389-
<td class="task-name-col">{task.taskVersions[task.selectedVersion].task_name}</td>
372+
<td class="task-name-col">
373+
{#if task.taskVersions[task.selectedVersion].docs_link}
374+
<a href={task.taskVersions[task.selectedVersion].docs_link} target="_blank">
375+
{task.taskVersions[task.selectedVersion].task_name}
376+
</a>
377+
{:else}
378+
{task.taskVersions[task.selectedVersion].task_name}
379+
{/if}
380+
</td>
390381
<td>
391382
{#if task.taskVersions[task.selectedVersion].category}
392383
<button
@@ -413,14 +404,6 @@
413404
</button>
414405
{/if}
415406
</td>
416-
<td class="metadata-col">
417-
{#each Object.entries(task.taskVersions[task.selectedVersion].input_types) as [input_type_key, input_type_value]}
418-
<div class="d-flex flex-row">
419-
<div class="input-type-text me-1">{input_type_key}</div>
420-
<div><BooleanIcon value={input_type_value} /></div>
421-
</div>
422-
{/each}
423-
</td>
424407
<td class="metadata-col">
425408
{getMetadataCell(task.taskVersions[task.selectedVersion])}
426409
</td>
@@ -440,9 +423,6 @@
440423
{task.taskVersions[task.selectedVersion].version}
441424
{/if}
442425
</td>
443-
<td class="docs-info-col">
444-
<slot name="docs-info" task={task.taskVersions[task.selectedVersion]} />
445-
</td>
446426
<slot name="extra-columns" task={task.taskVersions[task.selectedVersion]} />
447427
</tr>
448428
{/if}
@@ -459,16 +439,17 @@
459439
{/if}
460440
461441
<style>
462-
#filtered-tasks-table td {
442+
:global(#filtered-tasks-table td) {
463443
vertical-align: middle;
464444
}
465445
#filtered-tasks-table tr th:first-child,
466446
#filtered-tasks-table tr td:first-child {
467447
padding-left: 15px;
468448
}
469-
#filtered-tasks-table tr th {
449+
:global(#filtered-tasks-table tr th) {
470450
padding-top: 18px;
471451
padding-bottom: 12px;
452+
background: transparent;
472453
}
473454
.metadata-col {
474455
font-size: 85%;
@@ -482,8 +463,4 @@
482463
.version-col {
483464
max-width: 90px;
484465
}
485-
486-
.input-type-text {
487-
overflow-wrap: anywhere;
488-
}
489466
</style>

components/src/lib/tasks/task_group_utilities.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ function getTaskTableProperties(taskGroup, task) {
154154
authors: task.authors,
155155
tags: task.tags,
156156
input_types: task.input_types,
157-
docs_info: task.docs_info || ''
157+
docs_info: task.docs_info || '',
158+
docs_link: task.docs_link,
159+
install_instructions: task.install_instructions
158160
};
159161
}
160162

0 commit comments

Comments
 (0)