Skip to content

Commit

Permalink
Create and edit responsive improvements (#2457)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
laurakwhit authored Dec 5, 2024
1 parent 7c14110 commit 7447294
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/schedule/schedule-form-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
onDestroy(() => ($error = ''));
</script>

<div class="pb-20">
<div class="pb-10">
{#if $loading}
<Loading title={loadingText} />
{:else}
Expand Down Expand Up @@ -246,13 +246,13 @@
bind:phase
bind:cronString
>
<div class="mt-8 flex items-center gap-2">
<div class="mt-4 flex flex-row items-center gap-4 max-sm:flex-col">
<Button
disabled={isDisabled(preset) || !writeActionsAreAllowed()}
on:click={() => handleConfirm(preset, schedule)}
>{confirmText}</Button
class="max-sm:w-full">{confirmText}</Button
>
<Button variant="ghost" href={backHref}
<Button variant="ghost" href={backHref} class="max-sm:w-full"
>{translate('common.cancel')}</Button
>
</div>
Expand Down
13 changes: 8 additions & 5 deletions src/lib/holocene/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@
type="button"
target={target ? '_blank' : null}
rel={target ? 'noreferrer' : null}
class={buttonStyles({
variant,
size,
borderRadiusModifier,
})}
class={merge(
buttonStyles({
variant,
size,
borderRadiusModifier,
}),
className,
)}
on:click|stopPropagation={onLinkClick}
tabindex={href ? null : 0}
{...$$restProps}
Expand Down
8 changes: 6 additions & 2 deletions src/lib/pages/nexus-create-endpoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,18 @@
{callerNamespaceList}
{isCloud}
/>
<div class="flex items-center gap-4">
<div class="flex flex-row items-center gap-4 max-sm:flex-col">
<Button
variant="primary"
on:click={onCreate}
disabled={createDisabled}
class="max-sm:w-full"
{loading}>{translate('nexus.create-endpoint')}</Button
>
<Button variant="ghost" on:click={() => goto(routeForNexus())}
<Button
variant="ghost"
class="max-sm:w-full"
on:click={() => goto(routeForNexus())}
>{translate('common.cancel')}</Button
>
</div>
Expand Down
42 changes: 26 additions & 16 deletions src/lib/pages/nexus-edit-endpoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,9 @@
</Link>
</div>
<div class="flex flex-col gap-1">
<div class="flex items-center justify-between">
<h1 data-testid="namespace-selector-title">
{endpoint.spec.name}
</h1>
<div class="flex items-center gap-2">
<Button
variant="destructive"
on:click={() => (deleteConfirmationModalOpen = true)}
>{translate('nexus.delete-endpoint')}</Button
>
<Button on:click={onUpdate} {loading}>{translate('common.save')}</Button
>
</div>
</div>
<h1 data-testid="namespace-selector-title">
{endpoint.spec.name}
</h1>
</div>
<NexusForm
{endpoint}
Expand All @@ -59,9 +48,30 @@
{isCloud}
nameDisabled
/>
<div class="flex items-center gap-4">
<Button on:click={onUpdate} {loading}>{translate('common.save')}</Button>
<div
class="flex w-full flex-row items-center justify-between gap-4 max-sm:flex-col xl:w-1/2"
>
<div
class="items-centeritems-center flex w-full flex-row gap-4 max-sm:flex-col"
>
<Button class="max-sm:w-full" on:click={onUpdate} {loading}
>{translate('common.save')}</Button
>
<Button
class="max-sm:hidden"
variant="ghost"
on:click={() => goto(routeForNexusEndpoint($page.params.id))}
>{translate('common.cancel')}</Button
>
</div>
<Button
class="max-sm:w-full"
variant="destructive"
on:click={() => (deleteConfirmationModalOpen = true)}
>{translate('common.delete')}</Button
>
<Button
class="w-full sm:hidden"
variant="ghost"
on:click={() => goto(routeForNexusEndpoint($page.params.id))}
>{translate('common.cancel')}</Button
Expand Down
9 changes: 6 additions & 3 deletions src/lib/pages/start-workflow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
$: checkTaskQueue(taskQueueParam);
</script>

<div class="flex w-full flex-col items-center pb-24">
<div class="flex w-full flex-col items-center pb-10">
<div class="mb-6 flex w-full items-start">
<Link
href={`${routeForWorkflows({
Expand Down Expand Up @@ -295,9 +295,12 @@
</Card>
<AddSearchAttributes bind:attributesToAdd={searchAttributes} />
{/if}
<div class="mt-4 flex w-full justify-between">
<div
class="mt-4 flex w-full flex-row justify-between gap-4 max-sm:flex-col"
>
<Button
variant="ghost"
class="max-sm:w-full"
trailingIcon={viewAdvancedOptions ? 'chevron-up' : 'chevron-down'}
on:click={() => (viewAdvancedOptions = !viewAdvancedOptions)}
>{translate('common.more-options')}</Button
Expand All @@ -306,7 +309,7 @@
disabled={!enableStart}
on:click={onWorkflowStart}
data-testid="start-workflow-button"
>{translate('workflows.start-workflow')}</Button
class="max-sm:w-full">{translate('workflows.start-workflow')}</Button
>
</div>
{#if error}
Expand Down

0 comments on commit 7447294

Please sign in to comment.