Skip to content

Commit 7447294

Browse files
authored
Create and edit responsive improvements (#2457)
* Merge className prop in href in Button component * Update action buttons on schedule form * Update action buttons on nexus forms * Update action buttons on start workflow form
1 parent 7c14110 commit 7447294

File tree

5 files changed

+50
-30
lines changed

5 files changed

+50
-30
lines changed

src/lib/components/schedule/schedule-form-view.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
onDestroy(() => ($error = ''));
166166
</script>
167167

168-
<div class="pb-20">
168+
<div class="pb-10">
169169
{#if $loading}
170170
<Loading title={loadingText} />
171171
{:else}
@@ -246,13 +246,13 @@
246246
bind:phase
247247
bind:cronString
248248
>
249-
<div class="mt-8 flex items-center gap-2">
249+
<div class="mt-4 flex flex-row items-center gap-4 max-sm:flex-col">
250250
<Button
251251
disabled={isDisabled(preset) || !writeActionsAreAllowed()}
252252
on:click={() => handleConfirm(preset, schedule)}
253-
>{confirmText}</Button
253+
class="max-sm:w-full">{confirmText}</Button
254254
>
255-
<Button variant="ghost" href={backHref}
255+
<Button variant="ghost" href={backHref} class="max-sm:w-full"
256256
>{translate('common.cancel')}</Button
257257
>
258258
</div>

src/lib/holocene/button.svelte

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@
126126
type="button"
127127
target={target ? '_blank' : null}
128128
rel={target ? 'noreferrer' : null}
129-
class={buttonStyles({
130-
variant,
131-
size,
132-
borderRadiusModifier,
133-
})}
129+
class={merge(
130+
buttonStyles({
131+
variant,
132+
size,
133+
borderRadiusModifier,
134+
}),
135+
className,
136+
)}
134137
on:click|stopPropagation={onLinkClick}
135138
tabindex={href ? null : 0}
136139
{...$$restProps}

src/lib/pages/nexus-create-endpoint.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,18 @@
4040
{callerNamespaceList}
4141
{isCloud}
4242
/>
43-
<div class="flex items-center gap-4">
43+
<div class="flex flex-row items-center gap-4 max-sm:flex-col">
4444
<Button
4545
variant="primary"
4646
on:click={onCreate}
4747
disabled={createDisabled}
48+
class="max-sm:w-full"
4849
{loading}>{translate('nexus.create-endpoint')}</Button
4950
>
50-
<Button variant="ghost" on:click={() => goto(routeForNexus())}
51+
<Button
52+
variant="ghost"
53+
class="max-sm:w-full"
54+
on:click={() => goto(routeForNexus())}
5155
>{translate('common.cancel')}</Button
5256
>
5357
</div>

src/lib/pages/nexus-edit-endpoint.svelte

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,9 @@
3434
</Link>
3535
</div>
3636
<div class="flex flex-col gap-1">
37-
<div class="flex items-center justify-between">
38-
<h1 data-testid="namespace-selector-title">
39-
{endpoint.spec.name}
40-
</h1>
41-
<div class="flex items-center gap-2">
42-
<Button
43-
variant="destructive"
44-
on:click={() => (deleteConfirmationModalOpen = true)}
45-
>{translate('nexus.delete-endpoint')}</Button
46-
>
47-
<Button on:click={onUpdate} {loading}>{translate('common.save')}</Button
48-
>
49-
</div>
50-
</div>
37+
<h1 data-testid="namespace-selector-title">
38+
{endpoint.spec.name}
39+
</h1>
5140
</div>
5241
<NexusForm
5342
{endpoint}
@@ -59,9 +48,30 @@
5948
{isCloud}
6049
nameDisabled
6150
/>
62-
<div class="flex items-center gap-4">
63-
<Button on:click={onUpdate} {loading}>{translate('common.save')}</Button>
51+
<div
52+
class="flex w-full flex-row items-center justify-between gap-4 max-sm:flex-col xl:w-1/2"
53+
>
54+
<div
55+
class="items-centeritems-center flex w-full flex-row gap-4 max-sm:flex-col"
56+
>
57+
<Button class="max-sm:w-full" on:click={onUpdate} {loading}
58+
>{translate('common.save')}</Button
59+
>
60+
<Button
61+
class="max-sm:hidden"
62+
variant="ghost"
63+
on:click={() => goto(routeForNexusEndpoint($page.params.id))}
64+
>{translate('common.cancel')}</Button
65+
>
66+
</div>
67+
<Button
68+
class="max-sm:w-full"
69+
variant="destructive"
70+
on:click={() => (deleteConfirmationModalOpen = true)}
71+
>{translate('common.delete')}</Button
72+
>
6473
<Button
74+
class="w-full sm:hidden"
6575
variant="ghost"
6676
on:click={() => goto(routeForNexusEndpoint($page.params.id))}
6777
>{translate('common.cancel')}</Button

src/lib/pages/start-workflow.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
$: checkTaskQueue(taskQueueParam);
194194
</script>
195195

196-
<div class="flex w-full flex-col items-center pb-24">
196+
<div class="flex w-full flex-col items-center pb-10">
197197
<div class="mb-6 flex w-full items-start">
198198
<Link
199199
href={`${routeForWorkflows({
@@ -295,9 +295,12 @@
295295
</Card>
296296
<AddSearchAttributes bind:attributesToAdd={searchAttributes} />
297297
{/if}
298-
<div class="mt-4 flex w-full justify-between">
298+
<div
299+
class="mt-4 flex w-full flex-row justify-between gap-4 max-sm:flex-col"
300+
>
299301
<Button
300302
variant="ghost"
303+
class="max-sm:w-full"
301304
trailingIcon={viewAdvancedOptions ? 'chevron-up' : 'chevron-down'}
302305
on:click={() => (viewAdvancedOptions = !viewAdvancedOptions)}
303306
>{translate('common.more-options')}</Button
@@ -306,7 +309,7 @@
306309
disabled={!enableStart}
307310
on:click={onWorkflowStart}
308311
data-testid="start-workflow-button"
309-
>{translate('workflows.start-workflow')}</Button
312+
class="max-sm:w-full">{translate('workflows.start-workflow')}</Button
310313
>
311314
</div>
312315
{#if error}

0 commit comments

Comments
 (0)