Skip to content

EPMRPP-93012 || Assign a new user to a project from Project team page #4453

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

Conversation

allaprischepa
Copy link
Contributor

@allaprischepa allaprischepa commented Jul 4, 2025

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?

ToDo

Solve the issue with the long system alert:
Screenshot 2025-07-04 182357
Conclusion: As a result of the discussion with Viktoryia, we decided to leave it as is for now, and she will discuss a possible approach with the designers in more detail later.

Visuals

Screenshot 2025-07-07 110003
Screenshot 2025-07-07 110306

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added new and updated translations for user invitation and external user invitation modals in Belarusian, Spanish, Russian, Ukrainian, and Chinese.
    • Introduced a redesigned external user invitation modal with enhanced messaging, clipboard copy functionality, and error handling.
    • Added new localized messages and constants for invitation status, error codes, and help links related to instance invitation settings.
  • Refactor

    • Centralized message definitions for invitation-related modals.
    • Improved notification handling with specific success and error notifications.
    • Enhanced error detection for forbidden invitations requiring SSO.
    • Simplified modal title handling and invitation workflow logic.
  • Style

    • Removed old styles and added new organized styles for the external user invitation modal.

Copy link

coderabbitai bot commented Jul 4, 2025

Walkthrough

This update refactors and enhances the invitation flow for external users in the project team management UI. It introduces new modular React components, updates localization files with new invitation-related strings in multiple languages, centralizes message and constant definitions, and improves error handling and notification logic for user invitations.

Changes

Files/Groups Change Summary
app/localization/translated/be.json, es.json, ru.json, uk.json, zh.json Added new localization keys and translations for external user invitation modal and invite user modal.
app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.jsx,
app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.scss
Deleted old external user invitation modal component and its SCSS styles.
app/src/pages/common/membersPage/index.js Removed export of the old ExternalUserInvitationModal.
app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.tsx,
app/src/pages/inside/common/modals/externalUserInvitationModal/messages.ts,
app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.scss
Added new functional external user invitation modal component, messages, and styles.
app/src/pages/inside/common/modals/externalUserInvitationModal/index.ts Updated copyright year.
app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts Added new centralized message definitions for invite/assign user modals.
app/src/pages/organization/projectTeamPage/inviteUserModal/constants.ts Added new constants for invitation status, error codes, and settings links.
app/src/pages/organization/projectTeamPage/inviteUserModal/inviteUserModal.jsx Refactored to use new messages/constants, improved error and notification handling, and integrated new modal.
app/src/components/main/notification/notificationList/notificationList.jsx Allowed target attribute in DOMPurify sanitization for notification messages.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant InviteUserModal
    participant ExternalUserInvitationModal
    participant NotificationSystem

    User->>InviteUserModal: Open invite modal
    InviteUserModal->>InviteUserModal: User submits invitation
    alt User is external and status is PENDING
        InviteUserModal->>ExternalUserInvitationModal: Show invitation modal with link/email
        User->>ExternalUserInvitationModal: Click "Copy link"
        ExternalUserInvitationModal->>NotificationSystem: Show copy success/error notification
        User->>ExternalUserInvitationModal: Click "Got it"/Close
    else User is invited successfully
        InviteUserModal->>NotificationSystem: Show invite success notification
        InviteUserModal->>InviteUserModal: Close modal
    end
    alt Error occurs (e.g. forbidden)
        InviteUserModal->>NotificationSystem: Show error notification with link
    end
Loading

Suggested labels

Check: RP team

Suggested reviewers

  • BlazarQSO
  • maria-hambardzumian
  • AmsterGet

Poem

🐇
New invites hop in, with a modal so neat,
Translations abound, in every greet.
Copy that link, send it with flair,
Notifications pop—success everywhere!
Constants and messages, all in a row,
This rabbit applauds the new invite flow!
🌱✨


📜 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 c0b6e02 and f17ae16.

📒 Files selected for processing (4)
  • app/localization/translated/be.json (2 hunks)
  • app/localization/translated/ru.json (2 hunks)
  • app/localization/translated/uk.json (2 hunks)
  • app/src/components/main/notification/notificationList/notificationList.jsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/localization/translated/ru.json
  • app/localization/translated/uk.json
  • app/localization/translated/be.json
🧰 Additional context used
🧠 Learnings (1)
📓 Common 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: Guria
PR: reportportal/service-ui#4403
File: app/src/pages/inside/testCaseLibraryPage/emptyState/emptyStateDetails.tsx:30-36
Timestamp: 2025-06-12T00:09:07.409Z
Learning: During the mock stage of UI work in reportportal/service-ui, it is acceptable for interactive elements (e.g., buttons) to omit functional handlers such as `onClick`; these will be implemented in subsequent merge requests. Review comments should avoid flagging these omissions unless the implementation MR is in scope.
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: Guria
PR: reportportal/service-ui#0
File: :0-0
Timestamp: 2025-06-30T15:25:47.978Z
Learning: When reviewing formatting-only PRs (such as Prettier application), functional code changes and improvements are out of scope. These PRs should only be evaluated for formatting consistency and style adherence, not for logic or behavioral enhancements.
⏰ 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 (1)
app/src/components/main/notification/notificationList/notificationList.jsx (1)

216-220: LGTM! Security-conscious approach to preserving target attributes.

The addition of { ADD_ATTR: ['target'] } to the DOMPurify configuration is a targeted and appropriate change to support links with target attributes in notification messages. This is commonly needed for user experience (e.g., target="_blank" for external links) and doesn't introduce significant security risks. The approach maintains sanitization while allowing only the specific attribute required for the invitation functionality.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/EPMRPP-93012-assign-new-user-to-project-from-project-team-page

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.

@codecov-commenter
Copy link

codecov-commenter commented Jul 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.13%. Comparing base (4737bfb) to head (f17ae16).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4453   +/-   ##
========================================
  Coverage    67.13%   67.13%           
========================================
  Files           84       84           
  Lines          989      989           
  Branches       140      140           
========================================
  Hits           664      664           
  Misses         294      294           
  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

@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/organization/projectTeamPage/inviteUserModal/constants.ts (2)

21-23: Freeze/declare ERROR_CODES as immutable and clarify the 4003 constant

Same immutability concern as above; additionally, 4003 is domain-specific (not a standard HTTP 403). Consider documenting the meaning or renaming:

-export const ERROR_CODES = {
-  FORBIDDEN: 4003,
-};
+export const ERROR_CODES = {
+  FORBIDDEN_INVITE: 4003,
+} as const;

Alternatively, pull these codes from a single shared apiErrorCodes.ts to avoid drift.


25-27: Avoid hard-coding public URLs inside feature code

settingsLink targets production docs; for on-prem or air-gapped deployments the link may be wrong. Move it to a config layer or localization token so deployments can override:

-export const settingsLink =
-  'https://reportportal.io/docs/admin-panel/ServerSettings/#instance-invitations_';
+export const settingsLink =
+  process.env.REACT_APP_DOCS_INVITATION_URL ??
+  'https://reportportal.io/docs/admin-panel/ServerSettings/#instance-invitations_';
app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts (1)

32-35: Multiline back-tick string keeps newline in the rendered text

The back-tick literal inserts a hard line-break after “Please note,” which will appear in the modal. Use a single-line string or trim():

-  description: {
-    id: 'InviteUserModal.description',
-    defaultMessage: `Please note, that new users joining this project's organization will be assigned the ‘Member’ role, while existing users will retain their current organizational roles and permissions.`,
-  },
+  description: {
+    id: 'InviteUserModal.description',
+    defaultMessage:
+      "Please note, that new users joining this project's organization will be assigned the ‘Member’ role, while existing users will retain their current organizational roles and permissions.",
+  },
app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.scss (1)

23-34: Hard-coded pixel values reduce scalability

max-width: 416px, font-size: 20px, and line-height: 31px are hard-coded. Switching to rem/em keeps the modal responsive to the user’s root font-size and improves accessibility.

-    max-width: 416px;
-    font-size: 20px;
-    line-height: 31px;
+    max-width: 26rem;   /* 26rem ≈ 416px at 16px base */
+    font-size: 1.25rem; /* 20px */
+    line-height: 1.55rem; /* 31px */

Not mandatory for merge, but worth considering.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4737bfb and 63fcdc3.

📒 Files selected for processing (15)
  • app/localization/translated/be.json (2 hunks)
  • app/localization/translated/es.json (2 hunks)
  • app/localization/translated/ru.json (2 hunks)
  • app/localization/translated/uk.json (2 hunks)
  • app/localization/translated/zh.json (2 hunks)
  • app/src/pages/common/membersPage/index.js (0 hunks)
  • app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.jsx (0 hunks)
  • app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.scss (0 hunks)
  • app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.scss (1 hunks)
  • app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.tsx (1 hunks)
  • app/src/pages/inside/common/modals/externalUserInvitationModal/index.ts (1 hunks)
  • app/src/pages/inside/common/modals/externalUserInvitationModal/messages.ts (1 hunks)
  • app/src/pages/organization/projectTeamPage/inviteUserModal/constants.ts (1 hunks)
  • app/src/pages/organization/projectTeamPage/inviteUserModal/inviteUserModal.jsx (6 hunks)
  • app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • app/src/pages/common/membersPage/index.js
  • app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.scss
  • app/src/pages/common/membersPage/modals/externalUserInvitationModal/externalUserInvitationModal.jsx
🧰 Additional context used
🧠 Learnings (8)
📓 Common 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.
Learnt from: Guria
PR: reportportal/service-ui#4403
File: app/src/pages/inside/testCaseLibraryPage/emptyState/emptyStateDetails.tsx:30-36
Timestamp: 2025-06-12T00:09:07.409Z
Learning: During the mock stage of UI work in reportportal/service-ui, it is acceptable for interactive elements (e.g., buttons) to omit functional handlers such as `onClick`; these will be implemented in subsequent merge requests. Review comments should avoid flagging these omissions unless the implementation MR is in scope.
app/src/pages/organization/projectTeamPage/inviteUserModal/constants.ts (2)
Learnt from: yelyzavetakhokhlova
PR: reportportal/service-ui#4416
File: app/src/pages/inside/testCaseLibraryPage/createTestCaseModal/testCaseDetails/template/template.tsx:23-24
Timestamp: 2025-06-18T14:37:30.906Z
Learning: In the test case library page at `app/src/pages/inside/testCaseLibraryPage/constans.ts`, the file is intentionally named `constans.ts` (missing the 't'), not `constants.ts`. This is the correct filename and imports referencing '../../../constans' are valid.
Learnt from: allaprischepa
PR: reportportal/service-ui#4434
File: app/src/controllers/organization/projects/sagas.js:141-172
Timestamp: 2025-06-26T13:05:48.078Z
Learning: In the ReportPortal service-ui codebase, API error responses consistently return objects with `errorCode` and `message` properties, making destructuring with `catch ({ errorCode, message })` the appropriate error handling pattern.
app/localization/translated/zh.json (2)
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.
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/src/pages/organization/projectTeamPage/inviteUserModal/inviteUserModal.jsx (2)
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.
Learnt from: Guria
PR: reportportal/service-ui#4385
File: app/src/components/testCaseList/testCaseNameCell/testCaseNameCell.tsx:30-42
Timestamp: 2025-06-09T17:12:07.281Z
Learning: In React components, static objects like icon mappings that don't depend on props or state should be defined outside the component function to avoid unnecessary re-creation on every render, improving performance.
app/localization/translated/es.json (2)

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>

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

app/localization/translated/be.json (3)

undefined

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

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

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

app/localization/translated/ru.json (3)

undefined

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

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

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

app/localization/translated/uk.json (3)

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>

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

<retrieved_learning>
Learnt from: allaprischepa
PR: #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.
</retrieved_learning>

🧬 Code Graph Analysis (2)
app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts (1)
app/src/pages/inside/common/modals/externalUserInvitationModal/messages.ts (1)
  • messages (19-57)
app/src/pages/inside/common/modals/externalUserInvitationModal/messages.ts (1)
app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts (1)
  • messages (19-68)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Call feature Docker build / Build and export to AWS ECR
  • GitHub Check: build (20)
  • GitHub Check: build (20)
🔇 Additional comments (16)
app/src/pages/inside/common/modals/externalUserInvitationModal/index.ts (1)

1-18: Header year bump looks good

Only the license year changed; no functional impact.

app/src/pages/organization/projectTeamPage/inviteUserModal/messages.ts (1)

63-67: Link placeholder is not marked as HTML – potential XSS foot-gun

The message contains <a> markup but doesn’t declare the value as HTML‐safe. Make it explicit via values={{ linkName: <b>{...}</b> }} or split link construction out of the i18n string to keep translations text-only.

Also consider moving the URL to localization (see constants comment).

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

783-792: Localization keys added with consistent placeholders – looks good

The new Ukrainian strings are syntactically correct, reuse the {email} placeholder consistently, and don’t introduce unwanted formatting differences.


1138-1141: Invite-user messages read well and keep placeholder integrity

Both added entries follow existing naming and HTML-placeholder patterns ({email}, {linkName}), so no further action is required.

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

783-792: New invitation-flow strings look good

Placeholders ({email}), HTML tags, and tone are consistent with the rest of the RU locale.
No further action needed.


1140-1140: Consistent placeholder usage

Both {email} and {linkName} variables are preserved exactly as in the EN source.
String complies with existing formatting conventions.

app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.scss (1)

49-56: externalUserInvitationModal.scss: undefined CSS variable in .info block

No definition for --rp-ui-base- was found in the repo, so this declaration is dropped by the browser. Please update to the correct design-token name:

• File:
app/src/pages/inside/common/modals/externalUserInvitationModal/externalUserInvitationModal.scss
(inside the .info selector around lines 49–56)

Suggested diff:

-  font-family: var(--rp-ui-base-);
+  font-family: var(--rp-ui-base-font-family); /* or --rp-ui-base-body – adjust to the real token */

Verify the exact CSS custom-property in your design system and update this line to prevent silent style regressions.

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

783-792: Keys added with correct placeholders — no issues

The new ExternalUserInvitationModal.* entries follow the existing localisation conventions:

  • Place-holders {email} and markup <b> … </b> are consistent with other messages.
  • English copy here is acceptable per project guidelines that translators will localise later.

No action required.


1141-1141: String looks good, minor placeholder check

InviteUserModal.externalInviteForbidden correctly introduces {email} and {linkName} placeholders and matches the syntax style used elsewhere. Nothing blocking, just double-check at runtime that both placeholders are provided to avoid rendering undefined.

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

783-792: No concerns with the new ExternalUserInvitationModal messages

Keys are unique, JSON syntax is intact, and English placeholders are acceptable at this stage (per established localization workflow).


1140-1141: Verify runtime injection of {linkName} placeholder

InviteUserModal.externalInviteForbidden introduces an HTML-embedded placeholder <a>{linkName}</a>.
Please confirm that the calling code supplies a linkName value; otherwise the resulting message will contain an empty anchor.

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

783-791: No issues – keys added consistently

Keys follow existing naming & placeholder patterns, JSON remains valid.


1140-1140: Verify all placeholders are supplied by the UI code

String InviteUserModal.externalInviteForbidden contains two tokens – {email} and {linkName}.
Please make sure the component passes both vars; otherwise the message will render raw placeholders.

app/src/pages/organization/projectTeamPage/inviteUserModal/inviteUserModal.jsx (3)

56-58: Good refactoring of header computation

Computing the header once and reusing it improves code maintainability and consistency.


81-95: Excellent security-conscious error handling

The enhanced error handling with XSS protection using DOMPurify is well-implemented. The conditional messaging for forbidden external invites provides better user feedback.


125-147: Well-structured modal integration and notification flow

The refactoring improves code clarity by:

  • Using explicit status checking with InvitationStatus.PENDING
  • Properly passing the computed header to maintain UI consistency
  • Moving the success notification to the appropriate location after successful invitation

The XSS protection is properly maintained throughout.

@allaprischepa allaprischepa force-pushed the feature/EPMRPP-93012-assign-new-user-to-project-from-project-team-page branch from 83ba781 to c0b6e02 Compare July 7, 2025 06:31
Copy link

sonarqubecloud bot commented Jul 7, 2025

@allaprischepa allaprischepa merged commit f73af5a into develop Jul 7, 2025
13 checks passed
@allaprischepa allaprischepa deleted the feature/EPMRPP-93012-assign-new-user-to-project-from-project-team-page branch July 7, 2025 13:45
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