Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracker: issues search #2129

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/board-resources/src/components/BoardHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 {
Expand All @@ -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}
Expand Down
13 changes: 10 additions & 3 deletions plugins/tracker-resources/src/components/issues/IssuesView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand All @@ -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} />
Expand Down