mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-17 18:05:42 +02:00
Add AllMatchValue function and related updates across multiple files (#10990)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
@@ -185,6 +185,19 @@ export function defineFunctions (builder: Builder): void {
|
|||||||
process.function.All
|
process.function.All
|
||||||
)
|
)
|
||||||
|
|
||||||
|
builder.createDoc(
|
||||||
|
process.class.ProcessFunction,
|
||||||
|
core.space.Model,
|
||||||
|
{
|
||||||
|
of: core.class.ArrOf,
|
||||||
|
category: 'array',
|
||||||
|
label: process.string.AllMatchValue,
|
||||||
|
type: 'reduce',
|
||||||
|
editor: process.transformEditor.FilterEditor
|
||||||
|
},
|
||||||
|
process.function.AllMatchValue
|
||||||
|
)
|
||||||
|
|
||||||
builder.createDoc(
|
builder.createDoc(
|
||||||
process.class.ProcessFunction,
|
process.class.ProcessFunction,
|
||||||
core.space.Model,
|
core.space.Model,
|
||||||
|
|||||||
@@ -388,6 +388,10 @@ export function createModel (builder: Builder): void {
|
|||||||
func: serverProcess.transform.FirstMatchValue
|
func: serverProcess.transform.FirstMatchValue
|
||||||
})
|
})
|
||||||
|
|
||||||
|
builder.mixin(process.function.AllMatchValue, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, {
|
||||||
|
func: serverProcess.transform.AllMatchValue
|
||||||
|
})
|
||||||
|
|
||||||
builder.mixin(process.function.Filter, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, {
|
builder.mixin(process.function.Filter, process.class.ProcessFunction, serverProcess.mixin.FuncImpl, {
|
||||||
func: serverProcess.transform.Filter
|
func: serverProcess.transform.Filter
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -117,6 +117,7 @@
|
|||||||
"ExecutionInitiator": "Iniciátor provedení",
|
"ExecutionInitiator": "Iniciátor provedení",
|
||||||
"ExecutionStarted": "Provedení spuštěno",
|
"ExecutionStarted": "Provedení spuštěno",
|
||||||
"Filter": "Filtr",
|
"Filter": "Filtr",
|
||||||
|
"AllMatchValue": "Všechny odpovídající hodnoty",
|
||||||
"FirstMatchValue": "První odpovídající hodnota",
|
"FirstMatchValue": "První odpovídající hodnota",
|
||||||
"ConfigLabel": "Konfigurace procesů",
|
"ConfigLabel": "Konfigurace procesů",
|
||||||
"ConfigDescription": "Definujte procesy pro automatizaci pracovních postupů a obchodních procesů.",
|
"ConfigDescription": "Definujte procesy pro automatizaci pracovních postupů a obchodních procesů.",
|
||||||
@@ -197,4 +198,4 @@
|
|||||||
"TooDeepTransitionRecursion": "Příliš hluboká rekurze přechodů",
|
"TooDeepTransitionRecursion": "Příliš hluboká rekurze přechodů",
|
||||||
"ToDoAlreadyCompleted": "Akční položka již byla dokončena"
|
"ToDoAlreadyCompleted": "Akční položka již byla dokončena"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,6 +117,7 @@
|
|||||||
"ExecutionInitiator": "Ausführungsinitiator",
|
"ExecutionInitiator": "Ausführungsinitiator",
|
||||||
"ExecutionStarted": "Ausführung gestartet",
|
"ExecutionStarted": "Ausführung gestartet",
|
||||||
"Filter": "Filter",
|
"Filter": "Filter",
|
||||||
|
"AllMatchValue": "Alle passenden Werte",
|
||||||
"FirstMatchValue": "Erster passender Wert",
|
"FirstMatchValue": "Erster passender Wert",
|
||||||
"ConfigLabel": "Prozesskonfiguration",
|
"ConfigLabel": "Prozesskonfiguration",
|
||||||
"ConfigDescription": "Definieren Sie Prozesse, um Workflows und Geschäftsprozesse zu automatisieren.",
|
"ConfigDescription": "Definieren Sie Prozesse, um Workflows und Geschäftsprozesse zu automatisieren.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Execution initiator",
|
"ExecutionInitiator": "Execution initiator",
|
||||||
"ExecutionStarted": "Execution started",
|
"ExecutionStarted": "Execution started",
|
||||||
"Filter": "Filter",
|
"Filter": "Filter",
|
||||||
|
"AllMatchValue": "All matching values",
|
||||||
"FirstMatchValue": "First match value",
|
"FirstMatchValue": "First match value",
|
||||||
"ConfigLabel": "Process configuration",
|
"ConfigLabel": "Process configuration",
|
||||||
"ConfigDescription": "Define processes to automate workflows and business processes.",
|
"ConfigDescription": "Define processes to automate workflows and business processes.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Iniciador de Ejecución",
|
"ExecutionInitiator": "Iniciador de Ejecución",
|
||||||
"ExecutionStarted": "Ejecución Iniciada",
|
"ExecutionStarted": "Ejecución Iniciada",
|
||||||
"Filter": "Filtro",
|
"Filter": "Filtro",
|
||||||
|
"AllMatchValue": "Todos los valores coincidentes",
|
||||||
"FirstMatchValue": "Primer valor coincidente",
|
"FirstMatchValue": "Primer valor coincidente",
|
||||||
"ConfigLabel": "Configuración de procesos",
|
"ConfigLabel": "Configuración de procesos",
|
||||||
"ConfigDescription": "Defina procesos para automatizar flujos de trabajo y procesos comerciales.",
|
"ConfigDescription": "Defina procesos para automatizar flujos de trabajo y procesos comerciales.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Initiateur d'exécution",
|
"ExecutionInitiator": "Initiateur d'exécution",
|
||||||
"ExecutionStarted": "Exécution démarrée",
|
"ExecutionStarted": "Exécution démarrée",
|
||||||
"Filter": "Filtrer",
|
"Filter": "Filtrer",
|
||||||
|
"AllMatchValue": "Toutes les valeurs correspondantes",
|
||||||
"FirstMatchValue": "Première valeur correspondante",
|
"FirstMatchValue": "Première valeur correspondante",
|
||||||
"ConfigLabel": "Configuration des processus",
|
"ConfigLabel": "Configuration des processus",
|
||||||
"ConfigDescription": "Définissez des processus pour automatiser les flux de travail et les processus métier.",
|
"ConfigDescription": "Définissez des processus pour automatiser les flux de travail et les processus métier.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Iniziatore dell'esecuzione",
|
"ExecutionInitiator": "Iniziatore dell'esecuzione",
|
||||||
"ExecutionStarted": "Esecuzione avviata",
|
"ExecutionStarted": "Esecuzione avviata",
|
||||||
"Filter": "Filtro",
|
"Filter": "Filtro",
|
||||||
|
"AllMatchValue": "Tutti i valori corrispondenti",
|
||||||
"FirstMatchValue": "Primo valore corrispondente",
|
"FirstMatchValue": "Primo valore corrispondente",
|
||||||
"ConfigLabel": "Configurazione del processo",
|
"ConfigLabel": "Configurazione del processo",
|
||||||
"ConfigDescription": "Definire i processi per automatizzare i flussi di lavoro e i processi aziendali.",
|
"ConfigDescription": "Definire i processi per automatizzare i flussi di lavoro e i processi aziendali.",
|
||||||
|
|||||||
@@ -123,6 +123,7 @@
|
|||||||
"ExecutionInitiator": "実行の発起人",
|
"ExecutionInitiator": "実行の発起人",
|
||||||
"ExecutionStarted": "実行が開始されました",
|
"ExecutionStarted": "実行が開始されました",
|
||||||
"Filter": "フィルター",
|
"Filter": "フィルター",
|
||||||
|
"AllMatchValue": "一致するすべての値",
|
||||||
"FirstMatchValue": "最初の一致する値",
|
"FirstMatchValue": "最初の一致する値",
|
||||||
"ConfigLabel": "プロセス構成",
|
"ConfigLabel": "プロセス構成",
|
||||||
"ConfigDescription": "ワークフローやビジネスプロセスを自動化するためのプロセスを定義します。",
|
"ConfigDescription": "ワークフローやビジネスプロセスを自動化するためのプロセスを定義します。",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "실행 시작자",
|
"ExecutionInitiator": "실행 시작자",
|
||||||
"ExecutionStarted": "실행 시작됨",
|
"ExecutionStarted": "실행 시작됨",
|
||||||
"Filter": "필터",
|
"Filter": "필터",
|
||||||
|
"AllMatchValue": "모든 일치 값",
|
||||||
"FirstMatchValue": "첫 일치 값",
|
"FirstMatchValue": "첫 일치 값",
|
||||||
"ConfigLabel": "프로세스 구성",
|
"ConfigLabel": "프로세스 구성",
|
||||||
"ConfigDescription": "워크플로와 비즈니스 프로세스를 자동화할 프로세스를 정의합니다.",
|
"ConfigDescription": "워크플로와 비즈니스 프로세스를 자동화할 프로세스를 정의합니다.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Inicjator wykonania",
|
"ExecutionInitiator": "Inicjator wykonania",
|
||||||
"ExecutionStarted": "Wykonanie rozpoczęte",
|
"ExecutionStarted": "Wykonanie rozpoczęte",
|
||||||
"Filter": "Filtr",
|
"Filter": "Filtr",
|
||||||
|
"AllMatchValue": "Wszystkie pasujące wartości",
|
||||||
"FirstMatchValue": "Pierwsza pasująca wartość",
|
"FirstMatchValue": "Pierwsza pasująca wartość",
|
||||||
"ConfigLabel": "Konfiguracja procesu",
|
"ConfigLabel": "Konfiguracja procesu",
|
||||||
"ConfigDescription": "Definiuj procesy do automatyzacji organizacji zadań i procesów biznesowych.",
|
"ConfigDescription": "Definiuj procesy do automatyzacji organizacji zadań i procesów biznesowych.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Iniciador de Execução",
|
"ExecutionInitiator": "Iniciador de Execução",
|
||||||
"ExecutionStarted": "Execução Iniciada",
|
"ExecutionStarted": "Execução Iniciada",
|
||||||
"Filter": "Filtrar",
|
"Filter": "Filtrar",
|
||||||
|
"AllMatchValue": "Todos os valores correspondentes",
|
||||||
"FirstMatchValue": "Primeiro Valor Correspondente",
|
"FirstMatchValue": "Primeiro Valor Correspondente",
|
||||||
"ConfigLabel": "Configuração de processos",
|
"ConfigLabel": "Configuração de processos",
|
||||||
"ConfigDescription": "Defina processos para automatizar fluxos de trabalho e processos de negócios.",
|
"ConfigDescription": "Defina processos para automatizar fluxos de trabalho e processos de negócios.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Iniciador de Execução",
|
"ExecutionInitiator": "Iniciador de Execução",
|
||||||
"ExecutionStarted": "Execução Iniciada",
|
"ExecutionStarted": "Execução Iniciada",
|
||||||
"Filter": "Filtrar",
|
"Filter": "Filtrar",
|
||||||
|
"AllMatchValue": "Todos os valores correspondentes",
|
||||||
"FirstMatchValue": "Primeiro Valor Correspondente",
|
"FirstMatchValue": "Primeiro Valor Correspondente",
|
||||||
"ConfigLabel": "Configuração de processos",
|
"ConfigLabel": "Configuração de processos",
|
||||||
"ConfigDescription": "Defina processos para automatizar fluxos de trabalho e processos de negócios.",
|
"ConfigDescription": "Defina processos para automatizar fluxos de trabalho e processos de negócios.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "Инициатор выполнения",
|
"ExecutionInitiator": "Инициатор выполнения",
|
||||||
"ExecutionStarted": "Выполнение начато",
|
"ExecutionStarted": "Выполнение начато",
|
||||||
"Filter": "Фильтр",
|
"Filter": "Фильтр",
|
||||||
|
"AllMatchValue": "Все подходящие значения",
|
||||||
"FirstMatchValue": "Первое подходящее значение",
|
"FirstMatchValue": "Первое подходящее значение",
|
||||||
"ConfigLabel": "Конфигурация процессов",
|
"ConfigLabel": "Конфигурация процессов",
|
||||||
"ConfigDescription": "Определяйте процессы для автоматизации рабочих процессов и бизнес-процессов.",
|
"ConfigDescription": "Определяйте процессы для автоматизации рабочих процессов и бизнес-процессов.",
|
||||||
|
|||||||
@@ -121,6 +121,7 @@
|
|||||||
"ProcessFinished": "\"{process}\" süreci \"{state}\" durumunda tamamlandı",
|
"ProcessFinished": "\"{process}\" süreci \"{state}\" durumunda tamamlandı",
|
||||||
"NewProcessToDo": "Yeni süreç Eylem öğesi",
|
"NewProcessToDo": "Yeni süreç Eylem öğesi",
|
||||||
"Filter": "Filtre",
|
"Filter": "Filtre",
|
||||||
|
"AllMatchValue": "Tüm eşleşen değerler",
|
||||||
"FirstMatchValue": "İlk eşleşen değer",
|
"FirstMatchValue": "İlk eşleşen değer",
|
||||||
"ConfigLabel": "Süreç yapılandırması",
|
"ConfigLabel": "Süreç yapılandırması",
|
||||||
"ConfigDescription": "İş akışlarını ve iş süreçlerini otomatikleştirmek için süreçler tanımlayın.",
|
"ConfigDescription": "İş akışlarını ve iş süreçlerini otomatikleştirmek için süreçler tanımlayın.",
|
||||||
|
|||||||
@@ -124,6 +124,7 @@
|
|||||||
"ExecutionInitiator": "执行发起者",
|
"ExecutionInitiator": "执行发起者",
|
||||||
"ExecutionStarted": "执行已启动",
|
"ExecutionStarted": "执行已启动",
|
||||||
"Filter": "过滤",
|
"Filter": "过滤",
|
||||||
|
"AllMatchValue": "所有匹配值",
|
||||||
"FirstMatchValue": "第一个匹配值",
|
"FirstMatchValue": "第一个匹配值",
|
||||||
"ConfigLabel": "流程配置",
|
"ConfigLabel": "流程配置",
|
||||||
"ConfigDescription": "定义流程以自动化工作流和业务流程。",
|
"ConfigDescription": "定义流程以自动化工作流和业务流程。",
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ export default mergeIds(processId, process, {
|
|||||||
Split: '' as IntlString,
|
Split: '' as IntlString,
|
||||||
Cut: '' as IntlString,
|
Cut: '' as IntlString,
|
||||||
Filter: '' as IntlString,
|
Filter: '' as IntlString,
|
||||||
|
AllMatchValue: '' as IntlString,
|
||||||
FirstMatchValue: '' as IntlString,
|
FirstMatchValue: '' as IntlString,
|
||||||
FirstValue: '' as IntlString,
|
FirstValue: '' as IntlString,
|
||||||
LastValue: '' as IntlString,
|
LastValue: '' as IntlString,
|
||||||
|
|||||||
@@ -353,6 +353,7 @@ export default plugin(processId, {
|
|||||||
OnEvent: '' as Asset
|
OnEvent: '' as Asset
|
||||||
},
|
},
|
||||||
function: {
|
function: {
|
||||||
|
AllMatchValue: '' as Ref<ProcessFunction>,
|
||||||
FirstMatchValue: '' as Ref<ProcessFunction>,
|
FirstMatchValue: '' as Ref<ProcessFunction>,
|
||||||
Filter: '' as Ref<ProcessFunction>,
|
Filter: '' as Ref<ProcessFunction>,
|
||||||
FirstValue: '' as Ref<ProcessFunction>,
|
FirstValue: '' as Ref<ProcessFunction>,
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ import { FieldChangedRollback, ToDoCancellRollback, ToDoCloseRollback } from './
|
|||||||
import {
|
import {
|
||||||
Absolute,
|
Absolute,
|
||||||
Add,
|
Add,
|
||||||
|
AllMatchValue,
|
||||||
All,
|
All,
|
||||||
Append,
|
Append,
|
||||||
Ceil,
|
Ceil,
|
||||||
@@ -819,6 +820,7 @@ export default async () => ({
|
|||||||
EmptyValue,
|
EmptyValue,
|
||||||
ExecutionInitiator,
|
ExecutionInitiator,
|
||||||
ExecutionStarted,
|
ExecutionStarted,
|
||||||
|
AllMatchValue,
|
||||||
FirstMatchValue,
|
FirstMatchValue,
|
||||||
Filter,
|
Filter,
|
||||||
StringFromNumber,
|
StringFromNumber,
|
||||||
|
|||||||
@@ -63,6 +63,26 @@ export async function FirstMatchValue (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function AllMatchValue (
|
||||||
|
value: any[],
|
||||||
|
props: Record<string, any>,
|
||||||
|
control: ProcessControl
|
||||||
|
): Promise<any[] | undefined> {
|
||||||
|
if (value == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!Array.isArray(value)) return value
|
||||||
|
const { _class, ...otherProps } = props
|
||||||
|
if (_class == null) return
|
||||||
|
if (value.length === 0) return
|
||||||
|
if (typeof value[0] === 'string') {
|
||||||
|
const docs = await control.client.findAll(_class, { _id: { $in: value } })
|
||||||
|
return matchQuery(docs, otherProps, core.class.Doc, control.client.getHierarchy(), true).map((p) => p._id)
|
||||||
|
} else if (typeof value[0] === 'object') {
|
||||||
|
return matchQuery(value, otherProps, core.class.Doc, control.client.getHierarchy(), true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region Array
|
// #region Array
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ export default plugin(serverProcessId, {
|
|||||||
EmptyValue: '' as Resource<TransformFunc>,
|
EmptyValue: '' as Resource<TransformFunc>,
|
||||||
EmptyArray: '' as Resource<TransformFunc>,
|
EmptyArray: '' as Resource<TransformFunc>,
|
||||||
Filter: '' as Resource<TransformFunc>,
|
Filter: '' as Resource<TransformFunc>,
|
||||||
|
AllMatchValue: '' as Resource<TransformFunc>,
|
||||||
FirstMatchValue: '' as Resource<TransformFunc>,
|
FirstMatchValue: '' as Resource<TransformFunc>,
|
||||||
ExecutionInitiator: '' as Resource<TransformFunc>,
|
ExecutionInitiator: '' as Resource<TransformFunc>,
|
||||||
ExecutionStarted: '' as Resource<TransformFunc>,
|
ExecutionStarted: '' as Resource<TransformFunc>,
|
||||||
|
|||||||
Reference in New Issue
Block a user