ProviderList: Add a toolbar to replace the dropdown on onboarding page
Bug: https://github.com/happyDomain/happydomain/issues/18
This commit is contained in:
parent
ecfb23e7bd
commit
3b2ff180b2
|
@ -49,7 +49,9 @@
|
|||
{#if $providers && $providers.length}
|
||||
<ProviderList
|
||||
items={$providers}
|
||||
noDropdown
|
||||
noLabel
|
||||
toolbar
|
||||
style="max-height: 20rem; overflow-y: auto"
|
||||
on:click={(event) => goto(`/providers/${event.detail._id}/domains`)}
|
||||
on:new-provider={() => goto(`/providers/new`)}
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Dropdown,
|
||||
DropdownItem,
|
||||
DropdownMenu,
|
||||
|
@ -27,6 +29,7 @@
|
|||
export let noDropdown = false;
|
||||
export let selectedProvider: Provider|null = null;
|
||||
export let items: Array<any>;
|
||||
export let toolbar = false;
|
||||
|
||||
if (!$providersSpecs) refreshProvidersSpecs();
|
||||
|
||||
|
@ -103,7 +106,7 @@
|
|||
<em>{$t('provider.no-name')}</em>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !(noLabel && noDropdown)}
|
||||
{#if !(noLabel && noDropdown && !toolbar)}
|
||||
<div class="d-flex">
|
||||
{#if !noLabel}
|
||||
<div>
|
||||
|
@ -124,6 +127,24 @@
|
|||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{#if toolbar}
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
color="light"
|
||||
size="sm"
|
||||
on:click={(e) => updateProvider(e, item)}
|
||||
>
|
||||
<Icon name="pencil" />
|
||||
</Button>
|
||||
<Button
|
||||
color="light"
|
||||
size="sm"
|
||||
on:click={(e) => delProvider(e, item)}
|
||||
>
|
||||
<Icon name="trash" />
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
{/if}
|
||||
{#if !noDropdown}
|
||||
<Dropdown
|
||||
size="sm"
|
||||
|
|
Loading…
Reference in New Issue