-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(dashboard,api): add/update translation key/value pairs in editor; dropdown fixes #8615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dashboard,api): add/update translation key/value pairs in editor; dropdown fixes #8615
Conversation
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
…itor-to-translation-json
|
@coderabbitai summary |
✅ Actions performedSummary regeneration triggered. |
WalkthroughThis update introduces comprehensive translation key management features to the dashboard's email workflow editor. It adds hooks for fetching, creating, and updating translation keys and values, integrates translation key suggestions and validation into the UI, and refines tooltip and hover interactions. Several components and hooks are refactored or extended to support dynamic translation workflows. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Editor as Email Editor
participant Hooks
participant API
participant UI as UI Components
User->>Editor: Opens email workflow editor
Editor->>Hooks: useFetchTranslationKeys (workflowId)
Hooks->>API: Fetch translation keys for workflow
API-->>Hooks: Return translation keys
Hooks-->>Editor: Provide translation keys
User->>UI: Types new translation key
UI->>Hooks: useCreateTranslationKey (workflowId, key)
Hooks->>API: Create translation key in backend
API-->>Hooks: Confirm creation
Hooks-->>UI: Invalidate caches, show toast
User->>UI: Edits translation value
UI->>Hooks: useUpdateTranslationValue (workflowId, key, value)
Hooks->>API: Update translation value
API-->>Hooks: Confirm update
Hooks-->>UI: Invalidate caches, show toast
UI->>User: Shows updated translation key/value, tooltips, and suggestions
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (22)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
| const handleMouseLeave = () => { | ||
| // Small delay to allow moving to tooltip | ||
| timeoutRef.current = setTimeout(() => { | ||
| setHoveredOptionIndex(-1); | ||
| }, 150); | ||
| }; | ||
|
|
||
| const handleMouseEnter = () => { | ||
| if (timeoutRef.current) { | ||
| clearTimeout(timeoutRef.current); | ||
| timeoutRef.current = null; | ||
| } | ||
|
|
||
| setHoveredOptionIndex(index); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any other way of handling this maybe? Usually those mouseleave things are creating troubles down the read. What is the issue we try to solve with this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that we need to display a tooltip with a link to translation page, therefore user should be able to actually click it.
I also don't like timeouts, there might be a more elegant way but that would require changing / creating new component for that, figuring out how to make it works and then apply it to all places where the component is used etc. I will try to revisit when there are no more higher priority items.
commit: |
…; dropdown fixes (novuhq#8615)
What changed? Why was the change needed?
Related Maily change: novuhq/maily.to#26
translation-variables.mov
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Refactor
Chores