mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
UBER-4532 Fix search in SetParentIssueActionPopup (#4132)
Signed-off-by: Alexander Onnikov <alexander.onnikov@xored.com>
This commit is contained in:
parent
4b28460540
commit
4eb07074d0
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
// Copyright © 2022 Hardcore Engineering Inc.
|
||||
// Copyright © 2022, 2023 Hardcore Engineering Inc.
|
||||
//
|
||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License. You may
|
||||
@ -39,8 +39,8 @@
|
||||
export let width: 'medium' | 'large' | 'full' = 'medium'
|
||||
export let size: 'small' | 'medium' | 'large' = 'large'
|
||||
|
||||
export let searchMode: 'field' | 'fulltext' | 'disabled' = 'field'
|
||||
export let searchField: string = 'name'
|
||||
export let noSearchField: boolean = false
|
||||
export let groupBy = '_class'
|
||||
|
||||
export let create: ObjectCreate | undefined = undefined
|
||||
@ -56,21 +56,23 @@
|
||||
const created: Doc[] = []
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
let noSearchField: boolean = false
|
||||
let search: string = ''
|
||||
let objects: Doc[] = []
|
||||
|
||||
const query = createQuery()
|
||||
|
||||
$: noSearchField = searchMode === 'disabled'
|
||||
$: _idExtra = typeof docQuery?._id === 'object' ? docQuery?._id : {}
|
||||
$: query.query<Doc>(
|
||||
_class,
|
||||
{
|
||||
...(docQuery ?? {}),
|
||||
...(noSearchField
|
||||
? search !== ''
|
||||
...(searchMode !== 'disabled' && search !== ''
|
||||
? searchMode === 'fulltext'
|
||||
? { $search: search }
|
||||
: {}
|
||||
: { [searchField]: { $like: '%' + search + '%' } }),
|
||||
: { [searchField]: { $like: '%' + search + '%' } }
|
||||
: {}),
|
||||
_id: { $nin: ignoreObjects, ..._idExtra }
|
||||
},
|
||||
(result) => {
|
||||
|
@ -35,7 +35,7 @@
|
||||
sort: { modifiedOn: SortingOrder.Descending }
|
||||
}
|
||||
|
||||
async function onClose ({ detail: parentIssue }: CustomEvent<Issue | undefined | null>) {
|
||||
async function onClose ({ detail: parentIssue }: CustomEvent<Issue | undefined | null>): Promise<void> {
|
||||
const vv = Array.isArray(value) ? value : [value]
|
||||
for (const docValue of vv) {
|
||||
if (
|
||||
@ -93,7 +93,7 @@
|
||||
{ignoreObjects}
|
||||
shadows={true}
|
||||
{width}
|
||||
noSearchField
|
||||
searchMode={'fulltext'}
|
||||
on:update
|
||||
on:close={onClose}
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user