Skip to content

Commit 041a3f3

Browse files
authored
[DT-231] Ensure all page headings use semantic markup (#1069)
* Update heading levels * Make pending activities details a list * Refactor workers list to use Table component * Add optional title to icons * Update snapshot tests * Change icon title to yes and no
1 parent 3161dd9 commit 041a3f3

File tree

13 files changed

+228
-216
lines changed

13 files changed

+228
-216
lines changed

Diff for: src/lib/components/schedule/schedule-form-view.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<a href={backHref} class="back absolute top-0" style="left: 0">
9999
<Icon name="chevron-left" class="inline" />{backTitle}
100100
</a>
101-
<h2 class="font-base mt-8 ml-0 text-2xl">{title}</h2>
101+
<h1 class="font-base mt-8 ml-0 text-2xl">{title}</h1>
102102
</header>
103103
<form class="mb-4 flex w-full flex-col gap-4 md:w-2/3 xl:w-1/2">
104104
{#if $error}

Diff for: src/lib/components/schedule/schedules-calendar-view.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</script>
3939

4040
<div class="mt-8 w-full">
41-
<h1 class="mb-4 text-2xl">Frequency</h1>
41+
<h2 class="mb-4 text-2xl">Frequency</h2>
4242
<div class="flex flex-wrap gap-6">
4343
{#if schedule}
4444
<Tab

Diff for: src/lib/components/workers-list.svelte

+35-34
Original file line numberDiff line numberDiff line change
@@ -5,57 +5,58 @@
55
import { formatDate } from '$lib/utilities/format-date';
66
77
import EmptyState from '$lib/holocene/empty-state.svelte';
8+
import Table from '$lib/holocene/table/table.svelte';
9+
import TableHeaderRow from '$lib/holocene/table/table-header-row.svelte';
810
import type { GetPollersResponse } from '$lib/services/pollers-service';
911
1012
export let taskQueue: string;
1113
export let workers: GetPollersResponse;
1214
</script>
1315

1416
<section class="flex flex-col gap-4">
15-
<h3 class="text-lg font-medium">
17+
<h2 class="text-lg font-medium">
1618
Task Queue: <span class="select-all font-normal">{taskQueue}</span>
17-
</h3>
18-
<section
19-
class="flex w-full flex-col rounded-lg border-[3px] border-gray-900 bg-white"
20-
>
21-
<div class="flex flex-row bg-gray-900 p-2 text-white">
22-
<div class="w-6/12 text-left">ID</div>
23-
<div class="w-2/12 text-left">Last Accessed</div>
24-
<div class="w-2/12 text-center">Workflow Task Handler</div>
25-
<div class="w-2/12 text-center">Activity Handler</div>
26-
</div>
19+
</h2>
20+
<Table class="mb-6 w-full min-w-[600px] table-fixed">
21+
<TableHeaderRow slot="headers">
22+
<th class="table-cell w-6/12">ID</th>
23+
<th class="table-cell w-2/12">Last Accessed</th>
24+
<th class="table-cell w-2/12">
25+
<p class="text-center">Workflow Task Handler</p>
26+
</th>
27+
<th class="table-cell w-2/12 text-center">
28+
<p class="text-center">Activity Handler</p>
29+
</th>
30+
</TableHeaderRow>
2731
{#each workers?.pollers as poller (poller.identity)}
28-
<div
29-
class="flex h-full w-full flex-row border-b-2 p-2 no-underline last:border-b-0"
30-
data-cy="worker-row"
31-
>
32-
<div class="links w-6/12 text-left" data-cy="worker-identity">
32+
<tr class="table-row w-full" data-cy="worker-row">
33+
<td />
34+
<td class="text-left" data-cy="worker-identity">
3335
<p class="select-all">{poller.identity}</p>
34-
</div>
35-
<div class="links w-2/12 text-left" data-cy="worker-last-access-time">
36-
<h3>
37-
<p class="select-all">
38-
{formatDate(poller.lastAccessTime, $timeFormat)}
39-
</p>
40-
</h3>
41-
</div>
42-
<div class="flex w-2/12 justify-center" data-cy="workflow-poller">
36+
</td>
37+
<td class="text-left" data-cy="worker-last-access-time">
38+
<p class="select-all">
39+
{formatDate(poller.lastAccessTime, $timeFormat)}
40+
</p>
41+
</td>
42+
<td data-cy="workflow-poller">
4343
{#if poller.taskQueueTypes.includes('WORKFLOW')}
44-
<Icon name="checkmark" class="text-blue-700" />
44+
<Icon name="checkmark" class="m-auto text-blue-700" title="yes" />
4545
{:else}
46-
<Icon name="close" class="text-primary" />
46+
<Icon name="close" class="m-auto text-primary" title="no" />
4747
{/if}
48-
</div>
49-
<div class="flex w-2/12 justify-center" data-cy="activity-poller">
48+
</td>
49+
<td data-cy="activity-poller">
5050
{#if poller.taskQueueTypes.includes('ACTIVITY')}
51-
<Icon name="checkmark" class="text-blue-700" />
51+
<Icon name="checkmark" class="m-auto text-blue-700" title="yes" />
5252
{:else}
53-
<Icon name="close" class="text-primary" />
53+
<Icon name="close" class="m-auto text-primary" title="no" />
5454
{/if}
55-
</div>
56-
</div>
55+
</td>
56+
<td />
57+
</tr>
5758
{:else}
5859
<EmptyState title={'No Workers Found'} />
5960
{/each}
60-
</section>
61+
</Table>
6162
</section>

Diff for: src/lib/holocene/__snapshots__/button.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ exports[`Button > default 1`] = `"<button class=\\"button primary undefined svel
44
55
exports[`Button > disabled 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\" disabled=\\"\\"> </button>"`;
66
7-
exports[`Button > icon 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\"><span><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M11.625 16.375C11.7188 16.4688 11.8438 16.5 12 16.5C12.125 16.5 12.25 16.4688 12.3438 16.375L16.8438 11.875C17.0312 11.6875 17.0312 11.3438 16.8438 11.1562C16.6562 10.9688 16.3125 10.9688 16.125 11.1562L12.5 14.8125V5.5C12.5 5.25 12.25 5 12 5C11.7188 5 11.5 5.25 11.5 5.5V14.8125L7.84375 11.1562C7.65625 10.9688 7.3125 10.9688 7.125 11.1562C6.9375 11.3438 6.9375 11.6875 7.125 11.875L11.625 16.375ZM17.5 18H6.5C6.21875 18 6 18.25 6 18.5C6 18.7812 6.21875 19 6.5 19H17.5C17.75 19 18 18.7812 18 18.5C18 18.25 17.75 18 17.5 18Z\\" fill=\\"currentcolor\\"></path></svg></span> </button>"`;
7+
exports[`Button > icon 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\"><span><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><title></title><path d=\\"M11.625 16.375C11.7188 16.4688 11.8438 16.5 12 16.5C12.125 16.5 12.25 16.4688 12.3438 16.375L16.8438 11.875C17.0312 11.6875 17.0312 11.3438 16.8438 11.1562C16.6562 10.9688 16.3125 10.9688 16.125 11.1562L12.5 14.8125V5.5C12.5 5.25 12.25 5 12 5C11.7188 5 11.5 5.25 11.5 5.5V14.8125L7.84375 11.1562C7.65625 10.9688 7.3125 10.9688 7.125 11.1562C6.9375 11.3438 6.9375 11.6875 7.125 11.875L11.625 16.375ZM17.5 18H6.5C6.21875 18 6 18.25 6 18.5C6 18.7812 6.21875 19 6.5 19H17.5C17.75 19 18 18.7812 18 18.5C18 18.25 17.75 18 17.5 18Z\\" fill=\\"currentcolor\\"></path></svg></span> </button>"`;
88
9-
exports[`Button > loading 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\"><span class=\\"animate-spin\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><path d=\\"M7.375 6.40625C6.84375 6.40625 6.375 6.875 6.375 7.40625C6.375 7.96875 6.84375 8.40625 7.375 8.40625C7.9375 8.40625 8.375 7.96875 8.375 7.40625C8.375 6.875 7.9375 6.40625 7.375 6.40625ZM7.375 15.625C6.84375 15.625 6.375 16.0625 6.375 16.625C6.375 17.1562 6.84375 17.625 7.375 17.625C7.9375 17.625 8.375 17.1562 8.375 16.625C8.375 16.0625 7.9375 15.625 7.375 15.625ZM12 17.5C11.4375 17.5 11 17.9688 11 18.5C11 19.0625 11.4375 19.5 12 19.5C12.5312 19.5 13 19.0625 13 18.5C13 17.9688 12.5312 17.5 12 17.5ZM5.5 11C4.9375 11 4.5 11.4688 4.5 12C4.5 12.5625 4.9375 13 5.5 13C6.03125 13 6.5 12.5625 6.5 12C6.5 11.4688 6.03125 11 5.5 11ZM12 4.5C11.4375 4.5 11 4.96875 11 5.5C11 6.0625 11.4375 6.5 12 6.5C12.5312 6.5 13 6.0625 13 5.5C13 4.96875 12.5312 4.5 12 4.5ZM18.5 11C17.9375 11 17.5 11.4688 17.5 12C17.5 12.5625 17.9375 13 18.5 13C19.0312 13 19.5 12.5625 19.5 12C19.5 11.4688 19.0312 11 18.5 11ZM16.5938 15.625C16.0312 15.625 15.5938 16.0625 15.5938 16.625C15.5938 17.1562 16.0312 17.625 16.5938 17.625C17.125 17.625 17.5938 17.1562 17.5938 16.625C17.5938 16.0625 17.125 15.625 16.5938 15.625Z\\" fill=\\"currentcolor\\"></path></svg></span> </button>"`;
9+
exports[`Button > loading 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\"><span class=\\"animate-spin\\"><svg width=\\"24\\" height=\\"24\\" viewBox=\\"0 0 24 24\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\"><title></title><path d=\\"M7.375 6.40625C6.84375 6.40625 6.375 6.875 6.375 7.40625C6.375 7.96875 6.84375 8.40625 7.375 8.40625C7.9375 8.40625 8.375 7.96875 8.375 7.40625C8.375 6.875 7.9375 6.40625 7.375 6.40625ZM7.375 15.625C6.84375 15.625 6.375 16.0625 6.375 16.625C6.375 17.1562 6.84375 17.625 7.375 17.625C7.9375 17.625 8.375 17.1562 8.375 16.625C8.375 16.0625 7.9375 15.625 7.375 15.625ZM12 17.5C11.4375 17.5 11 17.9688 11 18.5C11 19.0625 11.4375 19.5 12 19.5C12.5312 19.5 13 19.0625 13 18.5C13 17.9688 12.5312 17.5 12 17.5ZM5.5 11C4.9375 11 4.5 11.4688 4.5 12C4.5 12.5625 4.9375 13 5.5 13C6.03125 13 6.5 12.5625 6.5 12C6.5 11.4688 6.03125 11 5.5 11ZM12 4.5C11.4375 4.5 11 4.96875 11 5.5C11 6.0625 11.4375 6.5 12 6.5C12.5312 6.5 13 6.0625 13 5.5C13 4.96875 12.5312 4.5 12 4.5ZM18.5 11C17.9375 11 17.5 11.4688 17.5 12C17.5 12.5625 17.9375 13 18.5 13C19.0312 13 19.5 12.5625 19.5 12C19.5 11.4688 19.0312 11 18.5 11ZM16.5938 15.625C16.0312 15.625 15.5938 16.0625 15.5938 16.625C15.5938 17.1562 16.0312 17.625 16.5938 17.625C17.125 17.625 17.5938 17.1562 17.5938 16.625C17.5938 16.0625 17.125 15.625 16.5938 15.625Z\\" fill=\\"currentcolor\\"></path></svg></span> </button>"`;
1010
1111
exports[`Button > secondary 1`] = `"<button class=\\"button primary undefined svelte-n0hmwv\\" type=\\"button\\"> </button>"`;
1212

Diff for: src/lib/holocene/empty-state.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
>
1818
<Icon name={icon} class="block h-full w-full" /></span
1919
>
20-
<h2 class="text-xl font-medium">{title}</h2>
20+
<h3 class="text-xl font-medium">{title}</h3>
2121
{#if content}
2222
<p class="text-center">{content}</p>
2323
{/if}

0 commit comments

Comments
 (0)