Skip to content

Commit 47a7e45

Browse files
authored
Detail view responsive improvements (#2483)
* Remove unnecessary WorkflowCountStatus component * Improve responsiveness of WorkflowHeader * Improve responsiveness of Schedule details header * Update tests
1 parent ee41527 commit 47a7e45

File tree

6 files changed

+168
-71
lines changed

6 files changed

+168
-71
lines changed

src/lib/components/workflow/workflow-count-status.svelte

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/lib/components/workflow/workflow-counts.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import { getExponentialBackoffSeconds } from '$lib/utilities/refresh-rate';
2525
import { updateQueryParameters } from '$lib/utilities/update-query-parameters';
2626
27-
import WorkflowCountStatus from './workflow-count-status.svelte';
27+
import WorkflowCountStatus from '../workflow-status.svelte';
2828
2929
export let staticQuery = '';
3030
$: namespace = $page.params.namespace;
@@ -167,6 +167,7 @@
167167
newCount={newStatusGroups.find((g) => g.status === status)
168168
? newStatusGroups.find((g) => g.status === status).count - count
169169
: 0}
170+
test-id="workflow-status-{status}"
170171
/>
171172
</button>
172173
{:else}

src/lib/layouts/workflow-header.svelte

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,42 @@
9999
</div>
100100
<header class="flex flex-col gap-2">
101101
<div class="flex flex-col items-center justify-between gap-4 lg:flex-row">
102-
<div class="flex flex-col items-center gap-4 lg:flex-row">
103-
<WorkflowStatus status={workflow?.status} big />
102+
<div
103+
class="flex w-full flex-col items-start gap-4 lg:flex-row lg:items-center"
104+
>
105+
<div
106+
class="flex flex-wrap items-center justify-between gap-4 max-lg:w-full"
107+
>
108+
<WorkflowStatus status={workflow?.status} big />
109+
<div class="lg:hidden">
110+
<WorkflowActions
111+
{isRunning}
112+
{cancelInProgress}
113+
{workflow}
114+
{namespace}
115+
/>
116+
</div>
117+
</div>
104118
<div class="flex flex-col flex-wrap gap-0">
105-
<h1 data-testid="workflow-id-heading" class="gap-0 overflow-hidden">
119+
<h1
120+
data-testid="workflow-id-heading"
121+
class="gap-0 overflow-hidden max-sm:text-xl sm:max-md:text-2xl"
122+
>
106123
<Copyable
107124
copyIconTitle={translate('common.copy-icon-title')}
108125
copySuccessIconTitle={translate('common.copy-success-icon-title')}
109126
content={workflow?.id}
110127
clickAllToCopy
111128
container-class="w-full"
112-
class="overflow-hidden text-ellipsis"
129+
class="overflow-hidden text-ellipsis text-left"
113130
/>
114131
</h1>
115132
{#if workflowUsesVersioning}
116133
<WorkflowVersioningHeader {workflow} />
117134
{/if}
118135
</div>
119136
</div>
120-
<div class="px-2">
137+
<div class="max-lg:hidden">
121138
<WorkflowActions {isRunning} {cancelInProgress} {workflow} {namespace} />
122139
</div>
123140
</div>

src/lib/pages/schedule-view.svelte

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
{#if $loading}
267267
<Loading title={translate('schedules.deleting')} class="my-2" />
268268
{:else}
269-
<header class="mb-8 flex flex-row justify-between gap-4">
269+
<header class="mb-8 flex flex-row flex-wrap justify-between gap-4">
270270
<div class="relative flex flex-col gap-4">
271271
<Link href={routeForSchedules({ namespace })} icon="chevron-left">
272272
{translate('schedules.back-to-schedules')}
@@ -276,23 +276,21 @@
276276
{scheduleId}
277277
</span>
278278
</h1>
279-
<div class="flex items-center gap-2 text-lg">
279+
<div class="flex flex-wrap items-center gap-2 text-lg">
280280
<WorkflowStatus
281281
status={schedule?.schedule.state.paused ? 'Paused' : 'Running'}
282282
/>
283283
<p>
284284
{schedule?.schedule?.action?.startWorkflow?.workflowType?.name}
285285
</p>
286286
</div>
287-
<div class="flex items-center gap-2 text-sm">
288-
<p>
289-
{translate('common.created', {
290-
created: formatDate(schedule?.info?.createTime, $timeFormat, {
291-
relative: $relativeTime,
292-
}),
293-
})}
294-
</p>
295-
</div>
287+
<p class="flex items-center gap-2 text-sm">
288+
{translate('common.created', {
289+
created: formatDate(schedule?.info?.createTime, $timeFormat, {
290+
relative: $relativeTime,
291+
}),
292+
})}
293+
</p>
296294
{#if schedule?.info?.updateTime}
297295
<div class="flex items-center gap-2 text-sm">
298296
<p>

tests/integration/disable-write-actions.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ test.describe('Enable write actions by default', () => {
1414
});
1515

1616
test('Cancel workflow button enabled', async ({ page }) => {
17-
const workflowActionButton = page.locator(
18-
'#workflow-actions-primary-button',
19-
);
17+
const workflowActionButton = page
18+
.locator('#workflow-actions-primary-button')
19+
.locator('visible=true');
2020
await expect(workflowActionButton).toBeEnabled();
2121
});
2222
});
@@ -29,9 +29,9 @@ test.describe('Disable write actions on workflow actions', () => {
2929
});
3030

3131
test('Cancel workflow button disabled', async ({ page }) => {
32-
const workflowActionButton = page.locator(
33-
'#workflow-actions-primary-button',
34-
);
32+
const workflowActionButton = page
33+
.locator('#workflow-actions-primary-button')
34+
.locator('visible=true');
3535
await expect(workflowActionButton).toBeDisabled();
3636
});
3737
});

0 commit comments

Comments
 (0)