Files
windmill/frontend/src/lib/components/flows/content/FlowInputsFlowQuick.svelte
Guilhem 7c36e554d7 feat(frontend): add quick access menu in flow editor (#4415)
* (frontend) add quick access menu in flow editor

* (frontend) add quick access menu in flow editor

* improve UI

* make design prettier

* add scroll effects

* improve loading preview

* change no items found

* prevent scroll using menu

* change user folder button

* set default integration icon

* reduce column width

* ajust font

* add defaults script button

* add shadow divider

* fix scroll

* add chevron

* Change toogle bar

* Add preprocessor menu

* add handler

* simplify scroll

* fix display

* fix minor issues

* delete useless log

* revert node tree changes

* merge main

* fix z-index issues

* iterate

* fix: improve allowed domains setting for sso

* chore(main): release 1.402.3 (#4458)

* chore(main): release 1.402.3

* Apply automatic changes

---------

Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>

* improve allowed domains change handling

* send stats when renewing key if last >24h (#4430)

* feat: send stats when renewing key if last >24h

* nits

* fix: sqlx

* nit

* renewal reason

* stats reason

* update ee ref

* Update ee-repo-ref.txt

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>

* fix: skip one migration to avoid using md5 for azure support

* all

* all

* Apply automatic changes

* all

* done?

* nit

* nit

* nit

* nit

* nit noAi if prefilter is not all

* fix shadow

* fix error handler

* fix error handler

* Polishing default script settings

* all

* all

* full

* all

* add deno_core as features

* all

* remove warnings

* all

* npm check

* npm check

* new script script

* nits

* nits item 0

* nits item 0

---------

Co-authored-by: Guilhem Le Mouel <guilhem.le-mouel.ext@altran.com>
Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
Co-authored-by: rubenfiszel <rubenfiszel@users.noreply.github.com>
Co-authored-by: HugoCasa <hugo@casademont.ch>
Co-authored-by: Guilhem <guilhem@mbp-de-windmill.home>
2024-10-03 14:15:01 +02:00

74 lines
2.2 KiB
Svelte

<script lang="ts">
import { Skeleton } from '$lib/components/common'
import SearchItems from '$lib/components/SearchItems.svelte'
import { FlowService, type Flow } from '$lib/gen'
import { workspaceStore } from '$lib/stores'
import { emptyString } from '$lib/utils'
import BarsStaggered from '$lib/components/icons/BarsStaggered.svelte'
import { createEventDispatcher } from 'svelte'
// export let failureModule: boolean
const dispatch = createEventDispatcher()
let items: Flow[] | undefined = undefined
let filteredItems: (Flow & { marked?: string })[] | undefined = undefined
export let filter = ''
$: $workspaceStore && loadFlows()
let ownerFilter: string | undefined = undefined
$: prefilteredItems = ownerFilter ? items?.filter((x) => x.path.startsWith(ownerFilter!)) : items
export let owners: string[] = []
$: owners = Array.from(
new Set(filteredItems?.map((x) => x.path.split('/').slice(0, 2).join('/')) ?? [])
).sort()
async function loadFlows() {
items = await FlowService.listFlows({ workspace: $workspaceStore! })
}
</script>
<SearchItems
{filter}
items={prefilteredItems}
bind:filteredItems
f={(x) => (emptyString(x.summary) ? x.path : x.summary + ' (' + x.path + ')')}
/>
<div class="flex flex-col min-h-0">
{#if filteredItems}
{#if filter.length > 0 && filteredItems.length == 0}
<div class="text-2xs text-tercary font-extralight text-center py-2 px-3 items-center">
No items found.
</div>
{/if}
<ul class="overflow-auto">
{#each filteredItems as { path, summary, marked }}
<li class="flex flex-row w-full">
<button
class="px-3 py-2 gap-2 flex flex-row w-full hover:bg-surface-hover bg-surface transition-all items-center rounded-md text-left text-2xs text-primary font-normal"
on:click={async () => {
dispatch('pickFlow', {
path,
summary
})
}}
>
<BarsStaggered size={14} />
<span class="grow truncate">
{#if marked}
{@html marked}
{:else}
{!summary || summary.length == 0 ? path : summary}
{/if}
</span>
</button>
</li>
{/each}
</ul>
{:else}
{#each Array(10).fill(0) as _}
<Skeleton layout={[0.5, [1.5]]} />
{/each}
{/if}
</div>