Refactor: plugin-workflow client (#1077)
* feat(plugin-worklfow): adjust ui * refactor(plugin-workflow): move locale into plugin * fix(plugin-workflow): fix executions history loading
This commit is contained in:
parent
83cc19a013
commit
188800c018
@ -186,6 +186,7 @@ export default {
|
||||
"Foreign key 2": "Foreign key 2",
|
||||
"Add filter": "Add filter",
|
||||
"Add filter group": "Add filter group",
|
||||
"Comparision": "Comparision",
|
||||
"is": "is",
|
||||
"is not": "is not",
|
||||
"is variable": "is variable",
|
||||
@ -425,94 +426,6 @@ export default {
|
||||
"Aliyun OSS": "Aliyun OSS",
|
||||
"Tencent COS": "Tencent COS",
|
||||
"Amazon S3": "Amazon S3",
|
||||
"Workflow": "Workflow",
|
||||
"Execution history": "Execution history",
|
||||
"Trigger type": "Trigger type",
|
||||
"Description": "Description",
|
||||
"Status": "Status",
|
||||
"On": "On",
|
||||
"Off": "Off",
|
||||
"Version": "Version",
|
||||
"Copy to new version": "Copy to new version",
|
||||
"Load failed": "Load failed",
|
||||
"Trigger": "Trigger",
|
||||
"Collection event": "Collection event",
|
||||
"Trigger on": "Trigger on",
|
||||
"After record added": "After record added",
|
||||
"After record updated": "After record updated",
|
||||
"After record added or updated": "After record added or updated",
|
||||
"After record deleted": "After record deleted",
|
||||
"Changed fields": "Changed fields",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.",
|
||||
"Only triggers when match conditions": "Only triggers when match conditions",
|
||||
"Schedule event": "Schedule event",
|
||||
"Trigger mode": "Trigger mode",
|
||||
"Based on certain date": "Based on certain date",
|
||||
"Based on date field of collection": "Based on date field of collection",
|
||||
"Starts on": "Starts on",
|
||||
"Ends on": "Ends on",
|
||||
"Exactly at": "Exactly at",
|
||||
"Repeat mode": "Repeat mode",
|
||||
"Repeat limit": "Repeat limit",
|
||||
"No limit": "No limit",
|
||||
"Seconds": "Seconds",
|
||||
"Minutes": "Minutes",
|
||||
"Hours": "Hours",
|
||||
"Days": "Days",
|
||||
"Weeks": "Weeks",
|
||||
"Months": "Months",
|
||||
"No repeat": "No repeat",
|
||||
"Every": "Every",
|
||||
"By minute": "By minute",
|
||||
"By hour": "By hour",
|
||||
"By day": "By day",
|
||||
"By week": "By week",
|
||||
"By month": "By month",
|
||||
"By field": "By field",
|
||||
"By custom date": "By custom date",
|
||||
"Advanced": "Advanced",
|
||||
"Advanced type": "Advanced",
|
||||
"End": "End",
|
||||
"Trigger context": "Trigger context",
|
||||
"Node result": "Node result",
|
||||
"Constant": "Constant",
|
||||
"Boolean": "Boolean",
|
||||
"String": "String",
|
||||
"Comparison": "Comparison",
|
||||
"Arithmetic calculation": "Arithmetic calculation",
|
||||
"String operation": "String operation",
|
||||
"On going": "On going",
|
||||
"Succeeded": "Succeeded",
|
||||
"Failed": "Failed",
|
||||
"Canceled": "Canceled",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "This node contains branches, deleting will also be preformed to them, are you sure?",
|
||||
"Control": "Control",
|
||||
"Collection operations": "Collection operations",
|
||||
"Node type": "Node type",
|
||||
"Calculation": "Calculation",
|
||||
"Configure calculation": "Configure calculation",
|
||||
"Calculation result": "Calculation result",
|
||||
"True": "True",
|
||||
"False": "False",
|
||||
"Condition": "Condition",
|
||||
"Mode": "Mode",
|
||||
"Continue when \"Yes\"": "Continue when \"Yes\"",
|
||||
"Branch into \"Yes\" and \"No\"": "Branch into \"Yes\" and \"No\"",
|
||||
"Conditions": "Conditions",
|
||||
"Parallel branch": "Parallel branch",
|
||||
"All succeeded": "All succeeded",
|
||||
"Any succeeded": "Any succeeded",
|
||||
"Continue after all branches succeeded": "Continue after all branches succeeded",
|
||||
"Continue after any branch succeeded": "Continue after any branch succeeded",
|
||||
"Create record": "Create record",
|
||||
"Update record": "Update record",
|
||||
"Query record": "Query record",
|
||||
"Multiple records": "Multiple records",
|
||||
"Please select collection first": "Please select collection first",
|
||||
"Only update records matching conditions": "Only update records matching conditions",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
|
||||
"Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
|
||||
"Node in executed workflow cannot be modified": "Node in executed workflow cannot be modified",
|
||||
"Unsaved changes": "Unsaved changes",
|
||||
"Are you sure you don't want to save?": "Are you sure you don't want to save?",
|
||||
"Dragging": "Dragging",
|
||||
|
@ -176,6 +176,7 @@ export default {
|
||||
"Foreign key 2": "外部キー2",
|
||||
"Add filter": "フィルターを追加",
|
||||
"Add filter group": "フィルターグループを追加",
|
||||
"Comparision": "比較",
|
||||
"is": "が同じである",
|
||||
"is not": "が同じではない",
|
||||
"is variable": "が変数である",
|
||||
@ -415,94 +416,6 @@ export default {
|
||||
"Aliyun OSS": "Aliyun OSS",
|
||||
"Tencent COS": "Tencent COS",
|
||||
"Amazon S3": "Amazon S3",
|
||||
"Workflow": "ワークフロー",
|
||||
"Execution history": "実行履歴",
|
||||
"Trigger type": "トリガータイプ",
|
||||
"Description": "説明",
|
||||
"Status": "状態",
|
||||
"On": "有効",
|
||||
"Off": "無効",
|
||||
"Version": "バージョン",
|
||||
"Copy to new version": "新しいバージョンにコピー",
|
||||
"Load failed": "読み込みに失敗しました",
|
||||
"Trigger": "トリガー",
|
||||
"Collection event": "コレクションイベント",
|
||||
"Trigger on": "トリガータイミング",
|
||||
"After record added": "レコードを追加した後",
|
||||
"After record updated": "レコードを更新した後",
|
||||
"After record added or updated": "レコードを追加もしくは更新した後",
|
||||
"After record deleted": "レコードを削除した後",
|
||||
"Changed fields": "フィールドが変更された時",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "選択したフィールドの 1 つが変更された場合にのみトリガーされます。 選択されていない場合は、フィールドが変更されたときにトリガーされることを意味します。 レコードが追加または削除されると、すべてのフィールドが変更されたと見なされます。",
|
||||
"Only triggers when match conditions": "以下の条件を満たすと発動",
|
||||
"Schedule event": "スケジュールイベント",
|
||||
"Trigger mode": "トリガーモード",
|
||||
"Based on certain date": "カスタム時間",
|
||||
"Based on date field of collection": "コレクションのフィールド時間に基づく",
|
||||
"Starts on": "開始",
|
||||
"Ends on": "終了",
|
||||
"Exactly at": "ちょうど",
|
||||
"Repeat mode": "繰り返しパターン",
|
||||
"Repeat limit": "繰り返し回数",
|
||||
"No limit": "無制限",
|
||||
"Seconds": "秒",
|
||||
"Minutes": "分",
|
||||
"Hours": "時",
|
||||
"Days": "日",
|
||||
"Weeks": "週",
|
||||
"Months": "月",
|
||||
"No repeat": "繰り返さない",
|
||||
"Every": "毎",
|
||||
"By minute": "分ごと",
|
||||
"By hour": "時間ごと",
|
||||
"By day": "日ごと",
|
||||
"By week": "週ごと",
|
||||
"By month": "月ごと",
|
||||
"By field": "フィールドごと",
|
||||
"By custom date": "カスタム時間",
|
||||
"Advanced": "アドバンスド",
|
||||
"Advanced type": "アドバンスタイプ",
|
||||
"End": "終了",
|
||||
"Trigger context": "トリガーフィールド",
|
||||
"Node result": "ノードの結果",
|
||||
"Constant": "定数",
|
||||
"Boolean": "論理値",
|
||||
"String": "文字列",
|
||||
"Comparison": "比較",
|
||||
"Arithmetic calculation": "算術演算",
|
||||
"String operation": "文字列操作",
|
||||
"On going": "処理中",
|
||||
"Succeeded": "成功",
|
||||
"Failed": "失敗",
|
||||
"Canceled": "取消",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "ノードにはブランチが含まれており、そのすべてのブランチの下にあるすべての子ノードが同時に削除されます。続行してもよろしいですか?",
|
||||
"Control": "プロセス制御",
|
||||
"Collection operations": "フィールド操作",
|
||||
"Node type": "ノードタイプ",
|
||||
"Calculation": "演算",
|
||||
"Configure calculation": "演算設定",
|
||||
"Calculation result": "演算結果",
|
||||
"True": "真",
|
||||
"False": "偽",
|
||||
"Condition": "条件",
|
||||
"Mode": "モデル",
|
||||
"Continue when \"Yes\"": "「はい」の場合に続行",
|
||||
"Branch into \"Yes\" and \"No\"": "「はい」と「いいえ」で分岐して続行",
|
||||
"Conditions": "条件設定",
|
||||
"Parallel branch": "分岐",
|
||||
"All succeeded": "すべて成功",
|
||||
"Any succeeded": "いずれかが成功",
|
||||
"Continue after all branches succeeded": "すべての分岐が成功した後に続行",
|
||||
"Continue after any branch succeeded": "いずれかの分岐が成功した後に続行",
|
||||
"Create record": "レコード追加",
|
||||
"Update record": "レコード更新",
|
||||
"Query record": "クエリ レコード",
|
||||
"Multiple records": "複数レコード",
|
||||
"Please select collection first": "先にコレクションを選択してください",
|
||||
"Only update records matching conditions": "条件を満たすレコードのみ更新",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "値が割り当てられていないフィールドはデフォルト値に設定され、デフォルト値がないフィールドは null に設定されます",
|
||||
"Trigger in executed workflow cannot be modified": "すでにワークフローを実行したトリガーは変更できません",
|
||||
"Node in executed workflow cannot be modified": "すでに実行されたワークフローのノードは変更できません",
|
||||
"Unsaved changes": "変更が保存されていません",
|
||||
"Are you sure you don't want to save?": "変更を保存しなくてもよいですか?",
|
||||
"Dragging": "ドラッグ",
|
||||
|
@ -176,6 +176,7 @@ export default {
|
||||
"Foreign key 2": "Внешний ключ 2",
|
||||
"Add filter": "Добавить фильтр",
|
||||
"Add filter group": "Добавить группу фильтров",
|
||||
"Comparision": "Сравнение",
|
||||
"is": "соответствует",
|
||||
"is not": "не соответствует",
|
||||
"is variable": "это переменная",
|
||||
@ -415,94 +416,6 @@ export default {
|
||||
"Aliyun OSS": "Aliyun OSS",
|
||||
"Tencent COS": "Tencent COS",
|
||||
"Amazon S3": "Amazon S3",
|
||||
"Workflow": "Workflow",
|
||||
"Execution history": "История запусков",
|
||||
"Trigger type": "Тип триггера",
|
||||
"Description": "Описание",
|
||||
"Status": "Статус",
|
||||
"On": "Вкл.",
|
||||
"Off": "Выкл.",
|
||||
"Version": "Версия",
|
||||
"Copy to new version": "Скопировать в новую версию",
|
||||
"Load failed": "Загрузка не удалась",
|
||||
"Trigger": "Триггер",
|
||||
"Collection event": "Событие коллекции",
|
||||
"Trigger on": "Триггер на",
|
||||
"After record added": "После добавления записи",
|
||||
"After record updated": "После обновления записи",
|
||||
"After record added or updated": "После добавления или обновления записи",
|
||||
"After record deleted": "После удаления записи",
|
||||
"Changed fields": "Измененные поля",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Запускается только при изменении одного из выбранных полей. Если флажок не установлен, это означает, что он будет срабатывать при изменении любого поля. При добавлении или удалении записи любое поле считается измененным.",
|
||||
"Only triggers when match conditions": "Срабатывает только при совпадении условий",
|
||||
"Schedule event": "Событие по расписанию",
|
||||
"Trigger mode": "Режим триггера",
|
||||
"Based on certain date": "На основе определенной даты",
|
||||
"Based on date field of collection": "На базе поля с датой в коллекции",
|
||||
"Starts on": "Стартует с",
|
||||
"Ends on": "Оканчивается в",
|
||||
"Exactly at": "Ровно в",
|
||||
"Repeat mode": "Режим повтора",
|
||||
"Repeat limit": "Ограничение на повторы",
|
||||
"No limit": "Нет ограничений",
|
||||
"Seconds": "Секунды",
|
||||
"Minutes": "Минуты",
|
||||
"Hours": "Часы",
|
||||
"Days": "Дни",
|
||||
"Weeks": "Недели",
|
||||
"Months": "Месяцы",
|
||||
"No repeat": "Не повторять",
|
||||
"Every": "Каждые",
|
||||
"By minute": "По минутам",
|
||||
"By hour": "По часам",
|
||||
"By day": "По дням",
|
||||
"By week": "По неделям",
|
||||
"By month": "По месяцам",
|
||||
"By field": "По полю",
|
||||
"By custom date": "По пользовательской дате",
|
||||
"Advanced": "Продвинутый",
|
||||
"Advanced type": "Продвинутый",
|
||||
"End": "Окончание",
|
||||
"Trigger context": "Контекст триггера",
|
||||
"Node result": "Результат Узла",
|
||||
"Constant": "Константа",
|
||||
"Boolean": "Логический",
|
||||
"String": "Строка",
|
||||
"Comparison": "Сравнение",
|
||||
"Arithmetic calculation": "Арифметическое вычисление",
|
||||
"String operation": "Операция со строкой",
|
||||
"On going": "Непрерывный",
|
||||
"Succeeded": "Успешный",
|
||||
"Failed": "Неудачный",
|
||||
"Canceled": "Прерванный",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "Этот узел содержит ветки, к ним тоже будет произведено удаление, вы уверены?",
|
||||
"Control": "Управление",
|
||||
"Collection operations": "Операции с Коллекцией",
|
||||
"Node type": "Тип Узла",
|
||||
"Calculation": "Вычисление",
|
||||
"Configure calculation": "Настроить вычисление",
|
||||
"Calculation result": "Результат вычисления",
|
||||
"True": "Истина",
|
||||
"False": "Ложь",
|
||||
"Condition": "Условие",
|
||||
"Mode": "Режим",
|
||||
"Continue when \"Yes\"": "Продолжить когда \"Да\"",
|
||||
"Branch into \"Yes\" and \"No\"": "Разветвление на \"Да\" and \"Нет\"",
|
||||
"Conditions": "Условия",
|
||||
"Parallel branch": "Параллельная ветвь",
|
||||
"All succeeded": "Всё успешно",
|
||||
"Any succeeded": "Что-то успешно",
|
||||
"Continue after all branches succeeded": "Продолжать после успеха на всех ветвях",
|
||||
"Continue after any branch succeeded": "Продолжать после успеха на любой из ветвей",
|
||||
"Create record": "Создать запись",
|
||||
"Update record": "Обновить запись",
|
||||
"Query record": "Запрос записи",
|
||||
"Multiple records": "Множество записей",
|
||||
"Please select collection first": "Выберите сначала Коллекцию, пожалуйста",
|
||||
"Only update records matching conditions": "Обновлять только записи, соответствующие условиям",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Поля, которым не присвоено значение, будут установлены на значение по умолчанию, а поля, не имеющие значения по умолчанию, будут установлены на null.",
|
||||
"Trigger in executed workflow cannot be modified": "Триггер в выполняемом рабочем процессе не может быть изменен",
|
||||
"Node in executed workflow cannot be modified": "Узел в выполняемом рабочем процессе не может быть изменен",
|
||||
"Unsaved changes": "Несохраненные изменения",
|
||||
"Are you sure you don't want to save?": "Вы уверены, что не хотите сохранить?",
|
||||
"Dragging": "Перетаскивание",
|
||||
|
@ -176,6 +176,7 @@ export default {
|
||||
"Foreign key 2": "Yabancı anahtar 2",
|
||||
"Add filter": "Filtre ekle",
|
||||
"Add filter group": "Filtre grubu ekle",
|
||||
"Comparision": "Karşılaştırma",
|
||||
"is": "eşittir",
|
||||
"is not": "eşit değildir",
|
||||
"is variable": "is variable",
|
||||
@ -414,94 +415,6 @@ export default {
|
||||
"Local storage": "Lokal depolama",
|
||||
"Aliyun OSS": "Aliyun OSS",
|
||||
"Amazon S3": "Amazon S3",
|
||||
"Workflow": "İş Akışı",
|
||||
"Execution history": "Yürütme Geçmişi",
|
||||
"Trigger type": "Tetikleme türü",
|
||||
"Description": "Açıklama",
|
||||
"Status": "Durum",
|
||||
"On": "Aç",
|
||||
"Off": "Kapa",
|
||||
"Version": "Sürüm",
|
||||
"Copy to new version": "Yeni sürüme kopyala",
|
||||
"Load failed": "Yükleme başarısız",
|
||||
"Trigger": "Tetikle",
|
||||
"Collection event": "Koleksiyon etkinliği",
|
||||
"Trigger on": "Tetikleme açık",
|
||||
"After record added": "Kayıt eklendikten sonra",
|
||||
"After record updated": "Kayıt güncellendikten sonra",
|
||||
"After record added or updated": "Kayıt eklendikten veya güncellendikten sonra",
|
||||
"After record deleted": "Kayıt silindikten sonra",
|
||||
"Changed fields": "Değiştirilen alanlar",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Yalnızca seçilen alanlardan biri değiştiğinde tetiklenir. Seçili değilse, herhangi bir alan değiştiğinde tetikleneceği anlamına gelir. Kayıt eklendiğinde veya silindiğinde, herhangi bir alan değiştirilmiş olarak kabul edilir.",
|
||||
"Only triggers when match conditions": "Yalnızca eşleşme koşulları olduğunda tetiklenir",
|
||||
"Schedule event": "Etkinlik planla",
|
||||
"Trigger mode": "Tetikleme modu",
|
||||
"Based on certain date": "Belirli bir tarihe göre",
|
||||
"Based on date field of collection": "Koleksiyonun tarih alanına göre",
|
||||
"Starts on": "Başlangıç",
|
||||
"Ends on": "Bitiş",
|
||||
"Exactly at": "Tam zamanı",
|
||||
"Repeat mode": "Tekrarlama modu",
|
||||
"Repeat limit": "Tekrarlama limiti",
|
||||
"No limit": "Limit yok",
|
||||
"Seconds": "Saniye",
|
||||
"Minutes": "Dakika",
|
||||
"Hours": "Saat",
|
||||
"Days": "Gün",
|
||||
"Weeks": "Hafta",
|
||||
"Months": "Ay",
|
||||
"No repeat": "Tekrar yok",
|
||||
"Every": "Her",
|
||||
"By minute": "Dakikada",
|
||||
"By hour": "Saatte",
|
||||
"By day": "Günde",
|
||||
"By week": "Haftada",
|
||||
"By month": "Ayda",
|
||||
"By field": "Alanda",
|
||||
"By custom date": "Özel tarihe göre",
|
||||
"Advanced": "Gelişmiş",
|
||||
"Advanced type": "Gelişmiş",
|
||||
"End": "Son",
|
||||
"Trigger context": "Tetikleyici bağlamı",
|
||||
"Node result": "Düğüm sonucu",
|
||||
"Constant": "Devamlı",
|
||||
"Boolean": "Boolean",
|
||||
"String": "String",
|
||||
"Comparison": "Karşılaştırma",
|
||||
"Arithmetic calculation": "Aritmetik hesaplama",
|
||||
"String operation": "String operation",
|
||||
"On going": "Devam eden",
|
||||
"Succeeded": "Başarılı",
|
||||
"Failed": "Başarısız",
|
||||
"Canceled": "İptal edilen",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "Bu düğüm başka içeriklerle bağlantı içeriyor, silme işlemini onaylarsanız o bağlantılarda silinecek, emin misiniz?",
|
||||
"Control": "Kontrol",
|
||||
"Collection operations": "Koleksiyon operasyonları",
|
||||
"Node type": "Düğüm türü",
|
||||
"Calculation": "Hesaplama",
|
||||
"Configure calculation": "Hesaplamayı yapılandır",
|
||||
"Calculation result": "Hesaplama sonucu",
|
||||
"True": "Doğru",
|
||||
"False": "Yanlış",
|
||||
"Condition": "Koşul",
|
||||
"Mode": "Tür",
|
||||
"Continue when \"Yes\"": "\"Evet\" durumunda devam",
|
||||
"Branch into \"Yes\" and \"No\"": "\"Evet\" ve \"Hayır\" olarak dallandırın",
|
||||
"Conditions": "Koşullar",
|
||||
"Parallel branch": "Paralel dal",
|
||||
"All succeeded": "Hepsi başarılı",
|
||||
"Any succeeded": "Herhangi biri başarılı",
|
||||
"Continue after all branches succeeded": "Tüm dallar başarılı olduktan sonra devam et",
|
||||
"Continue after any branch succeeded": "Herhangi bir dal başarılı olduktan sonra devam et",
|
||||
"Create record": "Kayıt oluştur",
|
||||
"Update record": "Kayıt güncelle",
|
||||
"Query record": "Sorgu kaydı",
|
||||
"Multiple records": "Birden çok kayıt",
|
||||
"Please select collection first": "Lütfen önce koleksiyonu seçin",
|
||||
"Only update records matching conditions": "Yalnızca koşullarla eşleşen kayıtları güncelleyin",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Değer atanmamış alanlar varsayılan değere, varsayılan değeri olmayan alanlar ise null olarak ayarlanır.",
|
||||
"Trigger in executed workflow cannot be modified": "Yürütülen iş akışındaki tetikleyici değiştirilemez",
|
||||
"Node in executed workflow cannot be modified": "Yürütülen iş akışındaki düğüm değiştirilemez",
|
||||
"Unsaved changes": "Değişiklikler kaydedilmedi",
|
||||
"Are you sure you don't want to save?": "kaydetmek istemediğinizden emin misiniz??",
|
||||
"Dragging": "Sürükleme",
|
||||
|
@ -227,6 +227,7 @@ export default {
|
||||
"Sortable": "可排序",
|
||||
"Add filter": "添加筛选条件",
|
||||
"Add filter group": "添加筛选分组",
|
||||
"Comparision": "值比较",
|
||||
"is": "等于",
|
||||
"is not": "不等于",
|
||||
"is variable": "为动态变量",
|
||||
@ -525,136 +526,6 @@ export default {
|
||||
'Bucket': '存储桶',
|
||||
'Path': '路径(相对)',
|
||||
|
||||
// plugins/workflow
|
||||
'Workflow': '工作流',
|
||||
'Execution history': '执行历史',
|
||||
'Trigger type': '触发方式',
|
||||
'Description': '描述',
|
||||
'Status': '状态',
|
||||
'On': '启用',
|
||||
'Off': '停用',
|
||||
'Version': '版本',
|
||||
'Copy to new version': '复制到新版本',
|
||||
|
||||
'Loading': '加载中',
|
||||
'Load failed': '加载失败',
|
||||
|
||||
'Trigger': '触发器',
|
||||
'Trigger context': '触发数据',
|
||||
'Trigger data': '触发数据',
|
||||
'Trigger time': '触发时间',
|
||||
'Triggered at': '触发时间',
|
||||
'Collection event': '数据表事件',
|
||||
'Trigger on': '触发时机',
|
||||
'After record added': '新增数据后',
|
||||
'After record updated': '更新数据后',
|
||||
'After record added or updated': '新增或更新数据后',
|
||||
'After record deleted': '删除数据后',
|
||||
'Changed fields': '发生变动的字段',
|
||||
'Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.': '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',
|
||||
'Only triggers when match conditions': '满足以下条件才触发',
|
||||
|
||||
'Schedule event': '定时任务',
|
||||
'Trigger mode': '触发模式',
|
||||
'Based on certain date': '自定义时间',
|
||||
'Based on date field of collection': '根据数据表时间字段',
|
||||
'Starts on': '开始于',
|
||||
'Ends on': '结束于',
|
||||
'Exactly at': '当时',
|
||||
'Repeat mode': '重复模式',
|
||||
'Repeat limit': '重复次数',
|
||||
'No limit': '不限',
|
||||
'Seconds': '秒',
|
||||
'Minutes': '分钟',
|
||||
'Hours': '小时',
|
||||
'Days': '天',
|
||||
'Weeks': '周',
|
||||
'Months': '月',
|
||||
|
||||
'No repeat': '不重复',
|
||||
'Every': '每',
|
||||
|
||||
'By minute': '按分钟',
|
||||
'By hour': '按小时',
|
||||
'By day': '按天',
|
||||
'By week': '按周',
|
||||
'By month': '按月',
|
||||
|
||||
'By field': '数据表字段',
|
||||
'By custom date': '自定义时间',
|
||||
|
||||
'Advanced': '高级模式',
|
||||
'Advanced type': '高级类型',
|
||||
|
||||
'End': '结束',
|
||||
|
||||
'Node result': '节点数据',
|
||||
'Constant': '常量',
|
||||
|
||||
'Boolean': '逻辑值',
|
||||
'String': '字符串',
|
||||
|
||||
'Calculator': '运算',
|
||||
'Comparison': '值比较',
|
||||
'Arithmetic calculation': '算术运算',
|
||||
'String operation': '字符串',
|
||||
|
||||
'Executed at': '执行于',
|
||||
|
||||
'Queueing': '队列中',
|
||||
'On going': '进行中',
|
||||
'Succeeded': '成功',
|
||||
'Failed': '失败',
|
||||
'Pending': '等待处理',
|
||||
'Canceled': '已取消',
|
||||
|
||||
'This node contains branches, deleting will also be preformed to them, are you sure?': '节点包含分支,将同时删除其所有分支下的子节点,确定继续?',
|
||||
|
||||
'Control': '流程控制',
|
||||
'Collection operations': '数据表操作',
|
||||
'Extended': '扩展类型',
|
||||
|
||||
'Node type': '节点类型',
|
||||
|
||||
'Calculation': '运算',
|
||||
'Configure calculation': '配置运算',
|
||||
'Calculation result': '运算结果',
|
||||
'True': '真',
|
||||
'False': '假',
|
||||
'concat': '连接',
|
||||
|
||||
'Condition': '条件判断',
|
||||
'Mode': '模式',
|
||||
'Continue when "Yes"': '“是”则继续',
|
||||
'Branch into "Yes" and "No"': '“是”和“否”分别继续',
|
||||
'Conditions': '条件配置',
|
||||
|
||||
'Parallel branch': '分支',
|
||||
'Add branch': '增加分支',
|
||||
'All succeeded': '全部成功',
|
||||
'Any succeeded': '任意成功',
|
||||
'Any succeeded or failed': '任意成功或失败',
|
||||
'Continue after all branches succeeded': '全部分支都成功后才能继续',
|
||||
'Continue after any branch succeeded': '任意分支成功后就继续',
|
||||
'Continue after any branch succeeded, or exit after any branch failed': '任意分支成功继续,或失败后退出',
|
||||
|
||||
'Delay': '延时',
|
||||
'Duration': '时长',
|
||||
'End Status': '到时状态',
|
||||
'Select status': '选择状态',
|
||||
'Succeed and continue': '通过并继续',
|
||||
'Fail and exit': '失败并退出',
|
||||
|
||||
'Create record': '新增数据',
|
||||
'Update record': '更新数据',
|
||||
'Query record': '查询数据',
|
||||
'Multiple records': '多条数据',
|
||||
'Please select collection first': '请先选择数据表',
|
||||
'Only update records matching conditions': '只更新满足条件的数据',
|
||||
'Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.': '未被赋值的字段将被设置为默认值,没有默认值的设置为空值。',
|
||||
'Trigger in executed workflow cannot be modified': '已经执行过工作流的触发器不能被修改',
|
||||
'Node in executed workflow cannot be modified': '已经执行过工作流中的节点不能被修改',
|
||||
|
||||
'Unsaved changes': '未保存修改',
|
||||
'Are you sure you don\'t want to save?': '你确定不保存修改吗?',
|
||||
'Dragging': '拖拽中',
|
||||
|
@ -63,7 +63,7 @@ export const SettingsCenterDropdown = () => {
|
||||
path: 'system-settings/system-settings',
|
||||
},
|
||||
{
|
||||
title: t('Workflow'),
|
||||
title: t('workflow:Workflow'),
|
||||
path: 'workflow/workflows',
|
||||
},
|
||||
// {
|
||||
|
@ -40,7 +40,7 @@ export const FilterItem = observer((props: any) => {
|
||||
onChange={(value) => {
|
||||
setOperator(value);
|
||||
}}
|
||||
placeholder={t('Comparison')}
|
||||
placeholder={t('Comparision')}
|
||||
/>
|
||||
{!operator?.noValue &&
|
||||
React.createElement(DynamicComponent, {
|
||||
|
@ -9,6 +9,7 @@ import {
|
||||
import { useFlowContext } from './FlowContext';
|
||||
import { Instruction, instructions, Node } from './nodes';
|
||||
import { addButtonClass } from './style';
|
||||
import { NAMESPACE } from './locale';
|
||||
|
||||
|
||||
interface AddButtonProps {
|
||||
@ -47,9 +48,9 @@ export function AddButton({ upstream, branchIndex = null }: AddButtonProps) {
|
||||
}
|
||||
|
||||
const groups = [
|
||||
{ value: 'control', name: '{{t("Control")}}' },
|
||||
{ value: 'collection', name: '{{t("Collection operations")}}' },
|
||||
{ value: 'extended', name: '{{t("Extended")}}' },
|
||||
{ value: 'control', name: `{{t("Control", { ns: "${NAMESPACE}" })}}` },
|
||||
{ value: 'collection', name: `{{t("Collection operations", { ns: "${NAMESPACE}" })}}` },
|
||||
{ value: 'extended', name: `{{t("Extended types", { ns: "${NAMESPACE}" })}}` },
|
||||
];
|
||||
const instructionList = (Array.from(instructions.getValues()) as Instruction[]);
|
||||
|
||||
|
@ -16,6 +16,7 @@ import { branchBlockClass, nodeCardClass, nodeMetaClass } from './style';
|
||||
import { TriggerConfig } from './triggers';
|
||||
import { Branch } from './Branch';
|
||||
import { ExecutionStatusOptionsMap } from './constants';
|
||||
import { lang } from './locale';
|
||||
|
||||
|
||||
|
||||
@ -41,20 +42,19 @@ function makeNodes(nodes, jobs = []): void {
|
||||
}
|
||||
|
||||
export function ExecutionCanvas() {
|
||||
const { t } = useTranslation();
|
||||
const compile = useCompile();
|
||||
const { data, refresh, loading } = useResourceActionContext();
|
||||
const { data, loading } = useResourceActionContext();
|
||||
const { setTitle } = useDocumentTitle();
|
||||
useEffect(() => {
|
||||
const { workflow } = data?.data ?? {};
|
||||
setTitle(`${workflow?.title ? `${workflow.title} - ` : ''}${t('Execution history')}`);
|
||||
setTitle(`${workflow?.title ? `${workflow.title} - ` : ''}${lang('Execution history')}`);
|
||||
}, [data?.data]);
|
||||
|
||||
if (!data?.data) {
|
||||
if (loading) {
|
||||
return <div>{t('Loading')}</div>
|
||||
return <div>{lang('Loading')}</div>
|
||||
} else {
|
||||
return <div>{t('Load failed')}</div>;
|
||||
return <div>{lang('Load failed')}</div>;
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ export function ExecutionCanvas() {
|
||||
<header>
|
||||
<span>
|
||||
<Link to={`/admin/settings/workflow/workflows`}>
|
||||
{t('Workflow')}
|
||||
{lang('Workflow')}
|
||||
</Link>
|
||||
</span>
|
||||
<span>
|
||||
@ -102,7 +102,7 @@ export function ExecutionCanvas() {
|
||||
</div>
|
||||
<div className={cx(nodeCardClass)}>
|
||||
<div className={cx(nodeMetaClass)}>
|
||||
<Tag color="#333">{t('End')}</Tag>
|
||||
<Tag color="#333">{lang('End')}</Tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { ResourceActionProvider, useRecord } from "@nocobase/client";
|
||||
|
||||
export const ExecutionResourceProvider = ({ request, ...others }) => {
|
||||
export const ExecutionResourceProvider = ({ request, filter = {}, ...others }) => {
|
||||
const workflow = useRecord();
|
||||
const props = {
|
||||
...others,
|
||||
@ -11,11 +11,10 @@ export const ExecutionResourceProvider = ({ request, ...others }) => {
|
||||
...request?.params,
|
||||
filter: {
|
||||
...(request?.params?.filter),
|
||||
key: workflow.key
|
||||
key: workflow.key,
|
||||
}
|
||||
}
|
||||
},
|
||||
workflow
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
@ -1,12 +1,14 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Link, useHistory } from 'react-router-dom';
|
||||
import { Dropdown, Menu, Button, Tag, Switch, message } from 'antd';
|
||||
import { DownOutlined, RightOutlined } from '@ant-design/icons';
|
||||
import { DownOutlined, RightOutlined, EllipsisOutlined } from '@ant-design/icons';
|
||||
import { cx } from '@emotion/css';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import classnames from 'classnames';
|
||||
|
||||
import {
|
||||
ActionContext,
|
||||
SchemaComponent,
|
||||
useDocumentTitle,
|
||||
useResourceActionContext,
|
||||
useResourceContext
|
||||
@ -16,7 +18,11 @@ import { FlowContext } from './FlowContext';
|
||||
import { branchBlockClass, nodeCardClass, nodeMetaClass, workflowVersionDropdownClass } from './style';
|
||||
import { TriggerConfig } from './triggers';
|
||||
import { Branch } from './Branch';
|
||||
import { executionCollection, executionSchema } from './schemas/executions';
|
||||
import { ExecutionLink } from './ExecutionLink';
|
||||
import { ExecutionResourceProvider } from './ExecutionResourceProvider';
|
||||
|
||||
import { lang, NAMESPACE } from './locale';
|
||||
|
||||
|
||||
|
||||
@ -35,18 +41,18 @@ function makeNodes(nodes): void {
|
||||
}
|
||||
|
||||
export function WorkflowCanvas() {
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
const { data, refresh, loading } = useResourceActionContext();
|
||||
const { resource, targetKey } = useResourceContext();
|
||||
const { setTitle } = useDocumentTitle();
|
||||
const [visible, setVisible] = useState(false);
|
||||
useEffect(() => {
|
||||
const { title } = data?.data ?? {};
|
||||
setTitle(`${t('Workflow')}${title ? `: ${title}` : ''}`);
|
||||
setTitle(`${lang('Workflow')}${title ? `: ${title}` : ''}`);
|
||||
}, [data?.data]);
|
||||
|
||||
if (!data?.data && !loading) {
|
||||
return <div>{t('Load failed')}</div>;
|
||||
return <div>{lang('Load failed')}</div>;
|
||||
}
|
||||
|
||||
const { nodes = [], revisions = [], ...workflow } = data?.data ?? {};
|
||||
@ -77,11 +83,25 @@ export function WorkflowCanvas() {
|
||||
const { data: { data: revision } } = await resource.revision({
|
||||
filterByTk: workflow[targetKey]
|
||||
});
|
||||
message.success(t('Operation succeeded'));
|
||||
message.success(lang('Operation succeeded'));
|
||||
|
||||
history.push(`${revision.id}`);
|
||||
}
|
||||
|
||||
async function onMenuCommand({ key }) {
|
||||
switch (key) {
|
||||
case 'history':
|
||||
setVisible(true);
|
||||
return;
|
||||
case 'revision':
|
||||
return onRevision();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const revisionable = workflow.executed && !revisions.find(item => !item.executed && new Date(item.createdAt) > new Date(workflow.createdAt));
|
||||
|
||||
return (
|
||||
<FlowContext.Provider value={{
|
||||
workflow,
|
||||
@ -93,14 +113,14 @@ export function WorkflowCanvas() {
|
||||
<header>
|
||||
<span>
|
||||
<Link to={`/admin/settings/workflow/workflows`}>
|
||||
{t('Workflow')}
|
||||
{lang('Workflow')}
|
||||
</Link>
|
||||
</span>
|
||||
<strong>{workflow.title}</strong>
|
||||
</header>
|
||||
<aside>
|
||||
<div className="workflow-versions">
|
||||
<label>{t('Version')}</label>
|
||||
<label>{lang('Version')}</label>
|
||||
<Dropdown
|
||||
trigger={['click']}
|
||||
overlay={
|
||||
@ -132,15 +152,33 @@ export function WorkflowCanvas() {
|
||||
<Switch
|
||||
checked={workflow.enabled}
|
||||
onChange={onToggle}
|
||||
checkedChildren={t('On')}
|
||||
unCheckedChildren={t('Off')}
|
||||
checkedChildren={lang('On')}
|
||||
unCheckedChildren={lang('Off')}
|
||||
/>
|
||||
{workflow.executed && !revisions.find(item => !item.executed && new Date(item.createdAt) > new Date(workflow.createdAt))
|
||||
? (
|
||||
<Button onClick={onRevision}>{t('Copy to new version')}</Button>
|
||||
)
|
||||
: null
|
||||
}
|
||||
<Dropdown
|
||||
overlay={
|
||||
<Menu onClick={onMenuCommand}>
|
||||
<Menu.Item key="history" disabled={!workflow.executed}>{lang('Execution history')}</Menu.Item>
|
||||
<Menu.Item key="revision" disabled={!revisionable}>{lang('Copy to new version')}</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
>
|
||||
<Button type="text" icon={<EllipsisOutlined />} />
|
||||
</Dropdown>
|
||||
<ActionContext.Provider value={{ visible, setVisible }}>
|
||||
<SchemaComponent
|
||||
schema={{
|
||||
type: 'void',
|
||||
properties: {
|
||||
drawer: executionSchema
|
||||
}
|
||||
}}
|
||||
components={{
|
||||
ExecutionResourceProvider,
|
||||
ExecutionLink
|
||||
}}
|
||||
/>
|
||||
</ActionContext.Provider>
|
||||
</aside>
|
||||
</div>
|
||||
<div className="workflow-canvas">
|
||||
@ -150,7 +188,7 @@ export function WorkflowCanvas() {
|
||||
</div>
|
||||
<div className={cx(nodeCardClass)}>
|
||||
<div className={cx(nodeMetaClass)}>
|
||||
<Tag color="#333">{t('End')}</Tag>
|
||||
<Tag color="#333">{lang('End')}</Tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,8 +1,17 @@
|
||||
import { PluginManagerContext, RouteSwitchContext, SettingsCenterProvider } from '@nocobase/client';
|
||||
import React, { useContext } from 'react';
|
||||
import { PluginManagerContext, RouteSwitchContext, SettingsCenterProvider } from '@nocobase/client';
|
||||
import { WorkflowPage } from './WorkflowPage';
|
||||
import { WorkflowPane, WorkflowShortcut } from './WorkflowShortcut';
|
||||
import { ExecutionPage } from './ExecutionPage';
|
||||
import { triggers } from './triggers';
|
||||
import { instructions } from './nodes';
|
||||
import { lang } from './locale';
|
||||
|
||||
export const WorkflowContext = React.createContext({});
|
||||
|
||||
export function useWorkflowContext() {
|
||||
return useContext(WorkflowContext);
|
||||
}
|
||||
|
||||
export const WorkflowProvider = (props) => {
|
||||
const ctx = useContext(PluginManagerContext);
|
||||
@ -21,10 +30,11 @@ export const WorkflowProvider = (props) => {
|
||||
settings={{
|
||||
workflow: {
|
||||
icon: 'PartitionOutlined',
|
||||
title: '{{t("Workflow")}}',
|
||||
// title: `{{t("Workflow", { ns: "${NAMESPACE}" })}}`,
|
||||
title: lang('Workflow'),
|
||||
tabs: {
|
||||
workflows: {
|
||||
title: '{{t("Workflow")}}',
|
||||
title: lang('Workflow'),
|
||||
component: WorkflowPane,
|
||||
},
|
||||
},
|
||||
@ -35,12 +45,14 @@ export const WorkflowProvider = (props) => {
|
||||
value={{
|
||||
components: {
|
||||
...ctx?.components,
|
||||
WorkflowShortcut,
|
||||
// WorkflowShortcut,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<RouteSwitchContext.Provider value={{ components: { ...components, WorkflowPage, ExecutionPage }, ...others, routes }}>
|
||||
{props.children}
|
||||
<WorkflowContext.Provider value={{ triggers, instructions }}>
|
||||
{props.children}
|
||||
</WorkflowContext.Provider>
|
||||
</RouteSwitchContext.Provider>
|
||||
</PluginManagerContext.Provider>
|
||||
</SettingsCenterProvider>
|
||||
|
@ -10,6 +10,7 @@ import { workflowSchema } from './schemas/workflows';
|
||||
import { WorkflowLink } from './WorkflowLink';
|
||||
import { ExecutionResourceProvider } from './ExecutionResourceProvider';
|
||||
import { ExecutionLink } from './ExecutionLink';
|
||||
import { lang } from './locale';
|
||||
|
||||
|
||||
|
||||
@ -29,12 +30,12 @@ export const WorkflowPane = () => {
|
||||
};
|
||||
|
||||
export const WorkflowShortcut = () => {
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
return (
|
||||
<PluginManager.Toolbar.Item
|
||||
key="workflow"
|
||||
icon={<PartitionOutlined />}
|
||||
title={t('Workflow')}
|
||||
title={lang('Workflow')}
|
||||
onClick={() => {
|
||||
history.push('/admin/settings/workflow/workflows');
|
||||
}}
|
||||
|
@ -9,6 +9,7 @@ import { useFlowContext } from "./FlowContext";
|
||||
import { triggers } from "./triggers";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Registry } from "@nocobase/utils/client";
|
||||
import { lang, NAMESPACE, useWorkflowTranslation } from "./locale";
|
||||
|
||||
function NullRender() {
|
||||
return null;
|
||||
@ -110,7 +111,7 @@ calculators.register('notEndsWith', {
|
||||
group: 'string'
|
||||
});
|
||||
calculators.register('concat', {
|
||||
name: '{{t("concat")}}',
|
||||
name: `{{t("concat", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
group: 'string'
|
||||
});
|
||||
@ -118,19 +119,19 @@ calculators.register('concat', {
|
||||
const calculatorGroups = [
|
||||
{
|
||||
value: 'boolean',
|
||||
title: '{{t("Comparison")}}'
|
||||
title: `{{t("Comparision", { ns: "${NAMESPACE}" })}}`,
|
||||
},
|
||||
{
|
||||
value: 'number',
|
||||
title: '{{t("Arithmetic calculation")}}'
|
||||
title: `{{t("Arithmetic calculation", { ns: "${NAMESPACE}" })}}`,
|
||||
},
|
||||
{
|
||||
value: 'string',
|
||||
title: '{{t("String operation")}}'
|
||||
title: `{{t("String operation", { ns: "${NAMESPACE}" })}}`,
|
||||
},
|
||||
{
|
||||
value: 'date',
|
||||
title: '{{t("Date")}}'
|
||||
title: `{{t("Date", { ns: "${NAMESPACE}" })}}`,
|
||||
}
|
||||
];
|
||||
|
||||
@ -158,7 +159,7 @@ export const BaseTypeSet = new Set(['boolean', 'number', 'string', 'date']);
|
||||
|
||||
const ConstantTypes = {
|
||||
string: {
|
||||
title: '{{t("String")}}',
|
||||
title: `{{t("String", { ns: "${NAMESPACE}" })}}`,
|
||||
value: 'string',
|
||||
component({ onChange, type, options, value }) {
|
||||
return (
|
||||
@ -184,7 +185,7 @@ const ConstantTypes = {
|
||||
default: 0
|
||||
},
|
||||
boolean: {
|
||||
title: '{{t("Boolean")}}',
|
||||
title: `{{t("Boolean", { ns: "${NAMESPACE}" })}}`,
|
||||
value: 'boolean',
|
||||
component({ onChange, type, options, value }) {
|
||||
const { t } = useTranslation();
|
||||
@ -194,8 +195,8 @@ const ConstantTypes = {
|
||||
onChange={v => onChange({ value: v, type, options })}
|
||||
placeholder={t('Select')}
|
||||
>
|
||||
<Select.Option value={true}>{t('True')}</Select.Option>
|
||||
<Select.Option value={false}>{t('False')}</Select.Option>
|
||||
<Select.Option value={true}>{lang('True')}</Select.Option>
|
||||
<Select.Option value={false}>{lang('False')}</Select.Option>
|
||||
</Select>
|
||||
);
|
||||
},
|
||||
@ -213,7 +214,7 @@ const ConstantTypes = {
|
||||
|
||||
export const VariableTypes = {
|
||||
constant: {
|
||||
title: '{{t("Constant")}}',
|
||||
title: `{{t("Constant", { ns: "${NAMESPACE}" })}}`,
|
||||
value: 'constant',
|
||||
options: Object.values(ConstantTypes).map(item => ({
|
||||
value: item.value,
|
||||
@ -241,7 +242,7 @@ export const VariableTypes = {
|
||||
}
|
||||
},
|
||||
$jobsMapByNodeId: {
|
||||
title: '{{t("Node result")}}',
|
||||
title: `{{t("Node result", { ns: "${NAMESPACE}" })}}`,
|
||||
value: '$jobsMapByNodeId',
|
||||
options() {
|
||||
const node = useNodeContext();
|
||||
@ -296,7 +297,7 @@ export const VariableTypes = {
|
||||
}
|
||||
},
|
||||
$context: {
|
||||
title: '{{t("Trigger context")}}',
|
||||
title: `{{t("Trigger context", { ns: "${NAMESPACE}" })}}`,
|
||||
value: '$context',
|
||||
component() {
|
||||
const { workflow } = useFlowContext();
|
||||
@ -382,7 +383,7 @@ export function Operand({
|
||||
}
|
||||
|
||||
export function Calculation({ calculator, operands = [], onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
const compile = useCompile();
|
||||
return (
|
||||
<VariableTypesContext.Provider value={VariableTypes}>
|
||||
@ -400,7 +401,7 @@ export function Calculation({ calculator, operands = [], onChange }) {
|
||||
onChange={v => onChange({ operands, calculator: v })}
|
||||
placeholder={t('Calculator')}
|
||||
>
|
||||
{calculatorGroups.map(group => (
|
||||
{calculatorGroups.filter(group => Boolean(getGroupCalculators(group.value).length)).map(group => (
|
||||
<Select.OptGroup key={group.value} label={compile(group.title)}>
|
||||
{getGroupCalculators(group.value).map(([value, { name }]) => (
|
||||
<Select.Option key={value} value={value}>{compile(name)}</Select.Option>
|
||||
@ -421,7 +422,7 @@ export function Calculation({ calculator, operands = [], onChange }) {
|
||||
export function VariableComponent({ value, onChange, renderSchemaComponent }) {
|
||||
const VTypes = { ...VariableTypes,
|
||||
constant: {
|
||||
title: '{{t("Constant")}}',
|
||||
title: `{{t("Constant", { ns: "${NAMESPACE}" })}}`,
|
||||
value: 'constant',
|
||||
options: undefined
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import { css } from "@emotion/css";
|
||||
|
||||
import { CollectionField, CollectionProvider, SchemaComponent, useCollectionManager, useCompile } from "@nocobase/client";
|
||||
import { Operand, parseStringValue, VariableTypes, VariableTypesContext } from "../calculators";
|
||||
import { lang, NAMESPACE } from "../locale";
|
||||
|
||||
function AssociationInput(props) {
|
||||
const { getCollectionFields } = useCollectionManager();
|
||||
@ -63,7 +64,7 @@ export default observer(({ value, onChange }: any) => {
|
||||
const VTypes = {
|
||||
...(['linkTo', 'hasMany', 'belongsToMany'].includes(field.type) ? {} : VariableTypes),
|
||||
constant: {
|
||||
title: '{{t("Constant")}}',
|
||||
title: `{{t("Constant", { ns: "${NAMESPACE}" })}}`,
|
||||
value: 'constant',
|
||||
options: undefined
|
||||
}
|
||||
@ -150,7 +151,7 @@ export default observer(({ value, onChange }: any) => {
|
||||
}
|
||||
</CollectionProvider>
|
||||
)
|
||||
: <p>{t('Please select collection first')}</p>
|
||||
: <p>{lang('Please select collection first')}</p>
|
||||
}
|
||||
</fieldset>
|
||||
);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { InputNumber, Select } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { css } from "@emotion/css";
|
||||
import { lang } from "../locale";
|
||||
|
||||
const UnitOptions = [
|
||||
{ value: 1_000, label: 'Seconds' },
|
||||
@ -16,7 +16,6 @@ function getNumberOption(v) {
|
||||
}
|
||||
|
||||
export default function ({ value = 60000, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const option = getNumberOption(value);
|
||||
const quantity = Math.round(value / option.value);
|
||||
|
||||
@ -28,7 +27,7 @@ export default function ({ value = 60000, onChange }) {
|
||||
<InputNumber min={1} value={quantity} onChange={(v) => onChange(Math.round(v * option.value))}/>
|
||||
<Select value={option.value} onChange={unit => onChange(Math.round(quantity * unit))}>
|
||||
{UnitOptions.map(item => (
|
||||
<Select.Option key={item.value} value={item.value}>{t(item.label)}</Select.Option>
|
||||
<Select.Option key={item.value} value={item.value}>{lang(item.label)}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</fieldset>
|
||||
|
@ -5,6 +5,7 @@ import {
|
||||
CheckOutlined,
|
||||
ExclamationOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { NAMESPACE } from './locale';
|
||||
|
||||
export const EXECUTION_STATUS = {
|
||||
QUEUEING: null,
|
||||
@ -15,11 +16,11 @@ export const EXECUTION_STATUS = {
|
||||
};
|
||||
|
||||
export const ExecutionStatusOptions = [
|
||||
{ value: EXECUTION_STATUS.QUEUEING, label: '{{t("Queueing")}}', color: 'blue' },
|
||||
{ value: EXECUTION_STATUS.STARTED, label: '{{t("On going")}}', color: 'gold' },
|
||||
{ value: EXECUTION_STATUS.SUCCEEDED, label: '{{t("Succeeded")}}', color: 'green' },
|
||||
{ value: EXECUTION_STATUS.FAILED, label: '{{t("Failed")}}', color: 'red' },
|
||||
{ value: EXECUTION_STATUS.CANCELED, label: '{{t("Canceled")}}' },
|
||||
{ value: EXECUTION_STATUS.QUEUEING, label: `{{t("Queueing", { ns: "${NAMESPACE}" })}}`, color: 'blue' },
|
||||
{ value: EXECUTION_STATUS.STARTED, label: `{{t("On going", { ns: "${NAMESPACE}" })}}`, color: 'gold' },
|
||||
{ value: EXECUTION_STATUS.SUCCEEDED, label: `{{t("Succeeded", { ns: "${NAMESPACE}" })}}`, color: 'green' },
|
||||
{ value: EXECUTION_STATUS.FAILED, label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`, color: 'red' },
|
||||
{ value: EXECUTION_STATUS.CANCELED, label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}` },
|
||||
];
|
||||
|
||||
export const ExecutionStatusOptionsMap = ExecutionStatusOptions.reduce((map, option) => Object.assign(map, { [option.value]: option }), {});
|
||||
@ -32,10 +33,10 @@ export const JOB_STATUS = {
|
||||
};
|
||||
|
||||
export const JobStatusOptions = [
|
||||
{ value: JOB_STATUS.PENDING, label: '{{t("Pending")}}', color: '#d4c306', icon: <ClockCircleOutlined /> },
|
||||
{ value: JOB_STATUS.RESOLVED, label: '{{t("Succeeded")}}', color: '#67c068', icon: <CheckOutlined /> },
|
||||
{ value: JOB_STATUS.REJECTED, label: '{{t("Failed")}}', color: '#f40', icon: <ExclamationOutlined /> },
|
||||
{ value: JOB_STATUS.CANCELED, label: '{{t("Canceled")}}', color: '#f40', icon: <CloseOutlined /> }
|
||||
{ value: JOB_STATUS.PENDING, label: `{{t("Pending", { ns: "${NAMESPACE}" })}}`, color: '#d4c306', icon: <ClockCircleOutlined /> },
|
||||
{ value: JOB_STATUS.RESOLVED, label: `{{t("Succeeded", { ns: "${NAMESPACE}" })}}`, color: '#67c068', icon: <CheckOutlined /> },
|
||||
{ value: JOB_STATUS.REJECTED, label: `{{t("Failed", { ns: "${NAMESPACE}" })}}`, color: '#f40', icon: <ExclamationOutlined /> },
|
||||
{ value: JOB_STATUS.CANCELED, label: `{{t("Canceled", { ns: "${NAMESPACE}" })}}`, color: '#f40', icon: <CloseOutlined /> }
|
||||
];
|
||||
|
||||
export const JobStatusOptionsMap = JobStatusOptions.reduce((map, option) => Object.assign(map, { [option.value]: option }), {});
|
||||
|
89
packages/plugins/workflow/src/client/locale/en-US.ts
Normal file
89
packages/plugins/workflow/src/client/locale/en-US.ts
Normal file
@ -0,0 +1,89 @@
|
||||
export default {
|
||||
"Workflow": "Workflow",
|
||||
"Execution history": "Execution history",
|
||||
"Trigger type": "Trigger type",
|
||||
"Description": "Description",
|
||||
"Status": "Status",
|
||||
"On": "On",
|
||||
"Off": "Off",
|
||||
"Version": "Version",
|
||||
"Copy to new version": "Copy to new version",
|
||||
"Load failed": "Load failed",
|
||||
"Trigger": "Trigger",
|
||||
"Collection event": "Collection event",
|
||||
"Trigger on": "Trigger on",
|
||||
"After record added": "After record added",
|
||||
"After record updated": "After record updated",
|
||||
"After record added or updated": "After record added or updated",
|
||||
"After record deleted": "After record deleted",
|
||||
"Changed fields": "Changed fields",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.",
|
||||
"Only triggers when match conditions": "Only triggers when match conditions",
|
||||
"Schedule event": "Schedule event",
|
||||
"Trigger mode": "Trigger mode",
|
||||
"Based on certain date": "Based on certain date",
|
||||
"Based on date field of collection": "Based on date field of collection",
|
||||
"Starts on": "Starts on",
|
||||
"Ends on": "Ends on",
|
||||
"Exactly at": "Exactly at",
|
||||
"Repeat mode": "Repeat mode",
|
||||
"Repeat limit": "Repeat limit",
|
||||
"No limit": "No limit",
|
||||
"Seconds": "Seconds",
|
||||
"Minutes": "Minutes",
|
||||
"Hours": "Hours",
|
||||
"Days": "Days",
|
||||
"Weeks": "Weeks",
|
||||
"Months": "Months",
|
||||
"No repeat": "No repeat",
|
||||
"Every": "Every",
|
||||
"By minute": "By minute",
|
||||
"By hour": "By hour",
|
||||
"By day": "By day",
|
||||
"By week": "By week",
|
||||
"By month": "By month",
|
||||
"By field": "By field",
|
||||
"By custom date": "By custom date",
|
||||
"Advanced": "Advanced",
|
||||
"Advanced type": "Advanced",
|
||||
"End": "End",
|
||||
"Trigger context": "Trigger context",
|
||||
"Node result": "Node result",
|
||||
"Constant": "Constant",
|
||||
"Boolean": "Boolean",
|
||||
"String": "String",
|
||||
"Arithmetic calculation": "Arithmetic calculation",
|
||||
"String operation": "String operation",
|
||||
"On going": "On going",
|
||||
"Succeeded": "Succeeded",
|
||||
"Failed": "Failed",
|
||||
"Canceled": "Canceled",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "This node contains branches, deleting will also be preformed to them, are you sure?",
|
||||
"Control": "Control",
|
||||
"Collection operations": "Collection operations",
|
||||
"Node type": "Node type",
|
||||
"Calculation": "Calculation",
|
||||
"Configure calculation": "Configure calculation",
|
||||
"Calculation result": "Calculation result",
|
||||
"True": "True",
|
||||
"False": "False",
|
||||
"Condition": "Condition",
|
||||
"Mode": "Mode",
|
||||
"Continue when \"Yes\"": "Continue when \"Yes\"",
|
||||
"Branch into \"Yes\" and \"No\"": "Branch into \"Yes\" and \"No\"",
|
||||
"Conditions": "Conditions",
|
||||
"Parallel branch": "Parallel branch",
|
||||
"All succeeded": "All succeeded",
|
||||
"Any succeeded": "Any succeeded",
|
||||
"Continue after all branches succeeded": "Continue after all branches succeeded",
|
||||
"Continue after any branch succeeded": "Continue after any branch succeeded",
|
||||
"Create record": "Create record",
|
||||
"Update record": "Update record",
|
||||
"Query record": "Query record",
|
||||
"Multiple records": "Multiple records",
|
||||
"Please select collection first": "Please select collection first",
|
||||
"Only update records matching conditions": "Only update records matching conditions",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
|
||||
"Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
|
||||
"Node in executed workflow cannot be modified": "Node in executed workflow cannot be modified",
|
||||
};
|
24
packages/plugins/workflow/src/client/locale/index.ts
Normal file
24
packages/plugins/workflow/src/client/locale/index.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { i18n } from '@nocobase/client';
|
||||
|
||||
import zhCN from './zh-CN';
|
||||
import enUS from './en-US';
|
||||
import jaJP from './ja-JP';
|
||||
import ruRU from './ru-RU';
|
||||
import trTR from './tr-TR';
|
||||
|
||||
export const NAMESPACE = 'workflow';
|
||||
|
||||
i18n.addResources('zh-CN', NAMESPACE, zhCN);
|
||||
i18n.addResources('en-US', NAMESPACE, enUS);
|
||||
i18n.addResources('ja-JP', NAMESPACE, jaJP);
|
||||
i18n.addResources('ru-RU', NAMESPACE, ruRU);
|
||||
i18n.addResources('tr-TR', NAMESPACE, trTR);
|
||||
|
||||
export function lang(key: string) {
|
||||
return i18n.t(key, { ns: NAMESPACE });
|
||||
}
|
||||
|
||||
export function useWorkflowTranslation() {
|
||||
return useTranslation(NAMESPACE);
|
||||
}
|
89
packages/plugins/workflow/src/client/locale/ja-JP.ts
Normal file
89
packages/plugins/workflow/src/client/locale/ja-JP.ts
Normal file
@ -0,0 +1,89 @@
|
||||
export default {
|
||||
"Workflow": "ワークフロー",
|
||||
"Execution history": "実行履歴",
|
||||
"Trigger type": "トリガータイプ",
|
||||
"Description": "説明",
|
||||
"Status": "状態",
|
||||
"On": "有効",
|
||||
"Off": "無効",
|
||||
"Version": "バージョン",
|
||||
"Copy to new version": "新しいバージョンにコピー",
|
||||
"Load failed": "読み込みに失敗しました",
|
||||
"Trigger": "トリガー",
|
||||
"Collection event": "コレクションイベント",
|
||||
"Trigger on": "トリガータイミング",
|
||||
"After record added": "レコードを追加した後",
|
||||
"After record updated": "レコードを更新した後",
|
||||
"After record added or updated": "レコードを追加もしくは更新した後",
|
||||
"After record deleted": "レコードを削除した後",
|
||||
"Changed fields": "フィールドが変更された時",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "選択したフィールドの 1 つが変更された場合にのみトリガーされます。 選択されていない場合は、フィールドが変更されたときにトリガーされることを意味します。 レコードが追加または削除されると、すべてのフィールドが変更されたと見なされます。",
|
||||
"Only triggers when match conditions": "以下の条件を満たすと発動",
|
||||
"Schedule event": "スケジュールイベント",
|
||||
"Trigger mode": "トリガーモード",
|
||||
"Based on certain date": "カスタム時間",
|
||||
"Based on date field of collection": "コレクションのフィールド時間に基づく",
|
||||
"Starts on": "開始",
|
||||
"Ends on": "終了",
|
||||
"Exactly at": "ちょうど",
|
||||
"Repeat mode": "繰り返しパターン",
|
||||
"Repeat limit": "繰り返し回数",
|
||||
"No limit": "無制限",
|
||||
"Seconds": "秒",
|
||||
"Minutes": "分",
|
||||
"Hours": "時",
|
||||
"Days": "日",
|
||||
"Weeks": "週",
|
||||
"Months": "月",
|
||||
"No repeat": "繰り返さない",
|
||||
"Every": "毎",
|
||||
"By minute": "分ごと",
|
||||
"By hour": "時間ごと",
|
||||
"By day": "日ごと",
|
||||
"By week": "週ごと",
|
||||
"By month": "月ごと",
|
||||
"By field": "フィールドごと",
|
||||
"By custom date": "カスタム時間",
|
||||
"Advanced": "アドバンスド",
|
||||
"Advanced type": "アドバンスタイプ",
|
||||
"End": "終了",
|
||||
"Trigger context": "トリガーフィールド",
|
||||
"Node result": "ノードの結果",
|
||||
"Constant": "定数",
|
||||
"Boolean": "論理値",
|
||||
"String": "文字列",
|
||||
"Arithmetic calculation": "算術演算",
|
||||
"String operation": "文字列操作",
|
||||
"On going": "処理中",
|
||||
"Succeeded": "成功",
|
||||
"Failed": "失敗",
|
||||
"Canceled": "取消",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "ノードにはブランチが含まれており、そのすべてのブランチの下にあるすべての子ノードが同時に削除されます。続行してもよろしいですか?",
|
||||
"Control": "プロセス制御",
|
||||
"Collection operations": "フィールド操作",
|
||||
"Node type": "ノードタイプ",
|
||||
"Calculation": "演算",
|
||||
"Configure calculation": "演算設定",
|
||||
"Calculation result": "演算結果",
|
||||
"True": "真",
|
||||
"False": "偽",
|
||||
"Condition": "条件",
|
||||
"Mode": "モデル",
|
||||
"Continue when \"Yes\"": "「はい」の場合に続行",
|
||||
"Branch into \"Yes\" and \"No\"": "「はい」と「いいえ」で分岐して続行",
|
||||
"Conditions": "条件設定",
|
||||
"Parallel branch": "分岐",
|
||||
"All succeeded": "すべて成功",
|
||||
"Any succeeded": "いずれかが成功",
|
||||
"Continue after all branches succeeded": "すべての分岐が成功した後に続行",
|
||||
"Continue after any branch succeeded": "いずれかの分岐が成功した後に続行",
|
||||
"Create record": "レコード追加",
|
||||
"Update record": "レコード更新",
|
||||
"Query record": "クエリ レコード",
|
||||
"Multiple records": "複数レコード",
|
||||
"Please select collection first": "先にコレクションを選択してください",
|
||||
"Only update records matching conditions": "条件を満たすレコードのみ更新",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "値が割り当てられていないフィールドはデフォルト値に設定され、デフォルト値がないフィールドは null に設定されます",
|
||||
"Trigger in executed workflow cannot be modified": "すでにワークフローを実行したトリガーは変更できません",
|
||||
"Node in executed workflow cannot be modified": "すでに実行されたワークフローのノードは変更できません",
|
||||
};
|
89
packages/plugins/workflow/src/client/locale/ru-RU.ts
Normal file
89
packages/plugins/workflow/src/client/locale/ru-RU.ts
Normal file
@ -0,0 +1,89 @@
|
||||
export default {
|
||||
"Workflow": "Рабочий процесс",
|
||||
"Execution history": "История запусков",
|
||||
"Trigger type": "Тип триггера",
|
||||
"Description": "Описание",
|
||||
"Status": "Статус",
|
||||
"On": "Вкл.",
|
||||
"Off": "Выкл.",
|
||||
"Version": "Версия",
|
||||
"Copy to new version": "Скопировать в новую версию",
|
||||
"Load failed": "Загрузка не удалась",
|
||||
"Trigger": "Триггер",
|
||||
"Collection event": "Событие коллекции",
|
||||
"Trigger on": "Триггер на",
|
||||
"After record added": "После добавления записи",
|
||||
"After record updated": "После обновления записи",
|
||||
"After record added or updated": "После добавления или обновления записи",
|
||||
"After record deleted": "После удаления записи",
|
||||
"Changed fields": "Измененные поля",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Запускается только при изменении одного из выбранных полей. Если флажок не установлен, это означает, что он будет срабатывать при изменении любого поля. При добавлении или удалении записи любое поле считается измененным.",
|
||||
"Only triggers when match conditions": "Срабатывает только при совпадении условий",
|
||||
"Schedule event": "Событие по расписанию",
|
||||
"Trigger mode": "Режим триггера",
|
||||
"Based on certain date": "На основе определенной даты",
|
||||
"Based on date field of collection": "На базе поля с датой в коллекции",
|
||||
"Starts on": "Стартует с",
|
||||
"Ends on": "Оканчивается в",
|
||||
"Exactly at": "Ровно в",
|
||||
"Repeat mode": "Режим повтора",
|
||||
"Repeat limit": "Ограничение на повторы",
|
||||
"No limit": "Нет ограничений",
|
||||
"Seconds": "Секунды",
|
||||
"Minutes": "Минуты",
|
||||
"Hours": "Часы",
|
||||
"Days": "Дни",
|
||||
"Weeks": "Недели",
|
||||
"Months": "Месяцы",
|
||||
"No repeat": "Не повторять",
|
||||
"Every": "Каждые",
|
||||
"By minute": "По минутам",
|
||||
"By hour": "По часам",
|
||||
"By day": "По дням",
|
||||
"By week": "По неделям",
|
||||
"By month": "По месяцам",
|
||||
"By field": "По полю",
|
||||
"By custom date": "По пользовательской дате",
|
||||
"Advanced": "Продвинутый",
|
||||
"Advanced type": "Продвинутый",
|
||||
"End": "Окончание",
|
||||
"Trigger context": "Контекст триггера",
|
||||
"Node result": "Результат Узла",
|
||||
"Constant": "Константа",
|
||||
"Boolean": "Логический",
|
||||
"String": "Строка",
|
||||
"Arithmetic calculation": "Арифметическое вычисление",
|
||||
"String operation": "Операция со строкой",
|
||||
"On going": "Непрерывный",
|
||||
"Succeeded": "Успешный",
|
||||
"Failed": "Неудачный",
|
||||
"Canceled": "Прерванный",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "Этот узел содержит ветки, к ним тоже будет произведено удаление, вы уверены?",
|
||||
"Control": "Управление",
|
||||
"Collection operations": "Операции с Коллекцией",
|
||||
"Node type": "Тип Узла",
|
||||
"Calculation": "Вычисление",
|
||||
"Configure calculation": "Настроить вычисление",
|
||||
"Calculation result": "Результат вычисления",
|
||||
"True": "Истина",
|
||||
"False": "Ложь",
|
||||
"Condition": "Условие",
|
||||
"Mode": "Режим",
|
||||
"Continue when \"Yes\"": "Продолжить когда \"Да\"",
|
||||
"Branch into \"Yes\" and \"No\"": "Разветвление на \"Да\" and \"Нет\"",
|
||||
"Conditions": "Условия",
|
||||
"Parallel branch": "Параллельная ветвь",
|
||||
"All succeeded": "Всё успешно",
|
||||
"Any succeeded": "Что-то успешно",
|
||||
"Continue after all branches succeeded": "Продолжать после успеха на всех ветвях",
|
||||
"Continue after any branch succeeded": "Продолжать после успеха на любой из ветвей",
|
||||
"Create record": "Создать запись",
|
||||
"Update record": "Обновить запись",
|
||||
"Query record": "Запрос записи",
|
||||
"Multiple records": "Множество записей",
|
||||
"Please select collection first": "Выберите сначала Коллекцию, пожалуйста",
|
||||
"Only update records matching conditions": "Обновлять только записи, соответствующие условиям",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Поля, которым не присвоено значение, будут установлены на значение по умолчанию, а поля, не имеющие значения по умолчанию, будут установлены на null.",
|
||||
"Trigger in executed workflow cannot be modified": "Триггер в выполняемом рабочем процессе не может быть изменен",
|
||||
"Node in executed workflow cannot be modified": "Узел в выполняемом рабочем процессе не может быть изменен",
|
||||
};
|
89
packages/plugins/workflow/src/client/locale/tr-TR.ts
Normal file
89
packages/plugins/workflow/src/client/locale/tr-TR.ts
Normal file
@ -0,0 +1,89 @@
|
||||
export default {
|
||||
"Workflow": "İş Akışı",
|
||||
"Execution history": "Yürütme Geçmişi",
|
||||
"Trigger type": "Tetikleme türü",
|
||||
"Description": "Açıklama",
|
||||
"Status": "Durum",
|
||||
"On": "Aç",
|
||||
"Off": "Kapa",
|
||||
"Version": "Sürüm",
|
||||
"Copy to new version": "Yeni sürüme kopyala",
|
||||
"Load failed": "Yükleme başarısız",
|
||||
"Trigger": "Tetikle",
|
||||
"Collection event": "Koleksiyon etkinliği",
|
||||
"Trigger on": "Tetikleme açık",
|
||||
"After record added": "Kayıt eklendikten sonra",
|
||||
"After record updated": "Kayıt güncellendikten sonra",
|
||||
"After record added or updated": "Kayıt eklendikten veya güncellendikten sonra",
|
||||
"After record deleted": "Kayıt silindikten sonra",
|
||||
"Changed fields": "Değiştirilen alanlar",
|
||||
"Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Yalnızca seçilen alanlardan biri değiştiğinde tetiklenir. Seçili değilse, herhangi bir alan değiştiğinde tetikleneceği anlamına gelir. Kayıt eklendiğinde veya silindiğinde, herhangi bir alan değiştirilmiş olarak kabul edilir.",
|
||||
"Only triggers when match conditions": "Yalnızca eşleşme koşulları olduğunda tetiklenir",
|
||||
"Schedule event": "Etkinlik planla",
|
||||
"Trigger mode": "Tetikleme modu",
|
||||
"Based on certain date": "Belirli bir tarihe göre",
|
||||
"Based on date field of collection": "Koleksiyonun tarih alanına göre",
|
||||
"Starts on": "Başlangıç",
|
||||
"Ends on": "Bitiş",
|
||||
"Exactly at": "Tam zamanı",
|
||||
"Repeat mode": "Tekrarlama modu",
|
||||
"Repeat limit": "Tekrarlama limiti",
|
||||
"No limit": "Limit yok",
|
||||
"Seconds": "Saniye",
|
||||
"Minutes": "Dakika",
|
||||
"Hours": "Saat",
|
||||
"Days": "Gün",
|
||||
"Weeks": "Hafta",
|
||||
"Months": "Ay",
|
||||
"No repeat": "Tekrar yok",
|
||||
"Every": "Her",
|
||||
"By minute": "Dakikada",
|
||||
"By hour": "Saatte",
|
||||
"By day": "Günde",
|
||||
"By week": "Haftada",
|
||||
"By month": "Ayda",
|
||||
"By field": "Alanda",
|
||||
"By custom date": "Özel tarihe göre",
|
||||
"Advanced": "Gelişmiş",
|
||||
"Advanced type": "Gelişmiş",
|
||||
"End": "Son",
|
||||
"Trigger context": "Tetikleyici bağlamı",
|
||||
"Node result": "Düğüm sonucu",
|
||||
"Constant": "Devamlı",
|
||||
"Boolean": "Boolean",
|
||||
"String": "String",
|
||||
"Arithmetic calculation": "Aritmetik hesaplama",
|
||||
"String operation": "String operation",
|
||||
"On going": "Devam eden",
|
||||
"Succeeded": "Başarılı",
|
||||
"Failed": "Başarısız",
|
||||
"Canceled": "İptal edilen",
|
||||
"This node contains branches, deleting will also be preformed to them, are you sure?": "Bu düğüm başka içeriklerle bağlantı içeriyor, silme işlemini onaylarsanız o bağlantılarda silinecek, emin misiniz?",
|
||||
"Control": "Kontrol",
|
||||
"Collection operations": "Koleksiyon operasyonları",
|
||||
"Node type": "Düğüm türü",
|
||||
"Calculation": "Hesaplama",
|
||||
"Configure calculation": "Hesaplamayı yapılandır",
|
||||
"Calculation result": "Hesaplama sonucu",
|
||||
"True": "Doğru",
|
||||
"False": "Yanlış",
|
||||
"Condition": "Koşul",
|
||||
"Mode": "Tür",
|
||||
"Continue when \"Yes\"": "\"Evet\" durumunda devam",
|
||||
"Branch into \"Yes\" and \"No\"": "\"Evet\" ve \"Hayır\" olarak dallandırın",
|
||||
"Conditions": "Koşullar",
|
||||
"Parallel branch": "Paralel dal",
|
||||
"All succeeded": "Hepsi başarılı",
|
||||
"Any succeeded": "Herhangi biri başarılı",
|
||||
"Continue after all branches succeeded": "Tüm dallar başarılı olduktan sonra devam et",
|
||||
"Continue after any branch succeeded": "Herhangi bir dal başarılı olduktan sonra devam et",
|
||||
"Create record": "Kayıt oluştur",
|
||||
"Update record": "Kayıt güncelle",
|
||||
"Query record": "Sorgu kaydı",
|
||||
"Multiple records": "Birden çok kayıt",
|
||||
"Please select collection first": "Lütfen önce koleksiyonu seçin",
|
||||
"Only update records matching conditions": "Yalnızca koşullarla eşleşen kayıtları güncelleyin",
|
||||
"Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Değer atanmamış alanlar varsayılan değere, varsayılan değeri olmayan alanlar ise null olarak ayarlanır.",
|
||||
"Trigger in executed workflow cannot be modified": "Yürütülen iş akışındaki tetikleyici değiştirilemez",
|
||||
"Node in executed workflow cannot be modified": "Yürütülen iş akışındaki düğüm değiştirilemez",
|
||||
};
|
129
packages/plugins/workflow/src/client/locale/zh-CN.ts
Normal file
129
packages/plugins/workflow/src/client/locale/zh-CN.ts
Normal file
@ -0,0 +1,129 @@
|
||||
export default {
|
||||
'Workflow': '工作流',
|
||||
'Execution history': '执行历史',
|
||||
'Trigger type': '触发方式',
|
||||
'Description': '描述',
|
||||
'Status': '状态',
|
||||
'On': '启用',
|
||||
'Off': '停用',
|
||||
'Version': '版本',
|
||||
'Copy to new version': '复制到新版本',
|
||||
|
||||
'Loading': '加载中',
|
||||
'Load failed': '加载失败',
|
||||
|
||||
'Trigger': '触发器',
|
||||
'Trigger context': '触发数据',
|
||||
'Trigger data': '触发数据',
|
||||
'Trigger time': '触发时间',
|
||||
'Triggered at': '触发时间',
|
||||
'Collection event': '数据表事件',
|
||||
'Trigger on': '触发时机',
|
||||
'After record added': '新增数据后',
|
||||
'After record updated': '更新数据后',
|
||||
'After record added or updated': '新增或更新数据后',
|
||||
'After record deleted': '删除数据后',
|
||||
'Changed fields': '发生变动的字段',
|
||||
'Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.': '只有被选中的某个字段发生变动时才会触发。如果不选择,则表示任何字段变动时都会触发。新增或删除数据时,任意字段都被认为发生变动。',
|
||||
'Only triggers when match conditions': '满足以下条件才触发',
|
||||
|
||||
'Schedule event': '定时任务',
|
||||
'Trigger mode': '触发模式',
|
||||
'Based on certain date': '自定义时间',
|
||||
'Based on date field of collection': '根据数据表时间字段',
|
||||
'Starts on': '开始于',
|
||||
'Ends on': '结束于',
|
||||
'Exactly at': '当时',
|
||||
'Repeat mode': '重复模式',
|
||||
'Repeat limit': '重复次数',
|
||||
'No limit': '不限',
|
||||
'Seconds': '秒',
|
||||
'Minutes': '分钟',
|
||||
'Hours': '小时',
|
||||
'Days': '天',
|
||||
'Weeks': '周',
|
||||
'Months': '月',
|
||||
|
||||
'No repeat': '不重复',
|
||||
'Every': '每',
|
||||
|
||||
'By minute': '按分钟',
|
||||
'By hour': '按小时',
|
||||
'By day': '按天',
|
||||
'By week': '按周',
|
||||
'By month': '按月',
|
||||
|
||||
'By field': '数据表字段',
|
||||
'By custom date': '自定义时间',
|
||||
|
||||
'Advanced': '高级模式',
|
||||
'Advanced type': '高级类型',
|
||||
|
||||
'End': '结束',
|
||||
|
||||
'Node result': '节点数据',
|
||||
'Constant': '常量',
|
||||
|
||||
'Boolean': '逻辑值',
|
||||
'String': '字符串',
|
||||
|
||||
'Calculator': '运算',
|
||||
'Arithmetic calculation': '算术运算',
|
||||
'String operation': '字符串',
|
||||
|
||||
'Executed at': '执行于',
|
||||
|
||||
'Queueing': '队列中',
|
||||
'On going': '进行中',
|
||||
'Succeeded': '成功',
|
||||
'Failed': '失败',
|
||||
'Pending': '等待处理',
|
||||
'Canceled': '已取消',
|
||||
|
||||
'This node contains branches, deleting will also be preformed to them, are you sure?': '节点包含分支,将同时删除其所有分支下的子节点,确定继续?',
|
||||
|
||||
'Control': '流程控制',
|
||||
'Collection operations': '数据表操作',
|
||||
'Extended types': '扩展类型',
|
||||
|
||||
'Node type': '节点类型',
|
||||
|
||||
'Calculation': '运算',
|
||||
'Configure calculation': '配置运算',
|
||||
'Calculation result': '运算结果',
|
||||
'True': '真',
|
||||
'False': '假',
|
||||
'concat': '连接',
|
||||
|
||||
'Condition': '条件判断',
|
||||
'Mode': '模式',
|
||||
'Continue when "Yes"': '“是”则继续',
|
||||
'Branch into "Yes" and "No"': '“是”和“否”分别继续',
|
||||
'Conditions': '条件配置',
|
||||
|
||||
'Parallel branch': '分支',
|
||||
'Add branch': '增加分支',
|
||||
'All succeeded': '全部成功',
|
||||
'Any succeeded': '任意成功',
|
||||
'Any succeeded or failed': '任意成功或失败',
|
||||
'Continue after all branches succeeded': '全部分支都成功后才能继续',
|
||||
'Continue after any branch succeeded': '任意分支成功后就继续',
|
||||
'Continue after any branch succeeded, or exit after any branch failed': '任意分支成功继续,或失败后退出',
|
||||
|
||||
'Delay': '延时',
|
||||
'Duration': '时长',
|
||||
'End Status': '到时状态',
|
||||
'Select status': '选择状态',
|
||||
'Succeed and continue': '通过并继续',
|
||||
'Fail and exit': '失败并退出',
|
||||
|
||||
'Create record': '新增数据',
|
||||
'Update record': '更新数据',
|
||||
'Query record': '查询数据',
|
||||
'Multiple records': '多条数据',
|
||||
'Please select collection first': '请先选择数据表',
|
||||
'Only update records matching conditions': '只更新满足条件的数据',
|
||||
'Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.': '未被赋值的字段将被设置为默认值,没有默认值的设置为空值。',
|
||||
'Trigger in executed workflow cannot be modified': '已经执行过工作流的触发器不能被修改',
|
||||
'Node in executed workflow cannot be modified': '已经执行过工作流中的节点不能被修改',
|
||||
};
|
@ -3,15 +3,16 @@ import { css } from '@emotion/css';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { Calculation } from '../calculators';
|
||||
import { NAMESPACE, useWorkflowTranslation } from '../locale';
|
||||
|
||||
export default {
|
||||
title: '{{t("Calculation")}}',
|
||||
title: `{{t("Calculation", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'calculation',
|
||||
group: 'control',
|
||||
fieldset: {
|
||||
'config.calculation': {
|
||||
type: 'object',
|
||||
title: '{{t("Configure calculation")}}',
|
||||
title: `{{t("Configure calculation", { ns: "${NAMESPACE}" })}}`,
|
||||
name: 'config.calculation',
|
||||
required: true,
|
||||
'x-decorator': 'FormItem',
|
||||
@ -29,7 +30,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getter() {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
return <div className={css`flex-shrink: 0`}>{t('Calculation result')}</div>;
|
||||
}
|
||||
};
|
||||
|
@ -11,6 +11,7 @@ import { Branch } from "../Branch";
|
||||
import { useFlowContext } from '../FlowContext';
|
||||
import { branchBlockClass, nodeSubtreeClass } from "../style";
|
||||
import { Calculation } from "../calculators";
|
||||
import { lang, NAMESPACE } from "../locale";
|
||||
|
||||
|
||||
|
||||
@ -140,14 +141,14 @@ function CalculationConfig({ value, onChange }) {
|
||||
}
|
||||
|
||||
export default {
|
||||
title: '{{t("Condition")}}',
|
||||
title: `{{t("Condition", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'condition',
|
||||
group: 'control',
|
||||
fieldset: {
|
||||
'config.rejectOnFalse': {
|
||||
type: 'boolean',
|
||||
name: 'config.rejectOnFalse',
|
||||
title: '{{t("Mode")}}',
|
||||
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Radio.Group',
|
||||
'x-component-props': {
|
||||
@ -156,18 +157,18 @@ export default {
|
||||
enum: [
|
||||
{
|
||||
value: true,
|
||||
label: i18n.t('Continue when "Yes"')
|
||||
label: lang('Continue when "Yes"')
|
||||
},
|
||||
{
|
||||
value: false,
|
||||
label: i18n.t('Branch into "Yes" and "No"')
|
||||
label: lang('Branch into "Yes" and "No"')
|
||||
}
|
||||
],
|
||||
},
|
||||
'config.calculation': {
|
||||
type: 'string',
|
||||
name: 'config.calculation',
|
||||
title: '{{t("Conditions")}}',
|
||||
title: `{{t("Conditions", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'CalculationConfig',
|
||||
}
|
||||
@ -176,8 +177,8 @@ export default {
|
||||
|
||||
},
|
||||
options: [
|
||||
{ label: i18n.t('Continue when "Yes"'), key: 'rejectOnFalse', value: { rejectOnFalse: true } },
|
||||
{ label: i18n.t('Branch into "Yes" and "No"'), key: 'branch', value: { rejectOnFalse: false } }
|
||||
{ label: lang('Continue when "Yes"'), key: 'rejectOnFalse', value: { rejectOnFalse: true } },
|
||||
{ label: lang('Branch into "Yes" and "No"'), key: 'branch', value: { rejectOnFalse: false } }
|
||||
],
|
||||
render(data) {
|
||||
const { id, config: { rejectOnFalse } } = data;
|
||||
@ -216,8 +217,8 @@ export default {
|
||||
}
|
||||
`}
|
||||
>
|
||||
<span className={css`right: 4em;`}>{i18n.t('No')}</span>
|
||||
<span className={css`left: 4em;`}>{i18n.t('Yes')}</span>
|
||||
<span className={css`right: 4em;`}>{lang('No')}</span>
|
||||
<span className={css`left: 4em;`}>{lang('Yes')}</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
@ -5,11 +5,12 @@ import { collection, values } from '../schemas/collection';
|
||||
import { useFlowContext } from '../FlowContext';
|
||||
import CollectionFieldSelect from '../components/CollectionFieldSelect';
|
||||
import CollectionFieldset from '../components/CollectionFieldset';
|
||||
import { NAMESPACE } from '../locale';
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
title: '{{t("Create record")}}',
|
||||
title: `{{t("Create record", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'create',
|
||||
group: 'collection',
|
||||
fieldset: {
|
||||
|
@ -1,14 +1,15 @@
|
||||
import Duration from "../components/Duration";
|
||||
import { NAMESPACE } from "../locale";
|
||||
|
||||
export default {
|
||||
title: '{{t("Delay")}}',
|
||||
title: `{{t("Delay", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'delay',
|
||||
group: 'control',
|
||||
fieldset: {
|
||||
'config.duration': {
|
||||
type: 'number',
|
||||
name: 'config.duration',
|
||||
title: '{{t("Duration")}}',
|
||||
title: `{{t("Duration", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Duration',
|
||||
default: 60000
|
||||
@ -16,15 +17,15 @@ export default {
|
||||
'config.endStatus': {
|
||||
type: 'number',
|
||||
name: 'config.endStatus',
|
||||
title: '{{t("End Status")}}',
|
||||
title: `{{t("End Status", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
'x-component-props': {
|
||||
placeholder: '{{t("Select status")}}',
|
||||
placeholder: `{{t("Select status", { ns: "${NAMESPACE}" })}}`,
|
||||
},
|
||||
enum: [
|
||||
{ label: '{{t("Succeed and continue")}}', value: 1 },
|
||||
{ label: '{{t("Fail and exit")}}', value: -1 },
|
||||
{ label: `{{t("Succeed and continue", { ns: "${NAMESPACE}" })}}`, value: 1 },
|
||||
{ label: `{{t("Fail and exit", { ns: "${NAMESPACE}" })}}`, value: -1 },
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -24,6 +24,7 @@ import create from './create';
|
||||
import update from './update';
|
||||
import destroy from './destroy';
|
||||
import { JobStatusOptions, JobStatusOptionsMap } from '../constants';
|
||||
import { lang, NAMESPACE } from '../locale';
|
||||
|
||||
export interface Instruction {
|
||||
title: string;
|
||||
@ -52,7 +53,6 @@ instructions.register('update', update);
|
||||
instructions.register('destroy', destroy);
|
||||
|
||||
function useUpdateAction() {
|
||||
const { t } = useTranslation();
|
||||
const form = useForm();
|
||||
const api = useAPIClient();
|
||||
const ctx = useActionContext();
|
||||
@ -62,7 +62,7 @@ function useUpdateAction() {
|
||||
return {
|
||||
async run() {
|
||||
if (workflow.executed) {
|
||||
message.error(t('Node in executed workflow cannot be modified'));
|
||||
message.error(lang('Node in executed workflow cannot be modified'));
|
||||
return;
|
||||
}
|
||||
// TODO: how to do validation separately for each field? especially disabled for dynamic fields?
|
||||
@ -87,7 +87,6 @@ export function useNodeContext() {
|
||||
}
|
||||
|
||||
export function Node({ data }) {
|
||||
|
||||
const instruction = instructions.get(data.type);
|
||||
|
||||
return (
|
||||
@ -147,8 +146,8 @@ export function RemoveButton() {
|
||||
|
||||
const hasBranches = !nodes.find(item => item.upstream === current && item.branchIndex != null);
|
||||
const message = hasBranches
|
||||
? t('Are you sure you want to delete it?')
|
||||
: t('This node contains branches, deleting will also be preformed to them, are you sure?');
|
||||
? lang('Are you sure you want to delete it?')
|
||||
: lang('This node contains branches, deleting will also be preformed to them, are you sure?');
|
||||
|
||||
Modal.confirm({
|
||||
title: t('Delete'),
|
||||
@ -171,7 +170,6 @@ export function RemoveButton() {
|
||||
}
|
||||
|
||||
export function JobButton() {
|
||||
const { t } = useTranslation();
|
||||
const compile = useCompile();
|
||||
const { execution } = useFlowContext();
|
||||
const { id, type, title, job } = useNodeContext() ?? {};
|
||||
@ -229,7 +227,7 @@ export function JobButton() {
|
||||
properties: {
|
||||
status: {
|
||||
type: 'number',
|
||||
title: '{{t("Status")}}',
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
enum: JobStatusOptions,
|
||||
@ -237,7 +235,7 @@ export function JobButton() {
|
||||
},
|
||||
updatedAt: {
|
||||
type: 'string',
|
||||
title: '{{t("Executed at")}}',
|
||||
title: `{{t("Executed at", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {
|
||||
@ -247,7 +245,7 @@ export function JobButton() {
|
||||
},
|
||||
result: {
|
||||
type: 'object',
|
||||
title: '{{t("Node result")}}',
|
||||
title: `{{t("Node result", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Input.JSON',
|
||||
'x-component-props': {
|
||||
|
@ -10,18 +10,19 @@ import { NodeDefaultView } from ".";
|
||||
import { Branch } from "../Branch";
|
||||
import { useFlowContext } from '../FlowContext';
|
||||
import { branchBlockClass, nodeSubtreeClass } from "../style";
|
||||
import { lang, NAMESPACE } from "../locale";
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
title: '{{t("Parallel branch")}}',
|
||||
title: `{{t("Parallel branch", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'parallel',
|
||||
group: 'control',
|
||||
fieldset: {
|
||||
'config.mode': {
|
||||
type: 'string',
|
||||
name: 'config.mode',
|
||||
title: '{{t("Mode")}}',
|
||||
title: `{{t("Mode", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Radio.Group',
|
||||
'x-component-props': {
|
||||
@ -31,10 +32,10 @@ export default {
|
||||
value: 'all',
|
||||
label: (
|
||||
<Tooltip
|
||||
title={i18n.t('Continue after all branches succeeded')}
|
||||
title={lang('Continue after all branches succeeded')}
|
||||
placement="bottom"
|
||||
>
|
||||
{i18n.t('All succeeded')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
{lang('All succeeded')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
</Tooltip>
|
||||
)
|
||||
},
|
||||
@ -42,10 +43,10 @@ export default {
|
||||
value: 'any',
|
||||
label: (
|
||||
<Tooltip
|
||||
title={i18n.t('Continue after any branch succeeded')}
|
||||
title={lang('Continue after any branch succeeded')}
|
||||
placement="bottom"
|
||||
>
|
||||
{i18n.t('Any succeeded')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
{lang('Any succeeded')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
</Tooltip>
|
||||
)
|
||||
},
|
||||
@ -53,10 +54,10 @@ export default {
|
||||
value: 'race',
|
||||
label: (
|
||||
<Tooltip
|
||||
title={i18n.t('Continue after any branch succeeded, or exit after any branch failed')}
|
||||
title={lang('Continue after any branch succeeded, or exit after any branch failed')}
|
||||
placement="bottom"
|
||||
>
|
||||
{i18n.t('Any succeeded or failed')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
{lang('Any succeeded or failed')} <QuestionCircleOutlined style={{ color: '#999' }} />
|
||||
</Tooltip>
|
||||
)
|
||||
},
|
||||
@ -69,7 +70,6 @@ export default {
|
||||
},
|
||||
render(data) {
|
||||
const { id, config: { mode } } = data;
|
||||
const { t } = useTranslation();
|
||||
const { nodes } = useFlowContext();
|
||||
const branches = nodes.reduce((result, node) => {
|
||||
if (node.upstreamId === id && node.branchIndex != null) {
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
height: 2em;
|
||||
`}
|
||||
>
|
||||
<Tooltip title={t('Add branch')}>
|
||||
<Tooltip title={lang('Add branch')}>
|
||||
<Button
|
||||
icon={<PlusOutlined />}
|
||||
className={css`
|
||||
|
@ -6,18 +6,19 @@ import { useFlowContext } from '../FlowContext';
|
||||
import { VariableComponent } from '../calculators';
|
||||
import { collection, filter } from '../schemas/collection';
|
||||
import CollectionFieldSelect from '../components/CollectionFieldSelect';
|
||||
import { NAMESPACE } from '../locale';
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
title: '{{t("Query record")}}',
|
||||
title: `{{t("Query record", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'query',
|
||||
group: 'collection',
|
||||
fieldset: {
|
||||
'config.collection': collection,
|
||||
'config.multiple': {
|
||||
type: 'boolean',
|
||||
title: '{{t("Multiple records")}}',
|
||||
title: `{{t("Multiple records", { ns: "${NAMESPACE}" })}}`,
|
||||
name: 'config.multiple',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Checkbox',
|
||||
|
@ -2,19 +2,20 @@ import { useCollectionDataSource } from '@nocobase/client';
|
||||
|
||||
import { VariableComponent } from '../calculators';
|
||||
import CollectionFieldset from '../components/CollectionFieldset';
|
||||
import { NAMESPACE } from '../locale';
|
||||
import { collection, filter, values } from '../schemas/collection';
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
title: '{{t("Update record")}}',
|
||||
title: `{{t("Update record", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'update',
|
||||
group: 'collection',
|
||||
fieldset: {
|
||||
'config.collection': collection,
|
||||
'config.params.filter': {
|
||||
...filter,
|
||||
title: '{{t("Only update records matching conditions")}}',
|
||||
title: `{{t("Only update records matching conditions", { ns: "${NAMESPACE}" })}}`,
|
||||
},
|
||||
'config.params.values': values
|
||||
},
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { css } from "@emotion/css";
|
||||
import { useForm } from "@formily/react";
|
||||
import { useCollectionFilterOptions } from "@nocobase/client";
|
||||
import { NAMESPACE } from "../locale";
|
||||
|
||||
export const collection = {
|
||||
type: 'string',
|
||||
@ -27,7 +28,7 @@ export const values = {
|
||||
`
|
||||
},
|
||||
'x-component': 'CollectionFieldset',
|
||||
description: '{{t("Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.")}}',
|
||||
description: `{{t("Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.", { ns: "${NAMESPACE}" })}}`,
|
||||
};
|
||||
|
||||
export const filter = {
|
||||
|
@ -3,8 +3,9 @@ import { ISchema } from '@formily/react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useActionContext } from '@nocobase/client';
|
||||
import { ExecutionStatusOptions } from '../constants';
|
||||
import { NAMESPACE } from '../locale';
|
||||
|
||||
const collection = {
|
||||
export const executionCollection = {
|
||||
name: 'executions',
|
||||
fields: [
|
||||
{
|
||||
@ -14,7 +15,7 @@ const collection = {
|
||||
name: 'createdAt',
|
||||
uiSchema: {
|
||||
type: 'datetime',
|
||||
title: '{{t("Triggered at")}}',
|
||||
title: `{{t("Triggered at", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {},
|
||||
'x-read-pretty': true,
|
||||
@ -26,7 +27,7 @@ const collection = {
|
||||
name: 'workflowId',
|
||||
uiSchema: {
|
||||
type: 'number',
|
||||
title: '{{t("Version")}}',
|
||||
title: `{{t("Version", { ns: "${NAMESPACE}" })}}`,
|
||||
['x-component']({ value }) {
|
||||
const { setVisible } = useActionContext();
|
||||
return <Link to={`/admin/settings/workflow/workflows/${value}`} onClick={() => setVisible(false)}>{`#${value}`}</Link>;
|
||||
@ -38,7 +39,7 @@ const collection = {
|
||||
name: 'status',
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: '{{t("Status")}}',
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-component': 'Select',
|
||||
'x-decorator': 'FormItem',
|
||||
@ -49,106 +50,108 @@ const collection = {
|
||||
};
|
||||
|
||||
export const executionSchema = {
|
||||
provider: {
|
||||
type: 'void',
|
||||
'x-decorator': 'ExecutionResourceProvider',
|
||||
'x-decorator-props': {
|
||||
collection,
|
||||
resourceName: 'executions',
|
||||
request: {
|
||||
resource: 'executions',
|
||||
action: 'list',
|
||||
params: {
|
||||
appends: ['workflow.id', 'workflow.title'],
|
||||
pageSize: 50,
|
||||
sort: ['-createdAt'],
|
||||
type: 'void',
|
||||
title: `{{t("Execution history", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'Action.Drawer',
|
||||
properties: {
|
||||
content: {
|
||||
type: 'void',
|
||||
'x-decorator': 'ExecutionResourceProvider',
|
||||
'x-decorator-props': {
|
||||
collection: executionCollection,
|
||||
resourceName: 'executions',
|
||||
request: {
|
||||
resource: 'executions',
|
||||
action: 'list',
|
||||
params: {
|
||||
appends: ['workflow.id', 'workflow.title'],
|
||||
pageSize: 50,
|
||||
sort: ['-createdAt'],
|
||||
filter: {}
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'x-component': 'CollectionProvider',
|
||||
'x-component-props': {
|
||||
collection,
|
||||
},
|
||||
properties: {
|
||||
actions: {
|
||||
type: 'void',
|
||||
'x-component': 'ActionBar',
|
||||
'x-component-props': {
|
||||
style: {
|
||||
marginBottom: 16,
|
||||
properties: {
|
||||
actions: {
|
||||
type: 'void',
|
||||
'x-component': 'ActionBar',
|
||||
'x-component-props': {
|
||||
style: {
|
||||
marginBottom: 16,
|
||||
},
|
||||
},
|
||||
properties: {
|
||||
// filter: {
|
||||
// type: 'object',
|
||||
// 'x-component': 'Filter',
|
||||
// }
|
||||
}
|
||||
},
|
||||
properties: {
|
||||
// filter: {
|
||||
// type: 'object',
|
||||
// 'x-component': 'Filter',
|
||||
// }
|
||||
}
|
||||
},
|
||||
table: {
|
||||
type: 'void',
|
||||
'x-component': 'Table.Void',
|
||||
'x-component-props': {
|
||||
rowKey: 'id',
|
||||
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
||||
},
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'datetime',
|
||||
'x-component': 'CollectionField',
|
||||
'x-component-props': {
|
||||
showTime: true
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
table: {
|
||||
type: 'void',
|
||||
'x-component': 'Table.Void',
|
||||
'x-component-props': {
|
||||
rowKey: 'id',
|
||||
useDataSource: '{{ cm.useDataSourceFromRAC }}',
|
||||
},
|
||||
workflowId: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
workflowId: {
|
||||
type: 'number',
|
||||
'x-component': 'CollectionField',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
},
|
||||
status: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
status: {
|
||||
type: 'number',
|
||||
'x-component': 'CollectionField',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
type: 'void',
|
||||
title: '{{ t("Actions") }}',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
actions: {
|
||||
type: 'void',
|
||||
'x-component': 'Space',
|
||||
'x-component-props': {
|
||||
split: '|',
|
||||
},
|
||||
properties: {
|
||||
config: {
|
||||
type: 'void',
|
||||
title: '{{t("Details")}}',
|
||||
'x-component': 'ExecutionLink'
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
createdAt: {
|
||||
type: 'datetime',
|
||||
'x-component': 'CollectionField',
|
||||
'x-component-props': {
|
||||
showTime: true
|
||||
},
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
},
|
||||
workflowId: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
workflowId: {
|
||||
type: 'number',
|
||||
'x-component': 'CollectionField',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
},
|
||||
status: {
|
||||
type: 'void',
|
||||
'x-decorator': 'Table.Column.Decorator',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
status: {
|
||||
type: 'number',
|
||||
'x-component': 'CollectionField',
|
||||
'x-read-pretty': true,
|
||||
},
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
type: 'void',
|
||||
title: '{{ t("Actions") }}',
|
||||
'x-component': 'Table.Column',
|
||||
properties: {
|
||||
actions: {
|
||||
type: 'void',
|
||||
'x-component': 'Space',
|
||||
'x-component-props': {
|
||||
split: '|',
|
||||
},
|
||||
properties: {
|
||||
config: {
|
||||
type: 'void',
|
||||
title: `{{t("Details", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'ExecutionLink'
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { ISchema } from '@formily/react';
|
||||
import { NAMESPACE } from '../locale';
|
||||
import { triggers } from '../triggers';
|
||||
import { executionSchema } from './executions';
|
||||
|
||||
@ -23,7 +24,7 @@ const collection = {
|
||||
name: 'type',
|
||||
interface: 'select',
|
||||
uiSchema: {
|
||||
title: '{{t("Trigger type")}}',
|
||||
title: `{{t("Trigger type", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
'x-component': 'Select',
|
||||
'x-decorator': 'FormItem',
|
||||
@ -50,11 +51,11 @@ const collection = {
|
||||
name: 'enabled',
|
||||
interface: 'radio',
|
||||
uiSchema: {
|
||||
title: '{{t("Status")}}',
|
||||
title: `{{t("Status", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: '{{t("On")}}', value: true, color: '#52c41a' },
|
||||
{ label: '{{t("Off")}}', value: false },
|
||||
{ label: `{{t("On", { ns: "${NAMESPACE}" })}}`, value: true, color: '#52c41a' },
|
||||
{ label: `{{t("Off", { ns: "${NAMESPACE}" })}}`, value: false },
|
||||
],
|
||||
'x-component': 'Radio.Group',
|
||||
'x-decorator': 'FormItem',
|
||||
@ -81,7 +82,7 @@ export const workflowSchema: ISchema = {
|
||||
filter: {
|
||||
current: true
|
||||
},
|
||||
sort: ['createdAt'],
|
||||
sort: ['-enabled', '-createdAt'],
|
||||
except: ['config'],
|
||||
},
|
||||
},
|
||||
@ -236,18 +237,13 @@ export const workflowSchema: ISchema = {
|
||||
},
|
||||
executions: {
|
||||
type: 'void',
|
||||
title: '{{t("Execution history")}}',
|
||||
title: `{{t("Execution history", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-component': 'Action.Link',
|
||||
'x-component-props': {
|
||||
type: 'primary',
|
||||
},
|
||||
properties: {
|
||||
drawer: {
|
||||
type: 'void',
|
||||
title: '{{t("Execution history")}}',
|
||||
'x-component': 'Action.Drawer',
|
||||
properties: executionSchema
|
||||
}
|
||||
drawer: executionSchema
|
||||
}
|
||||
},
|
||||
update: {
|
||||
|
@ -9,6 +9,7 @@ import { collection, filter } from '../schemas/collection';
|
||||
import { css } from '@emotion/css';
|
||||
import { onFieldValueChange } from '@formily/core';
|
||||
import CollectionFieldSelect from '../components/CollectionFieldSelect';
|
||||
import { NAMESPACE } from '../locale';
|
||||
|
||||
const FieldsSelect = observer((props) => {
|
||||
const compile = useCompile();
|
||||
@ -50,16 +51,16 @@ const COLLECTION_TRIGGER_MODE = {
|
||||
};
|
||||
|
||||
const collectionModeOptions = [
|
||||
{ label: '{{t("After record added")}}', value: COLLECTION_TRIGGER_MODE.CREATED },
|
||||
{ label: '{{t("After record updated")}}', value: COLLECTION_TRIGGER_MODE.UPDATED },
|
||||
{ label: '{{t("After record added or updated")}}', value: COLLECTION_TRIGGER_MODE.SAVED },
|
||||
{ label: '{{t("After record deleted")}}', value: COLLECTION_TRIGGER_MODE.DELETED },
|
||||
{ label: `{{t("After record added", { ns: "${NAMESPACE}" })}}`, value: COLLECTION_TRIGGER_MODE.CREATED },
|
||||
{ label: `{{t("After record updated", { ns: "${NAMESPACE}" })}}`, value: COLLECTION_TRIGGER_MODE.UPDATED },
|
||||
{ label: `{{t("After record added or updated", { ns: "${NAMESPACE}" })}}`, value: COLLECTION_TRIGGER_MODE.SAVED },
|
||||
{ label: `{{t("After record deleted", { ns: "${NAMESPACE}" })}}`, value: COLLECTION_TRIGGER_MODE.DELETED },
|
||||
];
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
title: '{{t("Collection event")}}',
|
||||
title: `{{t("Collection event", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'collection',
|
||||
fieldset: {
|
||||
'config.collection': {
|
||||
@ -94,13 +95,13 @@ export default {
|
||||
},
|
||||
'config.mode': {
|
||||
type: 'number',
|
||||
title: '{{t("Trigger on")}}',
|
||||
title: `{{t("Trigger on", { ns: "${NAMESPACE}" })}}`,
|
||||
name: 'config.mode',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Select',
|
||||
'x-component-props': {
|
||||
options: collectionModeOptions,
|
||||
placeholder: '{{t("Trigger on")}}'
|
||||
placeholder: `{{t("Trigger on", { ns: "${NAMESPACE}" })}}`
|
||||
},
|
||||
required: true,
|
||||
'x-reactions': [
|
||||
@ -117,8 +118,8 @@ export default {
|
||||
'config.changed': {
|
||||
type: 'array',
|
||||
name: 'changed',
|
||||
title: '{{t("Changed fields")}}',
|
||||
description: '{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.")}}',
|
||||
title: `{{t("Changed fields", { ns: "${NAMESPACE}" })}}`,
|
||||
description: `{{t("Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'FieldsSelect',
|
||||
'x-component-props': {
|
||||
@ -129,7 +130,7 @@ export default {
|
||||
'config.condition': {
|
||||
...filter,
|
||||
name: 'config.condition',
|
||||
title: '{{t("Only triggers when match conditions")}}'
|
||||
title: `{{t("Only triggers when match conditions", { ns: "${NAMESPACE}" })}}`
|
||||
}
|
||||
},
|
||||
scope: {
|
||||
|
@ -12,6 +12,7 @@ import { nodeCardClass, nodeHeaderClass, nodeMetaClass, nodeTitleClass } from ".
|
||||
import { useFlowContext } from "../FlowContext";
|
||||
import collection from './collection';
|
||||
import schedule from "./schedule/";
|
||||
import { lang } from "../locale";
|
||||
|
||||
|
||||
function useUpdateConfigAction() {
|
||||
@ -138,13 +139,13 @@ export const TriggerConfig = () => {
|
||||
const { type, config, executed } = workflow;
|
||||
const { title, fieldset, scope, components } = triggers.get(type);
|
||||
const detailText = executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
||||
const titleText = `${t('Trigger')}: ${compile(title)}`;
|
||||
const titleText = `${lang('Trigger')}: ${compile(title)}`;
|
||||
|
||||
return (
|
||||
<div className={cx(nodeCardClass)}>
|
||||
<div className={cx(nodeHeaderClass)}>
|
||||
<div className={cx(nodeMetaClass)}>
|
||||
<Tag color="gold">{t('Trigger')}</Tag>
|
||||
<Tag color="gold">{lang('Trigger')}</Tag>
|
||||
</div>
|
||||
<h4>{compile(title)}</h4>
|
||||
<TriggerExecution />
|
||||
|
@ -2,14 +2,14 @@ import { css } from "@emotion/css";
|
||||
import { DatePicker, Select } from "antd";
|
||||
import moment from "moment";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useWorkflowTranslation } from "../../locale";
|
||||
|
||||
import { OnField } from "./OnField";
|
||||
|
||||
|
||||
|
||||
export function EndsByField({ value, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
const [type, setType] = useState(typeof value === 'object' && !(value instanceof Date) ? 'field' : 'date');
|
||||
|
||||
return (
|
||||
|
@ -4,11 +4,13 @@ import { InputNumber, Select } from "antd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { DateFieldsSelect } from "./DateFieldsSelect";
|
||||
import { useWorkflowTranslation } from "../../locale";
|
||||
|
||||
|
||||
|
||||
export function OnField({ value, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t: localT } = useWorkflowTranslation();
|
||||
const [dir, setDir] = useState(value.offset ? value.offset / Math.abs(value.offset) : 0);
|
||||
|
||||
return (
|
||||
@ -23,7 +25,7 @@ export function OnField({ value, onChange }) {
|
||||
setDir(v);
|
||||
onChange({ ...value, offset: Math.abs(value.offset) * v });
|
||||
}}>
|
||||
<Select.Option value={0}>{t('Exactly at')}</Select.Option>
|
||||
<Select.Option value={0}>{localT('Exactly at')}</Select.Option>
|
||||
<Select.Option value={-1}>{t('Before')}</Select.Option>
|
||||
<Select.Option value={1}>{t('After')}</Select.Option>
|
||||
</Select>
|
||||
@ -34,10 +36,10 @@ export function OnField({ value, onChange }) {
|
||||
<>
|
||||
<InputNumber value={Math.abs(value.offset)} onChange={(v) => onChange({ ...value, offset: v * dir })}/>
|
||||
<Select value={value.unit || 86400000} onChange={unit => onChange({ ...value, unit })}>
|
||||
<Select.Option value={86400000}>{t('Days')}</Select.Option>
|
||||
<Select.Option value={3600000}>{t('Hours')}</Select.Option>
|
||||
<Select.Option value={60000}>{t('Minutes')}</Select.Option>
|
||||
<Select.Option value={1000}>{t('Seconds')}</Select.Option>
|
||||
<Select.Option value={86400000}>{localT('Days')}</Select.Option>
|
||||
<Select.Option value={3600000}>{localT('Hours')}</Select.Option>
|
||||
<Select.Option value={60000}>{localT('Minutes')}</Select.Option>
|
||||
<Select.Option value={1000}>{localT('Seconds')}</Select.Option>
|
||||
</Select>
|
||||
</>
|
||||
)
|
||||
|
@ -3,6 +3,7 @@ import { InputNumber, Select } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Cron } from 'react-js-cron';
|
||||
import { useWorkflowTranslation } from "../../locale";
|
||||
import CronZhCN from './locale/Cron.zh-CN';
|
||||
|
||||
|
||||
@ -41,7 +42,7 @@ function getRepeatTypeValue(v) {
|
||||
|
||||
|
||||
function CommonRepeatField({ value, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
const option = getNumberOption(value);
|
||||
|
||||
return (
|
||||
@ -56,7 +57,7 @@ function CommonRepeatField({ value, onChange }) {
|
||||
}
|
||||
|
||||
export function RepeatField({ value = null, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
const typeValue = getRepeatTypeValue(value);
|
||||
function onTypeChange(v) {
|
||||
if (v === 'none') {
|
||||
|
@ -10,13 +10,14 @@ import { OnField } from './OnField';
|
||||
import { EndsByField } from './EndsByField';
|
||||
import { RepeatField } from './RepeatField';
|
||||
import { SCHEDULE_MODE } from './constants';
|
||||
import { NAMESPACE } from '../../locale';
|
||||
|
||||
const ModeFieldsets = {
|
||||
[SCHEDULE_MODE.STATIC]: {
|
||||
startsOn: {
|
||||
type: 'datetime',
|
||||
name: 'startsOn',
|
||||
title: '{{t("Starts on")}}',
|
||||
title: `{{t("Starts on", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {
|
||||
@ -27,7 +28,7 @@ const ModeFieldsets = {
|
||||
repeat: {
|
||||
type: 'string',
|
||||
name: 'repeat',
|
||||
title: '{{t("Repeat mode")}}',
|
||||
title: `{{t("Repeat mode", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'RepeatField',
|
||||
'x-reactions': [
|
||||
@ -52,7 +53,7 @@ const ModeFieldsets = {
|
||||
endsOn: {
|
||||
type: 'datetime',
|
||||
name: 'endsOn',
|
||||
title: '{{t("Ends on")}}',
|
||||
title: `{{t("Ends on", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'DatePicker',
|
||||
'x-component-props': {
|
||||
@ -62,11 +63,11 @@ const ModeFieldsets = {
|
||||
limit: {
|
||||
type: 'number',
|
||||
name: 'limit',
|
||||
title: '{{t("Repeat limit")}}',
|
||||
title: `{{t("Repeat limit", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'InputNumber',
|
||||
'x-component-props': {
|
||||
placeholder: '{{t("No limit")}}',
|
||||
placeholder: `{{t("No limit", { ns: "${NAMESPACE}" })}}`,
|
||||
min: 0
|
||||
}
|
||||
}
|
||||
@ -89,7 +90,7 @@ const ModeFieldsets = {
|
||||
},
|
||||
startsOn: {
|
||||
type: 'object',
|
||||
title: '{{t("Starts on")}}',
|
||||
title: `{{t("Starts on", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'OnField',
|
||||
'x-reactions': [
|
||||
@ -107,7 +108,7 @@ const ModeFieldsets = {
|
||||
repeat: {
|
||||
type: 'string',
|
||||
name: 'repeat',
|
||||
title: '{{t("Repeat mode")}}',
|
||||
title: `{{t("Repeat mode", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'RepeatField',
|
||||
'x-reactions': [
|
||||
@ -131,18 +132,18 @@ const ModeFieldsets = {
|
||||
},
|
||||
endsOn: {
|
||||
type: 'object',
|
||||
title: '{{t("Ends on")}}',
|
||||
title: `{{t("Ends on", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'EndsByField'
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
name: 'limit',
|
||||
title: '{{t("Repeat limit")}}',
|
||||
title: `{{t("Repeat limit", { ns: "${NAMESPACE}" })}}`,
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'InputNumber',
|
||||
'x-component-props': {
|
||||
placeholder: '{{t("No limit")}}',
|
||||
placeholder: `{{t("No limit", { ns: "${NAMESPACE}" })}}`,
|
||||
min: 0
|
||||
}
|
||||
}
|
||||
@ -150,9 +151,9 @@ const ModeFieldsets = {
|
||||
};
|
||||
|
||||
const scheduleModeOptions = [
|
||||
{ value: SCHEDULE_MODE.STATIC, label: '{{t("Based on certain date")}}' },
|
||||
{ value: SCHEDULE_MODE.COLLECTION_FIELD, label: '{{t("Based on date field of collection")}}' },
|
||||
]
|
||||
{ value: SCHEDULE_MODE.STATIC, label: `{{t("Based on certain date", { ns: "${NAMESPACE}" })}}` },
|
||||
{ value: SCHEDULE_MODE.COLLECTION_FIELD, label: `{{t("Based on date field of collection", { ns: "${NAMESPACE}" })}}` },
|
||||
];
|
||||
|
||||
export const ScheduleConfig = () => {
|
||||
const { values = {}, clearFormGraph } = useForm();
|
||||
@ -174,7 +175,7 @@ export const ScheduleConfig = () => {
|
||||
<SchemaComponent
|
||||
schema={{
|
||||
type: 'number',
|
||||
title: '{{t("Trigger mode")}}',
|
||||
title: `{{t("Trigger mode", { ns: "${NAMESPACE}" })}}`,
|
||||
name: 'mode',
|
||||
'x-decorator': 'FormItem',
|
||||
'x-component': 'Radio.Group',
|
||||
|
@ -1,6 +1,4 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { css } from '@emotion/css';
|
||||
import { Cascader } from 'antd';
|
||||
|
||||
import { useCompile, useCollectionDataSource, useCollectionManager } from '@nocobase/client';
|
||||
@ -9,9 +7,10 @@ import { ScheduleConfig } from './ScheduleConfig';
|
||||
import { useFlowContext } from '../../FlowContext';
|
||||
import { BaseTypeSet } from '../../calculators';
|
||||
import { SCHEDULE_MODE } from './constants';
|
||||
import { NAMESPACE, useWorkflowTranslation } from '../../locale';
|
||||
|
||||
export default {
|
||||
title: '{{t("Schedule event")}}',
|
||||
title: `{{t("Schedule event", { ns: "${NAMESPACE}" })}}`,
|
||||
type: 'schedule',
|
||||
fieldset: {
|
||||
config: {
|
||||
@ -29,7 +28,7 @@ export default {
|
||||
ScheduleConfig
|
||||
},
|
||||
getter({ type, options, onChange }) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useWorkflowTranslation();
|
||||
const compile = useCompile();
|
||||
const { workflow } = useFlowContext();
|
||||
const { collections = [] } = useCollectionManager();
|
||||
|
Loading…
Reference in New Issue
Block a user