Skip to content

EPMRPP-104088 || Old recipient in Email notifications rules still dis… #4470

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

Merged
merged 2 commits into from
Jul 18, 2025

Conversation

BlazarQSO
Copy link
Contributor

@BlazarQSO BlazarQSO commented Jul 18, 2025

…play as login name after upgrading to version 25.2

PR Checklist

  • Have you verified that the PR is pointing to the correct target branch? (develop for features/bugfixes, other if mentioned in the task)
  • Have you verified that your branch is consistent with the target branch and has no conflicts? (if not, make a rebase under the target branch)
  • Have you checked that everything works within the branch according to the task description and tested it locally?
  • Have you run the linter (npm run lint) prior to submission? Enable the git hook on commit in your IDE to run it and format the code automatically.
  • Have you run the tests locally and added/updated them if needed?
  • Have you checked that app can be built (npm run build)?
  • Have you checked that no new circular dependencies appreared with your changes? (the webpack plugin reports circular dependencies within the dev npm script)
  • Have you made sure that all the necessary pipelines has been successfully completed?
  • If the task requires translations to be updated, have you done this by running the manage:translations script?
  • Have you added the link to the PR in the Jira ticket comments?

Visuals

Summary by CodeRabbit

  • New Features

    • Notification recipient fields in the add/edit notification modal now exclusively accept email addresses, with updated labels, placeholders, and validation messages across supported languages (Belarusian, Spanish, Russian, Ukrainian, Chinese, and English).
  • Refactor

    • Simplified recipient input validation to only accept valid email addresses, removing username support.
    • Streamlined the notification recipient component by removing Redux dependencies and renaming it for clarity.

…play as login name after upgrading to version 25.2
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

The changes update localization strings in multiple languages to require email addresses instead of usernames or recipients for notification rules. The UI components for adding/editing notification recipients were refactored to only accept and validate email addresses, removing support for usernames and simplifying validation logic. Redux dependencies were removed from the recipients container component.

Changes

File(s) Change Summary
app/localization/translated/be.json, es.json, ru.json, uk.json, zh.json Updated localization strings: recipient label, error messages, and placeholders now refer exclusively to email addresses.
.../addEditNotificationModal/addEditNotificationModal.jsx Changed default recipient label from "Recipients" to "Email" in the messages object.
.../addEditNotificationModal/recipientsContainer/recipientsContainer.jsx Refactored component: removed Redux, only validates emails, updated error/placeholder text, renamed and updated prop types.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AddEditNotificationModal
    participant RecipientsContainer
    participant Validator

    User->>AddEditNotificationModal: Open notification modal
    AddEditNotificationModal->>RecipientsContainer: Render recipient input
    User->>RecipientsContainer: Enter email address
    RecipientsContainer->>Validator: Validate email
    Validator-->>RecipientsContainer: Return valid/invalid
    RecipientsContainer-->>User: Show error if invalid, accept if valid
Loading

Suggested reviewers

  • maria-hambardzumian
  • AmsterGet

Poem

In fields of forms where emails bloom,
No more usernames in the notification room.
Recipients now must type with care,
Only emails—nothing else goes there!
The code is lean, Redux set free,
A rabbit hops in glee: "Just email me!"
🐇📧


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16f95ce and ea4d736.

📒 Files selected for processing (1)
  • app/localization/translated/ru.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/localization/translated/ru.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Call feature Docker build / Build and export to AWS ECR
  • GitHub Check: build (20)
  • GitHub Check: build (20)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/EPMRPP-104088-notifications-rules

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (4)
app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/addEditNotificationModal.jsx (1)

93-96: Rename the label to indicate plurality

The input accepts multiple addresses (RecipientsContainer returns an array), but the label has been changed to the singular “Email”. Consider switching to something clearer like “Emails” or “Email addresses” to avoid misleading users.

-    defaultMessage: 'Email',
+    defaultMessage: 'Emails',

This is a copy-text update only; no functional impact.

app/localization/translated/zh.json (2)

76-76: Consider using the more common Chinese term “邮箱”.

“电子邮件” is perfectly correct, but native UIs usually label an e-mail field as “邮箱” for brevity and consistency with other screens (e.g., CreateUserModal.email).
If you want full consistency across the app, you might want to switch to “邮箱”.

-"AddEditNotificationCaseModal.recipientsLabel": "电子邮件",
+"AddEditNotificationCaseModal.recipientsLabel": "邮箱",

80-82: Mixed-language error messages – unify for consistency.

AddEditNotificationCaseModal.recipientsHint (line 75) is already in Chinese, but AddEditNotificationModal.recipientsError is left in English.
Stick to one language (English placeholders are OK per dev-practice, but then the hint above should also stay English). Decide and align both keys.

-"AddEditNotificationModal.recipientsError": "Email is incorrect. Please enter correct email",
+# Example if you prefer Chinese:
+"AddEditNotificationModal.recipientsError": "邮箱输入错误,请输入正确的邮箱。",
app/localization/translated/uk.json (1)

80-81: Duplication & maintenance overhead for email-validation text

You introduced a bespoke error/placeholder pair here, but almost identical strings already exist under Common.validation.email (line 337). Re-using the common key would

  1. keep wording consistent across the UI,
  2. eliminate future translation drift, and
  3. cut translator workload.
-  "AddEditNotificationModal.recipientsError": "Вказано невірну адресу електронної пошти. Будь ласка, введіть правильну адресу електронної пошти",
-  "AddEditNotificationModal.recipientsPlaceholder": "Електронна пошта",
+  "AddEditNotificationModal.recipientsError": "@:Common.validation.email",
+  "AddEditNotificationModal.recipientsPlaceholder": "Електронна пошта"

(The exact syntax for key aliasing depends on your i18n tooling; adjust accordingly.)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c7f1e0 and 16f95ce.

📒 Files selected for processing (7)
  • app/localization/translated/be.json (1 hunks)
  • app/localization/translated/es.json (1 hunks)
  • app/localization/translated/ru.json (1 hunks)
  • app/localization/translated/uk.json (1 hunks)
  • app/localization/translated/zh.json (1 hunks)
  • app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/addEditNotificationModal.jsx (1 hunks)
  • app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/recipientsContainer/recipientsContainer.jsx (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/recipientsContainer/recipientsContainer.jsx (1)
Learnt from: Guria
PR: reportportal/service-ui#4391
File: app/src/pages/inside/common/emptyStatePage/emptyStatePage.jsx:111-111
Timestamp: 2025-06-09T21:33:49.377Z
Learning: PropTypes.elementType accepts strings, functions, and React special elements (like React.Fragment, Suspense, etc.) through React's isValidElementType function. It's more flexible than PropTypes.string and can be used when a prop might receive different types of valid React element types including strings.
app/localization/translated/es.json (1)

undefined

<retrieved_learning>
Learnt from: AmsterGet
PR: #4409
File: app/localization/translated/es.json:1648-1652
Timestamp: 2025-06-18T16:24:46.188Z
Learning: In the ReportPortal project, Spanish and Chinese localization entries are intentionally left in English during development. Native speakers handle these translations later in the process, so having English text in Spanish (es.json) and Chinese (zh.json) locale files is expected and acceptable.
</retrieved_learning>

app/localization/translated/zh.json (1)
Learnt from: AmsterGet
PR: reportportal/service-ui#4409
File: app/localization/translated/es.json:1648-1652
Timestamp: 2025-06-18T16:24:46.188Z
Learning: In the ReportPortal project, Spanish and Chinese localization entries are intentionally left in English during development. Native speakers handle these translations later in the process, so having English text in Spanish (es.json) and Chinese (zh.json) locale files is expected and acceptable.
🧬 Code Graph Analysis (1)
app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/recipientsContainer/recipientsContainer.jsx (1)
app/src/common/utils/validation/validate.js (2)
  • email (36-38)
  • email (36-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Call feature Docker build / Build and export to AWS ECR
  • GitHub Check: build (20)
  • GitHub Check: build (20)
🔇 Additional comments (11)
app/localization/translated/ru.json (1)

80-82: Error message out-of-sync with new validation rule

AddEditNotificationModal.recipientsError still allows “имя пользователя … или … e-mail”, contradicting the updated placeholder. Align the error text:

-"AddEditNotificationModal.recipientsError": "Пожалуйста, введите существующее имя пользователя в вашем проекте или действительный адрес электронной почты",
+"AddEditNotificationModal.recipientsError": "Пожалуйста, введите действительный адрес электронной почты",

Do the same for other affected keys (NotificationCase.recipientsHint, etc.) in this file to avoid mixed guidance.

⛔ Skipped due to learnings
Learnt from: allaprischepa
PR: reportportal/service-ui#4418
File: app/localization/translated/zh.json:2125-2130
Timestamp: 2025-06-23T06:22:27.254Z
Learning: For the ReportPortal project, translation work should be delegated to dedicated translators rather than being handled directly during code review. English keys can serve as placeholders until proper translations are provided by the translation team.
Learnt from: allaprischepa
PR: reportportal/service-ui#4418
File: app/localization/translated/es.json:2127-2131
Timestamp: 2025-06-23T06:21:47.861Z
Learning: The user allaprischepa prefers to have professional translators handle localization work rather than implementing suggested translations in code reviews.
app/localization/translated/uk.json (1)

75-77: recipientsHint now contradicts the email-only UX

Line 75 still tells the user to enter “an existing username or a valid email”, while the surrounding label (76) and the functional code have switched to email-only input. This mixed messaging will confuse users and is likely to be reported as a bug.

-  "AddEditNotificationCaseModal.recipientsHint": "Будь ласка, введіть існуюче ім'я користувача у вашому проекті або дійсну адресу електронної пошти",
+  "AddEditNotificationCaseModal.recipientsHint": "Будь ласка, введіть дійсну адресу електронної пошти"

Update the hint (and any other language variants) to stay consistent with the new validation logic.

⛔ Skipped due to learnings
Learnt from: allaprischepa
PR: reportportal/service-ui#4418
File: app/localization/translated/es.json:2127-2131
Timestamp: 2025-06-23T06:21:47.861Z
Learning: The user allaprischepa prefers to have professional translators handle localization work rather than implementing suggested translations in code reviews.
Learnt from: allaprischepa
PR: reportportal/service-ui#4418
File: app/localization/translated/zh.json:2125-2130
Timestamp: 2025-06-23T06:22:27.254Z
Learning: For the ReportPortal project, translation work should be delegated to dedicated translators rather than being handled directly during code review. English keys can serve as placeholders until proper translations are provided by the translation team.
app/localization/translated/be.json (1)

80-81: Align all “recipient” strings across dialogs

The placeholder & error text for AddEditNotificationModal were updated, but the parallel keys for the Case modal (AddEditNotificationCaseModal.recipientsPlaceholder, NotificationCase.recipientsHint, NotificationCase.recipientsLabel) still carry the old wording. Keep the localisation consistent to prevent mixed terminology in the UI.

app/src/pages/inside/projectSettingsPageContainer/content/notifications/modals/addEditNotificationModal/recipientsContainer/recipientsContainer.jsx (8)

17-18: LGTM: Modern React patterns adopted.

The refactor from class component with Redux connect to functional component with hooks is a positive modernization that improves code readability and maintainability.


29-29: LGTM: Clearer user guidance with email-specific placeholder.

The placeholder change from "Recipients" to "Email" provides clearer guidance to users about the expected input format.


33-33: LGTM: Improved error message specificity.

The error message now clearly indicates that email format is required, which aligns with the component's new email-only validation approach.


37-37: LGTM: Simplified component structure.

The component name change and direct export are consistent with removing the Redux connect wrapper, resulting in cleaner code structure.


62-63: Error handling logic is sound but depends on validation function fix.

The error message generation is appropriate, but it relies on the recipientsWithError state that's updated through the side effect in getEmailValidationError. Once the validation function is fixed, this error handling will work correctly.


73-73: Prop usage is correct but depends on validation function fix.

The getItemValidationErrorType prop correctly uses the validation function, but the underlying validation function needs to be fixed to remove side effects as mentioned in the earlier comment.


82-88: LGTM: Simplified and appropriate prop definitions.

The PropTypes and defaultProps are correctly simplified to match the refactored component structure, with only the necessary error prop defined.


69-69: Confirm endpoint returns email addresses for autocomplete

The recipients autocomplete is now email-only, but it still uses

getURI={URLS.projectUsernamesSearch(projectKey)}

which (per app/src/common/urls.js) constructs

/project/${projectKey}/usernames?filter.cnt.users=${searchTerm}

– an endpoint that likely returns usernames rather than email addresses.

Please verify that the API response includes user emails (not just usernames). If it doesn’t, switch to an email-search endpoint or update the autocomplete logic accordingly.

• app/src/pages/inside/projectSettingsPageContainer/.../recipientsContainer/recipientsContainer.jsx (line 69): getURI={URLS.projectUsernamesSearch(projectKey)}
• app/src/common/urls.js: projectUsernamesSearch definition

@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.80%. Comparing base (0d94cf2) to head (ea4d736).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4470      +/-   ##
===========================================
- Coverage    67.20%   66.80%   -0.41%     
===========================================
  Files           84       84              
  Lines          991      997       +6     
  Branches       140      140              
===========================================
  Hits           666      666              
- Misses         294      300       +6     
  Partials        31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

sonarqubecloud bot commented Jul 18, 2025

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@BlazarQSO BlazarQSO merged commit b3de193 into develop Jul 18, 2025
11 checks passed
@BlazarQSO BlazarQSO deleted the fix/EPMRPP-104088-notifications-rules branch July 18, 2025 11:02
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.

3 participants