mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-23 20:13:20 +00:00
1835 fix (#1838)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
e4b7575147
commit
57566f30e2
@ -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)
|
||||
|
@ -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
|
||||
},
|
||||
|
@ -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: [],
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user