Skip to content

Commit 10c5c7e

Browse files
committed
Minor fixes and improvements
1 parent 816d70a commit 10c5c7e

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed

src/lib/components/v2/admin/UserSettingsImportModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
events: {
7575
afterChange: (selection) => {
76-
if (selection[0].value === 'Select...') {
76+
if (selection.length === 0 || selection[0].value === 'Select...') {
7777
selectedUserId = null;
7878
} else {
7979
selectedUserId = Number(selection[0].value);

src/lib/components/v2/tasks/FilteredTasksTable.svelte

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
let inputTypeFilter = '';
3333
3434
let groupByLabels = {
35-
pkg_name: 'Package Name'
35+
pkg_name: 'Task'
3636
};
3737
3838
$: if (taskGroups) {
@@ -162,6 +162,16 @@
162162
return Object.keys(row.input_types).find((t) => t === inputTypeFilter) !== undefined;
163163
}
164164
165+
function resetFilters() {
166+
genericSearch = '';
167+
categoryFilter = '';
168+
categorySelector?.setSelected('');
169+
modalitySelector?.setSelected('');
170+
packageSelector?.setSelected('');
171+
tagSelector?.setSelected('');
172+
inputTypeSelector?.setSelected('');
173+
}
174+
165175
/**
166176
* @param {import('$lib/types-v2').TaskGroupV2[]} taskGroups
167177
*/
@@ -291,7 +301,7 @@
291301
},
292302
events: {
293303
afterChange: (selection) => {
294-
if (selection[0].value === placeholder) {
304+
if (selection.length === 0 || selection[0].value === placeholder) {
295305
afterChange('');
296306
} else {
297307
afterChange(selection[0].value);
@@ -305,15 +315,24 @@
305315
<div class="card mb-2" class:invisible={allRows.length === 0} class:collapse={allRows.length === 0}>
306316
<div class="card-body">
307317
<div class="row mb-2">
308-
<div class="col">Filter tasks</div>
309-
<div class="col">
310-
<div class="input-group input-group-sm">
311-
<input
312-
type="text"
313-
bind:value={genericSearch}
314-
class="form-control ms-auto"
315-
placeholder="Search..."
316-
/>
318+
<div class="col-3 col-lg-6">Filter tasks</div>
319+
<div class="col-9 col-lg-6">
320+
<div class="d-flex">
321+
<div class="flex-fill">
322+
<div class="input-group input-group-sm">
323+
<input
324+
type="text"
325+
bind:value={genericSearch}
326+
class="form-control ms-auto"
327+
placeholder="Search..."
328+
/>
329+
</div>
330+
</div>
331+
<div>
332+
<button class="btn btn-outline-secondary btn-sm ms-3" on:click={resetFilters}>
333+
Reset
334+
</button>
335+
</div>
317336
</div>
318337
</div>
319338
</div>
@@ -338,7 +357,7 @@
338357
</div>
339358
{#if allRows.length === 0}
340359
<p>
341-
There are no available tasks. You can add new tasks on the
360+
There are no available tasks. You can add new tasks on the
342361
<a href="/v2/tasks/management">Tasks management</a> page.
343362
</p>
344363
{:else}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
let addingTask = false;
2121
2222
/** @type {Array<import('$lib/types-v2').TaskGroupV2>} */
23-
let taskGroups;
23+
let taskGroups = [];
2424
2525
export async function show() {
2626
loading = true;

src/routes/v2/tasks/+page.svelte

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,18 @@
2222
}
2323
</script>
2424

25-
<div class="row mt-2 mb-2">
26-
<div class="col">
27-
Here is the list of currently available tasks. You can add new tasks or edit the current ones at
28-
the <a href="/v2/tasks/management">Tasks management</a> page.
29-
<a href="/v2/tasks/management" class="btn btn-primary float-end">
30-
<i class="bi bi-gear-fill" />
31-
Manage tasks
32-
</a>
25+
{#if taskGroups.length > 0}
26+
<div class="row mt-2 mb-2">
27+
<div class="col">
28+
Here is the list of currently available tasks. You can add new tasks or edit the current ones
29+
at the <a href="/v2/tasks/management">Tasks management</a> page.
30+
<a href="/v2/tasks/management" class="btn btn-primary float-end">
31+
<i class="bi bi-gear-fill" />
32+
Manage tasks
33+
</a>
34+
</div>
3335
</div>
34-
</div>
36+
{/if}
3537

3638
<FilteredTasksTable {taskGroups}>
3739
<svelte:fragment slot="docs-info" let:task>

0 commit comments

Comments
 (0)