mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-26 13:47:26 +03:00
Tracker: issues search (#2129)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
parent
075e1678df
commit
14de8334ba
@ -34,7 +34,7 @@
|
||||
})
|
||||
</script>
|
||||
|
||||
<div class="ac-header divide full">
|
||||
<div class="ac-header full">
|
||||
{#if space}
|
||||
<div class="ac-header__wrap-description">
|
||||
<div class="ac-header__wrap-title" on:click>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { Icon, TabList } from '@anticrm/ui'
|
||||
import { Icon, TabList, SearchEdit } from '@anticrm/ui'
|
||||
import { Viewlet } from '@anticrm/view'
|
||||
import { FilterButton, setActiveViewletId } from '@anticrm/view-resources'
|
||||
import tracker from '../../plugin'
|
||||
@ -9,6 +9,7 @@
|
||||
export let viewlet: WithLookup<Viewlet> | undefined
|
||||
export let viewlets: WithLookup<Viewlet>[] = []
|
||||
export let label: string
|
||||
export let search: string
|
||||
|
||||
$: viewslist = viewlets.map((views) => {
|
||||
return {
|
||||
@ -25,6 +26,7 @@
|
||||
<span class="ac-header__title">{label}</span>
|
||||
<div class="ml-4"><FilterButton _class={tracker.class.Issue} /></div>
|
||||
</div>
|
||||
<SearchEdit bind:value={search} on:change={() => {}} />
|
||||
{#if viewlets.length > 1}
|
||||
<TabList
|
||||
items={viewslist}
|
||||
|
@ -19,7 +19,14 @@
|
||||
export let panelWidth: number = 0
|
||||
|
||||
let viewlet: WithLookup<Viewlet> | undefined = undefined
|
||||
let resultQuery: DocumentQuery<Issue> = {}
|
||||
let search = ''
|
||||
let searchQuery: DocumentQuery<Issue> = { ...query }
|
||||
function updateSearchQuery (search: string): void {
|
||||
searchQuery = search === '' ? { ...query } : { ...query, $search: search }
|
||||
}
|
||||
$: updateSearchQuery(search)
|
||||
$: if (query) updateSearchQuery(search)
|
||||
let resultQuery: DocumentQuery<Issue> = { ...searchQuery }
|
||||
|
||||
const client = getClient()
|
||||
|
||||
@ -63,7 +70,7 @@
|
||||
</script>
|
||||
|
||||
{#if currentSpace}
|
||||
<IssuesHeader {viewlets} {label} bind:viewlet>
|
||||
<IssuesHeader {viewlets} {label} bind:viewlet bind:search>
|
||||
<svelte:fragment slot="extra">
|
||||
{#if asideFloat && $$slots.aside}
|
||||
<Button
|
||||
@ -78,7 +85,7 @@
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</IssuesHeader>
|
||||
<FilterBar _class={tracker.class.Issue} {query} on:change={(e) => (resultQuery = e.detail)} />
|
||||
<FilterBar _class={tracker.class.Issue} query={searchQuery} on:change={(e) => (resultQuery = e.detail)} />
|
||||
<div class="flex w-full h-full clear-mins">
|
||||
{#if viewlet}
|
||||
<IssuesContent {currentSpace} {viewlet} query={resultQuery} />
|
||||
|
Loading…
Reference in New Issue
Block a user