Skip to content

fix(js-processor): keep JSON braces out of Mongo filter i18n message - #659

Merged
weiliang110100 merged 1 commit into
developfrom
fix/js-mongo-filter-dialog
Oct 19, 2026
Merged

weiliang110100 merged 1 commit into
developfrom
fix/js-mongo-filter-dialog

Conversation

@weiliang110100

Copy link
Copy Markdown
Contributor

Summary

  • Bug: In production builds (e.g. develop deployed to 192.168.1.184:3030), clicking 「条件查询」 in the enhanced JS node test run for a MongoDB source only showed the dialog mask, no dialog. It worked locally in dev.
  • Cause: packages_form_js_processor_mock_filter_placeholder embedded JSON like {"status": "PAID"}. vue-i18n compiles messages at runtime and treats {} as interpolation. In dev, a compile error is only console.error'd; in production @intlify/core-base rethrows it, so the dialog content slot failed to render and only ElOverlay remained.
  • Fix:
    • Move the hint into an info-icon tooltip beside the dialog title (same pattern as the 「脚本 (i)」 label).
    • Keep the $find JSON example as a code constant (MONGO_FILTER_EXAMPLE) instead of an i18n message.
    • Rename the key to packages_form_js_processor_mock_filter_tip with brace-free text in zh-CN / zh-TW / en.
    • Remove the unused packages_form_js_processor_mock_json_placeholder, which had the same problem.

No Jira issue for this fix.

Validation

  • pnpm build:daas succeeded; built bundle contains mock_filter_tip and none of the removed keys.
  • pnpm exec prettier --check on the touched files: pass.
  • node scripts/check-i18n.js packages/dag/src/components/form/js-processor/index.tsx: pass.
  • Compiled every message in packages/form/src/locale/lang/{zh-CN,zh-TW,en}.js with @intlify/message-compiler@11.1.9: no failures.
  • eslint on touched files reports only existing errors (getPrefix scope at index.tsx:529, default export in locale files).
  • Not yet verified in a browser against a MongoDB-source task in the production build.

🤖 Generated with Claude Code

vue-i18n compiles messages at runtime and throws on `{"status": ...}` in
production builds, so the filter query dialog rendered only its mask.
Move the hint into an info tooltip beside the dialog title and keep the
$find JSON example as a code constant. Remove the unused
mock_json_placeholder message, which had the same problem.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@weiliang110100
weiliang110100 merged commit 9c2a0bf into develop Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant