diff --git a/packages/dag/src/components/form/js-processor/index.tsx b/packages/dag/src/components/form/js-processor/index.tsx index 06c0a5b4c..6f2861efe 100644 --- a/packages/dag/src/components/form/js-processor/index.tsx +++ b/packages/dag/src/components/form/js-processor/index.tsx @@ -35,6 +35,15 @@ import AiCodeDialog from './AiCodeDialog.vue' import { useVirtualLogScroller } from './useVirtualLogScroller' import './style.scss' +// Kept out of i18n messages: vue-i18n treats `{}` as interpolation and throws in production +const MONGO_FILTER_EXAMPLE = `{ + "$find": { + "filter": {"age": {"$gt": 10}}, + "sort": {"age": -1}, + "limit": 10 + } +}` + export const JsProcessor = observer( defineComponent({ props: ['value', 'disabled', 'isStandard'], @@ -1201,25 +1210,47 @@ export const JsProcessor = observer( {/* SQL / Mongo filter Query Dialog */} {{ - default: () => ( - <> + header: ({ titleId, titleClass }: any) => ( +
+ + {t( + isMongoQuerySource.value + ? 'packages_form_js_processor_mock_filter_dialog_title' + : 'packages_form_js_processor_mock_sql_dialog_title', + )} + {isMongoQuerySource.value && ( -
-                            {t(
-                              'packages_form_js_processor_mock_filter_placeholder',
-                            )}
-                          
+ + {{ + default: () => ( + + info + + ), + content: () => ( +
+
+ {t( + 'packages_form_js_processor_mock_filter_tip', + )} +
+
+                                    {MONGO_FILTER_EXAMPLE}
+                                  
+
+ ), + }} +
)} +
+ ), + default: () => ( + <>