mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-29 13:05:08 +02:00
UBERF-4195: fix query after applying viewOptions (#3942)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Class, Doc, DocumentQuery, Ref, Space, WithLookup } from '@hcengineering/core'
|
||||
import { Class, Doc, DocumentQuery, mergeQueries, Ref, Space, WithLookup } from '@hcengineering/core'
|
||||
import { IntlString, getEmbeddedLabel } from '@hcengineering/platform'
|
||||
import { createQuery } from '@hcengineering/presentation'
|
||||
import { Project, ProjectType, ProjectTypeCategory } from '@hcengineering/task'
|
||||
@@ -65,7 +65,7 @@
|
||||
$: spacesQ.query(task.class.Project, { type: mode as Ref<ProjectType> }, (result) => {
|
||||
spaces = result
|
||||
})
|
||||
|
||||
let resultQuery: DocumentQuery<Doc>
|
||||
$: query = { ...(baseQuery ?? {}), ...(viewlet?.baseQuery ?? {}), space: { $in: spaces.map((it) => it._id) } }
|
||||
$: searchQuery = search === '' ? query : { ...query, $search: search }
|
||||
$: resultQuery = searchQuery
|
||||
@@ -154,7 +154,7 @@
|
||||
query={searchQuery}
|
||||
{viewOptions}
|
||||
on:change={(e) => {
|
||||
resultQuery = { ...query, ...e.detail }
|
||||
resultQuery = mergeQueries(query, e.detail)
|
||||
}}
|
||||
/>
|
||||
<Component
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
DocumentUpdate,
|
||||
FindOptions,
|
||||
generateId,
|
||||
mergeQueries,
|
||||
Ref
|
||||
} from '@hcengineering/core'
|
||||
import { Item, Kanban as KanbanUI } from '@hcengineering/kanban'
|
||||
@@ -87,7 +88,7 @@
|
||||
}
|
||||
|
||||
let resultQuery: DocumentQuery<any> = { ...query }
|
||||
$: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => (resultQuery = { ...p, ...query }))
|
||||
$: getResultQuery(query, viewOptionsConfig, viewOptions).then((p) => (resultQuery = mergeQueries(p, query)))
|
||||
|
||||
const client = getClient()
|
||||
const hierarchy = client.getHierarchy()
|
||||
|
||||
Reference in New Issue
Block a user