Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-05-23 17:11:55 +06:00 committed by GitHub
parent e4b7575147
commit 57566f30e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 26 deletions

View File

@ -50,7 +50,6 @@
FilterTypePopup,
{
_class,
query,
target,
index: ++maxIndex,
onChange
@ -124,7 +123,6 @@
{#each filters as filter, i}
<FilterSection
{_class}
{query}
{filter}
on:change={() => {
makeQuery(query, filters)

View File

@ -13,14 +13,13 @@
// limitations under the License.
-->
<script lang="ts">
import { Class, Doc, DocumentQuery, Ref } from '@anticrm/core'
import { Class, Doc, Ref } from '@anticrm/core'
import { Button, eventToHTMLElement, IconClose, showPopup } from '@anticrm/ui'
import { Filter } from '@anticrm/view'
import { createEventDispatcher } from 'svelte'
import view from '../../plugin'
export let _class: Ref<Class<Doc>>
export let query: DocumentQuery<Doc>
export let filter: Filter
let current = 0
@ -56,7 +55,6 @@
filter.key.component,
{
_class,
query,
filter,
onChange
},

View File

@ -13,17 +13,7 @@
// limitations under the License.
-->
<script lang="ts">
import core, {
AnyAttribute,
ArrOf,
AttachedDoc,
Class,
Collection,
Doc,
DocumentQuery,
Ref,
Type
} from '@anticrm/core'
import core, { AnyAttribute, ArrOf, AttachedDoc, Class, Collection, Doc, Ref, Type } from '@anticrm/core'
import { getClient } from '@anticrm/presentation'
import { Icon, Label, showPopup } from '@anticrm/ui'
import { Filter, KeyFilter } from '@anticrm/view'
@ -31,7 +21,6 @@
import view from '../../plugin'
export let _class: Ref<Class<Doc>>
export let query: DocumentQuery<Doc>
export let target: HTMLElement
export let index: number
export let onChange: (e: Filter) => void
@ -121,7 +110,6 @@
type.component,
{
_class,
query,
filter: {
key: type,
value: [],

View File

@ -13,7 +13,7 @@
// limitations under the License.
-->
<script lang="ts">
import { Class, Doc, DocumentQuery, FindResult, getObjectValue, Ref, RefTo, SortingOrder } from '@anticrm/core'
import { Class, Doc, FindResult, getObjectValue, Ref, RefTo, SortingOrder } from '@anticrm/core'
import { translate } from '@anticrm/platform'
import presentation, { getClient } from '@anticrm/presentation'
import ui, { Button, CheckBox, Label, Loading } from '@anticrm/ui'
@ -24,7 +24,6 @@
import { createEventDispatcher } from 'svelte'
export let _class: Ref<Class<Doc>>
export let query: DocumentQuery<Doc>
export let filter: Filter
export let onChange: (e: Filter) => void
@ -67,7 +66,7 @@
await objectsPromise
}
targets.clear()
const baseObjects = await client.findAll(_class, query, { projection: { [filter.key.key]: 1 } })
const baseObjects = await client.findAll(_class, {}, { projection: { [filter.key.key]: 1 } })
for (const object of baseObjects) {
const value = getObjectValue(filter.key.key, object) ?? undefined
targets.set(value, (targets.get(value) ?? 0) + 1)

View File

@ -13,7 +13,7 @@
// limitations under the License.
-->
<script lang="ts">
import { Class, Doc, DocumentQuery, FindResult, getObjectValue, Ref, SortingOrder } from '@anticrm/core'
import { Class, Doc, FindResult, getObjectValue, Ref, SortingOrder } from '@anticrm/core'
import { translate } from '@anticrm/platform'
import presentation, { getClient } from '@anticrm/presentation'
import ui, { Button, CheckBox, Label, Loading } from '@anticrm/ui'
@ -24,7 +24,6 @@
import { createEventDispatcher } from 'svelte'
export let _class: Ref<Class<Doc>>
export let query: DocumentQuery<Doc>
export let filter: Filter
export let onChange: (e: Filter) => void
@ -71,10 +70,9 @@
const resultQuery =
search !== ''
? {
[filter.key.key]: { $like: '%' + search + '%' },
...query
[filter.key.key]: { $like: '%' + search + '%' }
}
: query
: {}
let prefix = ''
const attr = client.getHierarchy().getAttribute(_class, filter.key.key)