Skip to content

Commit e08f5ee

Browse files
Add API PaginatedTable component (#2261)
* Refactor PaginatedTable to include API paginated option * Refactor schedules table to API PaginatedTable * export PaginatedRequest type and adjust styles * Remove unnecessary styles * Update message props and use slot fallback Co-authored-by: Ross Edfort <[email protected]> --------- Co-authored-by: Ross Edfort <[email protected]> Co-authored-by: Ross Edfort <[email protected]>
1 parent 149e011 commit e08f5ee

File tree

10 files changed

+529
-315
lines changed

10 files changed

+529
-315
lines changed

src/lib/components/schedule/schedules-table-row.svelte

+5-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
44
import WorkflowStatus from '$lib/components/workflow-status.svelte';
55
import Link from '$lib/holocene/link.svelte';
6-
import TableRow from '$lib/holocene/table/table-row.svelte';
76
import { translate } from '$lib/i18n/translate';
87
import { relativeTime, timeFormat } from '$lib/stores/time-format';
98
import { formatDate } from '$lib/utilities/format-date';
@@ -43,7 +42,7 @@
4342
});
4443
</script>
4544

46-
<TableRow class="schedule-row">
45+
<tr>
4746
<td class="cell">
4847
<WorkflowStatus status={schedule?.info?.paused ? 'Paused' : 'Running'} />
4948
</td>
@@ -53,7 +52,7 @@
5352
<td class="cell whitespace-pre-line break-words max-md:hidden">
5453
{schedule?.info?.workflowType?.name ?? ''}
5554
</td>
56-
<td class="cell links truncate max-xl:hidden">
55+
<td class="cell truncate">
5756
{#each sortRecentActions(schedule?.info?.recentActions) as run}
5857
<p>
5958
<Link
@@ -69,7 +68,7 @@
6968
</p>
7069
{/each}
7170
</td>
72-
<td class="cell truncate max-xl:hidden">
71+
<td class="cell truncate">
7372
{#each schedule?.info?.futureActionTimes?.slice(0, 5) ?? [] as run}
7473
<div>
7574
{formatDate(run, $timeFormat, {
@@ -79,18 +78,14 @@
7978
</div>
8079
{/each}
8180
</td>
82-
<td class="cell hidden xl:table-cell">
81+
<td class="cell">
8382
<p>{@html translate('common.timezone', { timezone: timezoneName })}</p>
8483
<ScheduleBasicFrequency {calendar} {interval} />
8584
</td>
86-
</TableRow>
85+
</tr>
8786

8887
<style lang="postcss">
8988
.cell {
9089
@apply p-2 text-left;
9190
}
92-
93-
:global(.schedule-spec-row td) {
94-
@apply !border-t-0;
95-
}
9691
</style>

src/lib/components/schedule/schedules-table.svelte

-20
This file was deleted.

src/lib/components/workflow/workflows-summary-configurable-table.svelte

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script lang="ts">
22
import { page } from '$app/stores';
33
4-
import PaginatedTable from '$lib/holocene/table/paginated-table.svelte';
4+
import TableEmptyState from '$lib/components/workflow/workflows-summary-configurable-table/table-empty-state.svelte';
5+
import PaginatedTable from '$lib/holocene/table/paginated-table/paginated.svelte';
56
import { translate } from '$lib/i18n/translate';
67
import { fetchAllChildWorkflows } from '$lib/services/workflow-service';
78
import { showChildWorkflows } from '$lib/stores/filters';
@@ -61,6 +62,7 @@
6162
</script>
6263

6364
<PaginatedTable
65+
aria-label={translate('common.workflows')}
6466
perPageLabel={translate('common.per-page')}
6567
nextPageButtonLabel={translate('common.next-page')}
6668
previousPageButtonLabel={translate('common.previous-page')}
@@ -103,5 +105,9 @@
103105
{/each}
104106
{/if}
105107
{/each}
106-
<slot name="cloud" slot="cloud" />
108+
<svelte:fragment slot="empty" let:updating>
109+
<TableEmptyState {updating}>
110+
<slot name="cloud" slot="cloud" />
111+
</TableEmptyState>
112+
</svelte:fragment>
107113
</PaginatedTable>

src/lib/components/workflow/workflows-summary-configurable-table/table-header-row.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@
6161

6262
<style lang="postcss">
6363
.batch-actions-checkbox-table-cell {
64-
@apply w-10 rounded-tl-lg px-2;
64+
@apply w-10 rounded-tl-lg;
6565
}
6666
6767
.batch-actions-table-cell {
68-
@apply overflow-visible whitespace-nowrap px-2 text-left text-sm font-medium;
68+
@apply overflow-visible whitespace-nowrap text-sm font-medium;
6969
}
7070
7171
.configuration-button-table-cell {
72-
@apply h-10 w-10 px-2 py-1;
72+
@apply h-10 w-10 py-1;
7373
}
7474
</style>

src/lib/components/workflow/workflows-summary-configurable-table/table-row.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
class:child
4848
>
4949
{#if !empty && $supportsBulkActions}
50-
<td class="relative px-2">
50+
<td class="relative">
5151
<Checkbox
5252
{label}
5353
labelHidden

src/lib/holocene/table/paginated-table.svelte

-208
This file was deleted.

0 commit comments

Comments
 (0)