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");
|
// 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
|
// 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 width: 'medium' | 'large' | 'full' = 'medium'
|
||||||
export let size: 'small' | 'medium' | 'large' = 'large'
|
export let size: 'small' | 'medium' | 'large' = 'large'
|
||||||
|
|
||||||
|
export let searchMode: 'field' | 'fulltext' | 'disabled' = 'field'
|
||||||
export let searchField: string = 'name'
|
export let searchField: string = 'name'
|
||||||
export let noSearchField: boolean = false
|
|
||||||
export let groupBy = '_class'
|
export let groupBy = '_class'
|
||||||
|
|
||||||
export let create: ObjectCreate | undefined = undefined
|
export let create: ObjectCreate | undefined = undefined
|
||||||
@ -56,21 +56,23 @@
|
|||||||
const created: Doc[] = []
|
const created: Doc[] = []
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
let noSearchField: boolean = false
|
||||||
let search: string = ''
|
let search: string = ''
|
||||||
let objects: Doc[] = []
|
let objects: Doc[] = []
|
||||||
|
|
||||||
const query = createQuery()
|
const query = createQuery()
|
||||||
|
|
||||||
|
$: noSearchField = searchMode === 'disabled'
|
||||||
$: _idExtra = typeof docQuery?._id === 'object' ? docQuery?._id : {}
|
$: _idExtra = typeof docQuery?._id === 'object' ? docQuery?._id : {}
|
||||||
$: query.query<Doc>(
|
$: query.query<Doc>(
|
||||||
_class,
|
_class,
|
||||||
{
|
{
|
||||||
...(docQuery ?? {}),
|
...(docQuery ?? {}),
|
||||||
...(noSearchField
|
...(searchMode !== 'disabled' && search !== ''
|
||||||
? search !== ''
|
? searchMode === 'fulltext'
|
||||||
? { $search: search }
|
? { $search: search }
|
||||||
: {}
|
: { [searchField]: { $like: '%' + search + '%' } }
|
||||||
: { [searchField]: { $like: '%' + search + '%' } }),
|
: {}),
|
||||||
_id: { $nin: ignoreObjects, ..._idExtra }
|
_id: { $nin: ignoreObjects, ..._idExtra }
|
||||||
},
|
},
|
||||||
(result) => {
|
(result) => {
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
sort: { modifiedOn: SortingOrder.Descending }
|
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]
|
const vv = Array.isArray(value) ? value : [value]
|
||||||
for (const docValue of vv) {
|
for (const docValue of vv) {
|
||||||
if (
|
if (
|
||||||
@ -93,7 +93,7 @@
|
|||||||
{ignoreObjects}
|
{ignoreObjects}
|
||||||
shadows={true}
|
shadows={true}
|
||||||
{width}
|
{width}
|
||||||
noSearchField
|
searchMode={'fulltext'}
|
||||||
on:update
|
on:update
|
||||||
on:close={onClose}
|
on:close={onClose}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user