TSK-827: Rename Process to Pattern (#2740)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2023-03-16 00:25:58 +07:00 committed by GitHub
parent ecbcb42cbb
commit 32f98ee12c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 17 deletions

View File

@ -347,7 +347,11 @@ export async function findContacts (
// Same name persons
const potentialChannels = await client.findAll(contactPlugin.class.Channel, { value: { $in: values } })
const potentialChannels = await client.findAll(
contactPlugin.class.Channel,
{ value: { $in: values } },
{ limit: 1000 }
)
let potentialContactIds = Array.from(new Set(potentialChannels.map((it) => it.attachedTo as Ref<Contact>)).values())
if (potentialContactIds.length === 0) {
@ -356,7 +360,11 @@ export async function findContacts (
const lastName = getLastName(person.name)
// try match using just first/last name
potentialContactIds = (
await client.findAll(contactPlugin.class.Contact, { name: { $like: `${lastName}%${firstName}%` } })
await client.findAll(
contactPlugin.class.Contact,
{ name: { $like: `${lastName}%${firstName}%` } },
{ limit: 100 }
)
).map((it) => it._id)
if (potentialContactIds.length === 0) {
return { contacts: [], channels: [] }
@ -364,7 +372,7 @@ export async function findContacts (
} else if (client.getHierarchy().isDerived(_class, contactPlugin.class.Organization)) {
// try match using just first/last name
potentialContactIds = (
await client.findAll(contactPlugin.class.Contact, { name: { $like: `${person.name}` } })
await client.findAll(contactPlugin.class.Contact, { name: { $like: `${person.name}` } }, { limit: 100 })
).map((it) => it._id)
if (potentialContactIds.length === 0) {
return { contacts: [], channels: [] }

View File

@ -267,13 +267,13 @@
"AddedAsBlocked": "Marked as blocked",
"AddedAsBlocking": "Marked as blocking",
"IssueTemplate": "Process",
"IssueTemplates": "Process",
"NewProcess": "New Process",
"SaveProcess": "Save Process",
"NoIssueTemplate": "No Process",
"TemplateReplace": "You you replace applied process?",
"TemplateReplaceConfirm": "All changes to template values will be lost.",
"IssueTemplate": "Pattern",
"IssueTemplates": "Patterns",
"NewProcess": "New Pattern",
"SaveProcess": "Save Pattern",
"NoIssueTemplate": "No Pattern",
"TemplateReplace": "You you replace applied pattern?",
"TemplateReplaceConfirm": "All changes to task values will be override by template.",
"CurrentWorkDay": "Current Working Day",
"PreviousWorkDay": "Previous Working Day",

View File

@ -267,13 +267,13 @@
"AddedAsBlocked": "Отмечено как заблокировано",
"AddedAsBlocking": "Отмечено как блокирующее",
"IssueTemplate": "Процесс",
"IssueTemplates": "Процессы",
"NewProcess": "Новый процесс",
"SaveProcess": "Сохранить процесс",
"NoIssueTemplate": "Без процесса",
"TemplateReplace": "Вы хотите заменить выбранный процесс?",
"TemplateReplaceConfirm": "Все внесенные изменения в задачу будут потеряны",
"IssueTemplate": "Шаблон",
"IssueTemplates": "Шаблоны",
"NewProcess": "Новый шаблон",
"SaveProcess": "Сохранить шаблон",
"NoIssueTemplate": "Шаблон не задан",
"TemplateReplace": "Вы хотите заменить выбранный шаблон?",
"TemplateReplaceConfirm": "Все внесенные изменения в задачу будут заменены шаблоном",
"CurrentWorkDay": "Текущий Рабочий День",
"PreviousWorkDay": "Предыдущий Рабочий День",