Skip to content

[Feature] Add role selection admin / employee / manager when sending invitations #3956

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

CREDO23
Copy link
Contributor

@CREDO23 CREDO23 commented Jul 23, 2025

Description

  • Add member role field in the invite form
  • Keep EMPLOYEE as default role

✅ Checklist

  • My code follows the project coding style
  • I reviewed my own code and added comments where needed
  • I tested my changes locally
  • I updated or created related documentation if needed
  • No new warnings or errors are introduced

Summary by CodeRabbit

  • New Features

    • Added role selection to team invitation forms, allowing admins to assign roles (Admin, Employee, Manager) when inviting new members.
    • Invitation flow now requires a role to be selected before sending invites.
  • Bug Fixes

    • Improved error handling and validation for role selection during invitations.
  • Localization

    • Added new translations for "Team member role" and "Please select a role" across all supported languages.
  • Style

    • Adjusted dropdown button height in the invite email dropdown for improved UI consistency.

@CREDO23 CREDO23 self-assigned this Jul 23, 2025
@CREDO23 CREDO23 added the Improvement Improvement label Jul 23, 2025
Copy link
Contributor

coderabbitai bot commented Jul 23, 2025

"""

Walkthrough

This update introduces role selection functionality to the team invitation flow, allowing admins to specify a role when inviting new members. The change propagates the roleId through the UI, hooks, service, and type definitions. Localization files are updated with new keys for role-related labels and error messages in multiple languages.

Changes

Files/Paths Change Summary
.../team-member.tsx Changed TeamMemberSection from default to named export.
.../invite-form-modal.tsx, .../invite-modal.tsx Enhanced invite modals to support role selection, updated state, UI, validation, and invite logic to include roleId.
.../team-members.tsx Switched user retrieval from hook to global state atom.
.../invite/invite-email-dropdown.tsx Changed dropdown button height from 54px to 3rem.
.../use-team-invitations.ts Updated inviteUser to accept and pass roleId; mutation now includes roleId in API call.
.../use-roles.ts Restricted roles fetching to admin users by checking user role in hook logic.
.../invite.service.ts Changed invite API to prioritize provided roleId over default employee role.
.../invite.ts Added roleId: string property to IInviteRequest interface.
.../locales/ar.json, .../bg.json, .../de.json, .../en.json, .../es.json, .../fr.json, .../he.json, .../it.json, .../nl.json, .../pl.json, .../pt.json, .../ru.json, .../zh.json Added localization keys for team member role label and select role error message in multiple languages.

Sequence Diagram(s)

sequenceDiagram
  participant AdminUser
  participant InviteModal
  participant RolesHook
  participant InviteService
  participant API

  AdminUser->>InviteModal: Open invite modal
  InviteModal->>RolesHook: Fetch available roles (if admin)
  RolesHook-->>InviteModal: Return roles list
  AdminUser->>InviteModal: Fill email, name, select role
  InviteModal->>InviteService: inviteUser(email, name, roleId)
  InviteService->>API: POST /invite { email, name, roleId, ... }
  API-->>InviteService: Success/Failure
  InviteService-->>InviteModal: Result
  InviteModal-->>AdminUser: Show success/error
Loading

Estimated code review effort

3 (~45 minutes)

Suggested labels

WEB, feature, Ever Teams

Suggested reviewers

  • Cedric921
  • evereq

Poem

🐇
A hop and a skip, new roles on display,
Invite your teammates in a more tailored way!
With dropdowns and checks, and translations anew,
The team grows stronger, thanks to all of you.
So pick a good role, and let’s celebrate—
Ever Teams just got even more great!
🌱
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
(node:31655) [DEP0169] DeprecationWarning: url.parse() behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for url.parse() vulnerabilities.
(Use node --trace-deprecation ... to show where the warning was created)
error Couldn't find package "@ever-teams/eslint-config@" required by "@ever-teams/types@" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.


📜 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 8ee90bc and 739dee9.

📒 Files selected for processing (1)
  • apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts
⏰ 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: Codacy Static Code Analysis
  • GitHub Check: deploy
  • GitHub Check: Analyze (javascript-typescript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ETP-55-task-add-role-selection-admin-employee-when-sending-invitations

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:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • 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 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

⚠️ Unused code detected in the following changed files:

  • apps/web/core/components/common/team-member.tsx
  • apps/web/core/components/features/teams/invite-modal.tsx
  • apps/web/core/types/interfaces/user/invite.ts

Please review these files and clean up the unused code.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements role selection functionality for team invitations, allowing administrators to assign specific roles (Admin, Employee, Manager) when inviting new team members. The feature adds a role dropdown to invitation forms that is only visible to admin and super admin users, while maintaining Employee as the default role for backward compatibility.

Key changes include:

Backend Integration: The IInviteRequest interface now includes a roleId field, and the invitation service was updated to use the provided role ID or fall back to the Employee role. The team invitations hook was extended to accept and pass through the roleId parameter.

UI Components: Two main invitation modals (invite-form-modal.tsx and invite-modal.tsx) were enhanced with role selection dropdowns that appear only for admin users. The components implement proper state management for role selection with validation to ensure a role is selected before submission.

Internationalization: Comprehensive localization support was added across all supported languages (Arabic, Bulgarian, Chinese, Dutch, English, French, German, Hebrew, Italian, Polish, Portuguese, Russian, Spanish) with two new translation keys: TEAM_MEMBER_ROLE for the form field label and SELECT_ROLE for validation error messages.

Minor Optimizations: Some components were refactored for performance, including switching from the useAuthenticateUser hook to direct atom access in team-members.tsx, and the TeamMemberSection component was changed from default to named export for better module organization.

The implementation maintains security by restricting role selection to admin users only and preserves existing functionality through proper fallback mechanisms.

Confidence score: 2/5

• This PR has implementation issues that could cause runtime errors and inconsistent behavior
• State management inconsistencies in invite modals where form data doesn't sync with role selection state, missing roleId in initialValues causing type mismatches, and potential undefined values being passed to APIs
• Files needing attention: apps/web/core/components/features/teams/invite-modal.tsx and apps/web/core/components/features/teams/invite-form-modal.tsx for state management fixes

21 files reviewed, 4 comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

@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: 3

🔭 Outside diff range comments (1)
apps/web/core/components/features/teams/invite-form-modal.tsx (1)

143-145: Add missing dependency to useCallback.

The handleSubmit callback should include selectedRoleId in its dependency array since it's used in the validation logic.

-[selectedEmail, teamInvitations, closeModal, t, inviteUser, resendTeamInvitation]
+[selectedEmail, teamInvitations, closeModal, t, inviteUser, resendTeamInvitation, selectedRoleId]
🧹 Nitpick comments (3)
apps/web/locales/es.json (1)

1074-1076: Unintended change to VALID_EMAIL?

"VALID_EMAIL" is flagged as modified although its text is identical. Make sure this wasn’t a formatting-only change that could create noisy diffs in future PRs.
Also, consider using the same punctuation style as the earlier "SELECT_ROLE" under common (Por favor, selecciona un rol) for consistency.

apps/web/locales/he.json (1)

1074-1076: Consistency of error strings

The new error string "SELECT_ROLE": "אנא בחר תפקיד" looks good.
Minor: a trailing period (.) is used in several other error messages in this section—worth adding here for stylistic consistency.

apps/web/locales/de.json (1)

1075-1076: Error messages consistent

Both "VALID_EMAIL" and "SELECT_ROLE" follow the existing style. Consider using exactly the same wording for "SELECT_ROLE" if the string also appears in other sections to avoid subtle inconsistencies, but this is optional.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e4b82fa and 5240b02.

📒 Files selected for processing (22)
  • apps/web/core/components/common/team-member.tsx (1 hunks)
  • apps/web/core/components/features/teams/invite-form-modal.tsx (4 hunks)
  • apps/web/core/components/features/teams/invite-modal.tsx (4 hunks)
  • apps/web/core/components/pages/teams/team/team-members.tsx (3 hunks)
  • apps/web/core/components/teams/invite/invite-email-dropdown.tsx (1 hunks)
  • apps/web/core/hooks/organizations/teams/use-team-invitations.ts (3 hunks)
  • apps/web/core/hooks/roles/use-roles.ts (2 hunks)
  • apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (1 hunks)
  • apps/web/core/types/interfaces/user/invite.ts (1 hunks)
  • apps/web/locales/ar.json (2 hunks)
  • apps/web/locales/bg.json (2 hunks)
  • apps/web/locales/de.json (2 hunks)
  • apps/web/locales/en.json (2 hunks)
  • apps/web/locales/es.json (2 hunks)
  • apps/web/locales/fr.json (2 hunks)
  • apps/web/locales/he.json (2 hunks)
  • apps/web/locales/it.json (2 hunks)
  • apps/web/locales/nl.json (2 hunks)
  • apps/web/locales/pl.json (2 hunks)
  • apps/web/locales/pt.json (2 hunks)
  • apps/web/locales/ru.json (2 hunks)
  • apps/web/locales/zh.json (2 hunks)
🧠 Learnings (22)
📓 Common learnings
Learnt from: CREDO23
PR: ever-co/ever-teams#3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the `useTeamMemberCard` hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.
apps/web/core/components/teams/invite/invite-email-dropdown.tsx (3)

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In apps/web/components/ui/sidebar.tsx, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.

apps/web/core/components/common/team-member.tsx (8)

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3328
File: apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx:66-78
Timestamp: 2024-11-13T05:17:33.527Z
Learning: In the UserTeamActivity component (apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx), the overflow-hidden class is intentionally applied only to the first Tab.Panel because the hidden overflow is needed when the sub-component has not yet been made visible. Applying overflow-hidden to the other Tab.Panel components is not required.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

Learnt from: NdekoCode
PR: #3199
File: apps/web/components/app-sidebar.tsx:49-55
Timestamp: 2024-10-28T17:16:03.609Z
Learning: In apps/web/components/app-sidebar.tsx, hardcoded sample user data is intentionally included and should not be removed.

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

apps/web/core/components/pages/teams/team/team-members.tsx (9)

Learnt from: NdekoCode
PR: #3199
File: apps/web/components/app-sidebar.tsx:49-55
Timestamp: 2024-10-28T17:16:03.609Z
Learning: In apps/web/components/app-sidebar.tsx, hardcoded sample user data is intentionally included and should not be removed.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3328
File: apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx:66-78
Timestamp: 2024-11-13T05:17:33.527Z
Learning: In the UserTeamActivity component (apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx), the overflow-hidden class is intentionally applied only to the first Tab.Panel because the hidden overflow is needed when the sub-component has not yet been made visible. Applying overflow-hidden to the other Tab.Panel components is not required.

apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (1)

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

apps/web/locales/nl.json (2)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

apps/web/locales/he.json (2)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/core/hooks/organizations/teams/use-team-invitations.ts (1)

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

apps/web/core/hooks/roles/use-roles.ts (4)

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3887
File: apps/web/core/query/keys/index.ts:41-58
Timestamp: 2025-06-07T04:31:16.865Z
Learning: The team uses a progressive migration approach for React Query implementation, where query key infrastructure is added first before implementing the hooks/services that use them. This results in intentionally unused code during intermediate migration states.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

apps/web/locales/es.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/ru.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/it.json (3)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

apps/web/locales/bg.json (1)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

apps/web/locales/zh.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/pl.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/pt.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

apps/web/core/components/features/teams/invite-form-modal.tsx (4)

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In apps/web/components/ui/sidebar.tsx, cookie configuration enhancements including secure and httpOnly flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.

apps/web/locales/fr.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/de.json (3)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/en.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/core/components/features/teams/invite-modal.tsx (7)

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In apps/web/components/ui/sidebar.tsx, cookie configuration enhancements including secure and httpOnly flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3392
File: apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx:42-51
Timestamp: 2024-12-05T09:04:08.049Z
Learning: In the GroupBySelect component (apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx), only one option can be selected at a time; two options cannot be selected simultaneously.

apps/web/locales/ar.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

🪛 GitHub Actions: Knip Review - Cleanup Unused Code - WEB
apps/web/core/types/interfaces/user/invite.ts

[error] 1-1: Unused code detected in this file.

apps/web/core/components/common/team-member.tsx

[error] 1-1: Unused code detected in this file.

apps/web/core/components/features/teams/invite-modal.tsx

[error] 1-1: Unused code detected in this file.

🧰 Additional context used
🧠 Learnings (22)
📓 Common learnings
Learnt from: CREDO23
PR: ever-co/ever-teams#3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the `useTeamMemberCard` hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.
apps/web/core/components/teams/invite/invite-email-dropdown.tsx (3)

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:35.107Z
Learning: In apps/web/components/ui/sidebar.tsx, keyboard shortcut accessibility has already been reviewed and approved by shadcn-ui; further suggestions in this area are unnecessary.

apps/web/core/components/common/team-member.tsx (8)

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3328
File: apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx:66-78
Timestamp: 2024-11-13T05:17:33.527Z
Learning: In the UserTeamActivity component (apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx), the overflow-hidden class is intentionally applied only to the first Tab.Panel because the hidden overflow is needed when the sub-component has not yet been made visible. Applying overflow-hidden to the other Tab.Panel components is not required.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

Learnt from: NdekoCode
PR: #3199
File: apps/web/components/app-sidebar.tsx:49-55
Timestamp: 2024-10-28T17:16:03.609Z
Learning: In apps/web/components/app-sidebar.tsx, hardcoded sample user data is intentionally included and should not be removed.

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

apps/web/core/components/pages/teams/team/team-members.tsx (9)

Learnt from: NdekoCode
PR: #3199
File: apps/web/components/app-sidebar.tsx:49-55
Timestamp: 2024-10-28T17:16:03.609Z
Learning: In apps/web/components/app-sidebar.tsx, hardcoded sample user data is intentionally included and should not be removed.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3328
File: apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx:66-78
Timestamp: 2024-11-13T05:17:33.527Z
Learning: In the UserTeamActivity component (apps/web/lib/features/team/user-team-card/user-team-card-activity.tsx), the overflow-hidden class is intentionally applied only to the first Tab.Panel because the hidden overflow is needed when the sub-component has not yet been made visible. Applying overflow-hidden to the other Tab.Panel components is not required.

apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (1)

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

apps/web/locales/nl.json (2)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

apps/web/locales/he.json (2)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/core/hooks/organizations/teams/use-team-invitations.ts (1)

Learnt from: CREDO23
PR: #3532
File: apps/web/components/pages/team/tasks/DropdownMenuTask.tsx:20-21
Timestamp: 2025-01-21T18:44:28.130Z
Learning: In the Ever Teams application, task assignment operations require member information obtained through the useTeamMemberCard hook, which needs the team member object as an argument. This member object is typically found by matching the current user's ID with the employee user ID in the active team's members list.

apps/web/core/hooks/roles/use-roles.ts (4)

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3887
File: apps/web/core/query/keys/index.ts:41-58
Timestamp: 2025-06-07T04:31:16.865Z
Learning: The team uses a progressive migration approach for React Query implementation, where query key infrastructure is added first before implementing the hooks/services that use them. This results in intentionally unused code during intermediate migration states.

Learnt from: CREDO23
PR: #3626
File: apps/web/app/[locale]/projects/components/page-component.tsx:119-119
Timestamp: 2025-02-28T09:17:46.802Z
Learning: In the projects page component, filtering of projects based on the active team has been moved out of the useEffect hook that fetches organization projects, and is now handled in the pagination logic instead.

apps/web/locales/es.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/ru.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/it.json (3)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

apps/web/locales/bg.json (1)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

apps/web/locales/zh.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/pl.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/pt.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

apps/web/core/components/features/teams/invite-form-modal.tsx (4)

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In apps/web/components/ui/sidebar.tsx, cookie configuration enhancements including secure and httpOnly flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.

apps/web/locales/fr.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/de.json (3)

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/locales/en.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

apps/web/core/components/features/teams/invite-modal.tsx (7)

Learnt from: CREDO23
PR: #3353
File: apps/web/lib/features/task/task-input.tsx:812-815
Timestamp: 2024-11-20T19:56:12.313Z
Learning: In apps/web/lib/features/task/task-input.tsx, prefer using useRef over useState for assignees in the AssigneesSelect component to prevent re-renders on change.

Learnt from: CREDO23
PR: #3360
File: apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx:346-354
Timestamp: 2024-11-25T18:49:15.126Z
Learning: In apps/web/components/pages/task/details-section/blocks/task-secondary-info.tsx, within the ProjectDropDown component, both parent and child state should be synchronized for better UI updates, even in controlled mode. The onChange function carries the parent state, and setSelected maintains the selected state in the child component.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:77-87
Timestamp: 2024-10-25T15:15:45.111Z
Learning: In apps/web/components/ui/sidebar.tsx, modifications to the keyboard shortcut implementation within React.useEffect can cause build errors. The current implementation has been validated by shadcn-ui and should remain unchanged.

Learnt from: NdekoCode
PR: #3189
File: apps/web/components/ui/sidebar.tsx:14-19
Timestamp: 2024-10-25T15:16:53.869Z
Learning: In apps/web/components/ui/sidebar.tsx, cookie configuration enhancements including secure and httpOnly flags, and making cookie name and max age configurable via environment variables, have already been implemented in previous commits.

Learnt from: NdekoCode
PR: #3234
File: apps/web/components/pages/team/tasks/TaskTable.tsx:9-13
Timestamp: 2024-11-06T17:10:06.239Z
Learning: In the TaskTable component (apps/web/components/pages/team/tasks/TaskTable.tsx), we do not need to add error handling for task fetching when using useTeamTasks().

Learnt from: NdekoCode
PR: #3199
File: apps/web/app/stores/team-tasks.ts:39-40
Timestamp: 2024-10-28T17:23:01.110Z
Learning: The favoriteTasksAtom in apps/web/app/stores/team-tasks.ts is important for future implementations and should not be removed, even if it appears unused currently.

Learnt from: CREDO23
PR: #3392
File: apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx:42-51
Timestamp: 2024-12-05T09:04:08.049Z
Learning: In the GroupBySelect component (apps/web/app/[locale]/reports/weekly-limit/components/group-by-select.tsx), only one option can be selected at a time; two options cannot be selected simultaneously.

apps/web/locales/ar.json (3)

Learnt from: CREDO23
PR: #3309
File: apps/web/locales/es.json:335-337
Timestamp: 2024-11-11T23:24:14.299Z
Learning: When reviewing additions of new translation keys in apps/web/locales/, ensure to verify whether the keys have been added to all relevant locale files before suggesting they are missing.

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/it.json:554-571
Timestamp: 2024-11-03T08:34:33.295Z
Learning: In the Italian localization (apps/web/locales/it.json), use "Registro ore" as the translation for "timesheet" instead of "Foglio presenze".

Learnt from: Innocent-Akim
PR: #3225
File: apps/web/locales/de.json:549-551
Timestamp: 2024-11-03T08:12:30.164Z
Learning: In apps/web/locales/de.json, the maintenance section should remain in Dutch.

🪛 GitHub Actions: Knip Review - Cleanup Unused Code - WEB
apps/web/core/types/interfaces/user/invite.ts

[error] 1-1: Unused code detected in this file.

apps/web/core/components/common/team-member.tsx

[error] 1-1: Unused code detected in this file.

apps/web/core/components/features/teams/invite-modal.tsx

[error] 1-1: Unused code detected in this file.

⏰ 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: Codacy Static Code Analysis
  • GitHub Check: deploy
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (34)
apps/web/locales/bg.json (1)

1047-1047: Translations Consistency Verified

All 13 locale files in apps/web/locales/ now include both TEAM_MEMBER_ROLE and SELECT_ROLE. The Bulgarian entries are accurate and placement is correct. No further action required.

apps/web/core/components/teams/invite/invite-email-dropdown.tsx (1)

51-51: Good styling improvement using relative units.

The change from fixed pixel height (h-[54px]) to relative rem units (h-[3rem]) is a positive improvement that:

  • Provides better scalability with user font preferences
  • Maintains consistent sizing relative to the base font size
  • Follows modern CSS best practices for responsive design
apps/web/core/types/interfaces/user/invite.ts (1)

67-67: Approve interface change & dismiss unused‐code alert

The new required roleId: string on IInviteRequest correctly enforces role selection and is actively used in the invitation flow. Verified references include:

  • apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (imported and used in inviteByEmails)
  • apps/web/core/types/schemas/user/invite.schema.ts (commented as the source for IInviteRequest)

The pipeline’s “unused code” warning is a false positive—this interface is consumed by the invitation service. Everything looks good to merge.

apps/web/locales/nl.json (1)

1046-1046: LGTM! Dutch translations are accurate and well-placed.

The new localization keys for role selection functionality are correctly translated and placed in appropriate sections:

  • "TEAM_MEMBER_ROLE": "Teamlidrol" in the form section for UI labels
  • "SELECT_ROLE": "Selecteer een rol" in the errors section for validation messages

The Dutch translations are contextually appropriate and maintain consistency with the localization patterns used in other locale files.

Also applies to: 1075-1075

apps/web/core/components/pages/teams/team/team-members.tsx (2)

1-1: LGTM: Import changes align with global state management approach

The replacement of useAuthenticateUser hook with userState atom is consistent with the PR's architectural shift towards centralized state management using Jotai atoms.

Also applies to: 19-19


50-50: LGTM: User access updated to use global state

The change from hook-based user retrieval to useAtomValue(userState) properly implements the architectural shift while maintaining the same variable interface within the component.

apps/web/core/services/client/api/organizations/teams/invites/invite.service.ts (1)

50-50: LGTM: Role ID priority correctly updated for role selection feature

The change reverses the priority to respect explicitly provided data.roleId over the default employee role, which is essential for the role selection functionality. The fallback to employeeRole.data.id maintains backward compatibility.

apps/web/locales/fr.json (2)

1049-1049: LGTM: Accurate French translation for team member role label

The translation "Rôle du membre de l'équipe" is grammatically correct and appropriately placed in the form section for UI labels.


1078-1078: LGTM: Accurate French translation for role selection validation

The translation "Veuillez sélectionner un rôle" is the correct French validation message and is properly placed in the errors section.

apps/web/locales/en.json (2)

1049-1049: LGTM: Clear English label for team member role

The translation "Team member role" is concise and appropriate for form field labels.


1078-1078: LGTM: Standard validation message for role selection

The translation "Please select a role" is a clear and standard validation message for required role selection.

apps/web/locales/es.json (1)

1046-1048: All locale files include the TEAM_MEMBER_ROLE key
I’ve verified that TEAM_MEMBER_ROLE is defined in every apps/web/locales/*.json file. No further action needed.

apps/web/locales/he.json (1)

1045-1047: All locales include TEAM_MEMBER_ROLE
Verified via a scan of all apps/web/locales/*.json files—no instances of the key missing. No further action needed.

apps/web/locales/it.json (2)

1075-1076: Comma fix + new error key – LGTM

The trailing comma issue is resolved and the added error message ("Seleziona un ruolo") reads naturally. No further action required.


1047-1047: Translation approved and key propagation verified

  • Confirmed that the new TEAM_MEMBER_ROLE key is present in every locale file under apps/web/locales/.
  • The Italian string "Ruolo del membro del team" is accurate and consistent with existing translations.
apps/web/locales/de.json (1)

1046-1046: Translation approved

"Rolle des Teammitglieds" is clear and grammatically correct.

apps/web/locales/zh.json (2)

1047-1047: 新增字段 OK

"团队成员角色" conveys the meaning precisely. Good to go.


1075-1076: 错误提示 OK

"请输入有效的电子邮箱" / "请选择角色" match the existing tone and terminology.

apps/web/core/hooks/organizations/teams/use-team-invitations.ts (3)

98-99: LGTM: Role ID properly added to invitation payload

The roleId parameter is correctly added to the invitation service call, maintaining consistency with the existing payload structure.


222-222: LGTM: Function signature updated to support role selection

The inviteUser function signature correctly adds the roleId parameter. This is a breaking change that aligns with the role selection feature requirements.


232-233: LGTM: Role ID correctly passed to mutation

The roleId parameter is properly threaded through to the mutation call, completing the role selection flow from UI to backend.

apps/web/locales/pt.json (2)

1047-1047: LGTM: Portuguese translation for team member role label

The translation "Função do membro da equipe" is appropriate for the team member role form field label.


1076-1076: LGTM: Portuguese translation for role selection error

The translation "Por favor, selecione uma função" correctly conveys the role selection validation message in Portuguese.

apps/web/core/hooks/roles/use-roles.ts (3)

1-1: LGTM: Appropriate imports for role-based access control

The new imports for userState and ERoleName are necessary for implementing admin-only access to roles data.

Also applies to: 9-9


25-28: LGTM: Proper admin role validation

The admin check correctly identifies users with ADMIN or SUPER_ADMIN roles, providing appropriate access control for role management functionality.


36-36: LGTM: Security improvement with role-based query enablement

Restricting role data fetching to admin users only is a good security practice. This ensures that only authorized users can access role information.

apps/web/locales/pl.json (2)

1046-1046: LGTM: Polish translation for team member role label

The translation "Rola członka zespołu" is appropriate for the team member role form field label in Polish.


1075-1075: LGTM: Polish translation for role selection error

The translation "Proszę wybrać rolę" correctly conveys the role selection validation message in Polish.

apps/web/locales/ar.json (1)

1055-1055: LGTM! Arabic translations are correct.

The added translations for role selection functionality are accurate and properly placed in their respective sections.

Also applies to: 1083-1084

apps/web/locales/ru.json (1)

1046-1046: LGTM! Russian translations are accurate.

The role selection translations are grammatically correct and consistent with the feature requirements.

Also applies to: 1074-1075

apps/web/core/components/features/teams/invite-form-modal.tsx (2)

96-97: Function signature update looks good.

The addition of roleId parameter to handleInvite properly implements the role selection feature.


119-123: Proper role validation implementation.

The validation ensures a role is selected before sending the invitation, with appropriate error messaging.

apps/web/core/components/features/teams/invite-modal.tsx (2)

87-99: Good error handling implementation.

The error handling properly covers both object-based errors and array messages from the API response.


1-1: InviteModal usage verified – false positive in pipeline

The InviteModal component is imported and rendered in apps/web/core/components/teams/invite/invite-card.tsx, confirming it isn’t unused:

• apps/web/core/components/teams/invite/invite-card.tsx – contains both

import { InviteModal } from '@/core/components/features/teams/invite-modal';

and JSX usage

<InviteModal  />

Since the component is in use, the pipeline’s unused‐code warning can be ignored or the check adjusted. No changes to invite-modal.tsx are needed.

Copy link

⚠️ Unused code detected in the following changed files:

  • apps/web/core/components/common/team-member.tsx
  • apps/web/core/components/features/teams/invite-modal.tsx
  • apps/web/core/types/interfaces/user/invite.ts

Please review these files and clean up the unused code.

Copy link

⚠️ Unused code detected in the following changed files:

  • apps/web/core/components/common/team-member.tsx
  • apps/web/core/components/features/teams/invite-modal.tsx
  • apps/web/core/types/interfaces/user/invite.ts

Please review these files and clean up the unused code.

@CREDO23 CREDO23 requested a review from NdekoCode July 23, 2025 17:55
@evereq evereq merged commit 5afe590 into develop Jul 23, 2025
14 of 16 checks passed
@evereq evereq deleted the ETP-55-task-add-role-selection-admin-employee-when-sending-invitations branch July 23, 2025 18:49
evereq added a commit that referenced this pull request Aug 2, 2025
* build(deps): bump axios from 1.10.0 to 1.11.0

Bumps [axios](https://github.com/axios/axios) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.11.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Merge pull request #3956 from ever-co/ETP-55-task-add-role-selection-admin-employee-when-sending-invitations

[Feature] Add role selection admin / employee / manager when sending invitations

* Feat etp 39/implement export functionality on time and activity page (#3954)

* [Feature] Implement export functionality for time and activity reports

- Added export options for CSV, XLSX, and PDF formats in the TimeActivityExportMenu component.
- Introduced ExportProgressModal to track and display export progress.
- Created utility functions for generating export filenames and handling file extensions.
- Developed hooks for managing export progress and data transformation for export.
- Implemented PDF generation for time and activity reports, including member-specific and general reports.
- Enhanced filtering logic to support export functionality based on user permissions and selected filters.
- Optimized performance settings for handling large datasets during export operations.

* Enhance date range options in TimeActivity components

- Renamed the 'All Times' range to 'Last Year' for better accuracy.
- Added a new 'All Times' range that covers a wider span from five years ago to today.
- Updated the TimeActivityExportMenu to use effective start and end dates, defaulting to the current month if not provided.
- Improved date formatting and calculations for export options, including total hours, earnings, and average activity metrics in the export summary.

* refactor(web): 'This Year' date range option and update loading state handling

- Introduced a new predefined date range option labeled 'This Year' in the TimeActivity date range picker.
- Updated the loading state management in the useTimeActivityStats hook to reflect the current loading status dynamically.

* refactor(web): Updated the TimeActivityExportMenu component to disable CSV and XLSX
- Removed console log statements in the TimeActivityPDF and useTimesheet hooks for cleaner code and improved performance.

* fix: bots suggestions

* refactor(web): Enhance TimeActivityExportMenu and useTimeActivityExport for improved data handling

- Updated TimeActivityExportMenu to utilize new DailyActivityReport type, simplifying data structure handling.
- Introduced type guards for distinguishing between new and legacy data structures in useTimeActivityExport.
- Removed custom interfaces in favor of existing types, streamlining the codebase and improving maintainability.

* refactor(web): Enhance MustBeAManager component for improved loading and redirection handling

- Introduced useOrganizationTeams hook to manage team loading state.
- Updated loading logic to ensure both user and team data are fully loaded before proceeding with authorization checks.
- Added state management for redirection to improve user experience during access control checks.
- Enhanced loading indicators to provide feedback during data fetching and redirection processes.

* refactor(web): Improve useTimeActivityExport for better data handling

- Updated the calculation of hourly rate to handle potential undefined values more gracefully.
- Revised the activity level calculation to utilize actual data from employeeData, providing a more accurate representation.
- Cleaned up comments for clarity and consistency in the codebase.

* Fix/etp 61 member card dropdown shows restricted actions to unauthorized users (#3960)

* fix(Web): user team card menu logic to correctly identify team creator role for member removal action

* refactor(web): improve user team card menu logic to filter active menu items

* feat(web): add ManagerIcon and CreatorIcon components; update UserInfo to display role icons

* [Feature] Show rejected expired and other non accepted invitations in the pending list with clear status indicators (#3959)

* map / add invitation status displays constants

* add status badge on user invite card

* update getTeamInvitation to fetch all invitations

* show  only invitations that are not accepted

* clean up

* add ai bot suggestions

* invalidate team invitation data on mutation success

* fix(web): Enhance progress bar color logic and improve task estimation handling

- Added a neutral state color for the progress bar when no estimation exists.
- Updated the task estimation calculation to return 0 when no estimation data is available, improving clarity in task statistics.
- Adjusted layout in TeamOutstandingNotifications component for better spacing.

* refactor(web): update styling for task filters and date range components

- Adjusted class names in TaskFilter and TaskStatusFilter components for improved layout and consistency.
- Modified height properties for dropdowns and date picker to enhance visual alignment.
- Ensured proper spacing and margins for better user experience across task filtering UI.

* [Optimization]  Optimize team members update handlers | removeFromTeam , makeManager , unmakeManager (#3955)

* refactor: optimize team role management and remove duplicated logic

* add ai bot sugggestions

* update yarn lock

* Merge pull request #3963 from ever-co/fix-ETP-67-bug-web-add-manual-time-modal-unexpected-closure-poor-ux

Fix etp 67 bug web add manual time modal unexpected closure poor ux

* Merge pull request #3958 from ever-co/ETP-57-bug-pending-invitations-list-is-hidden-when-theres-only-one-team-member

[Fix bug] Show pending invitations even when the team has only one member

* Feat etp 68 task web performance optimization for user profile task component (#3966)

* refactor(web): optimize user profile task component and pagination logic

- Enhanced the UserProfileTask component by introducing a new TaskList subcomponent to reduce re-renders and improve performance.
- Implemented memoization techniques to optimize task filtering and badge class name calculations.
- Updated the useScrollPagination hook to handle item initialization and scrolling more efficiently, ensuring smoother user experience during pagination.

* refactor(web): enhance user profile task component with virtualization and memoization

- Introduced advanced memoization techniques for task filtering to optimize performance.
- Implemented TanStack Virtual for efficient rendering of large task lists, improving responsiveness.
- Updated the UserProfileTask component to support virtualization and dynamic task updates.
- Added a new useMemoizedCache hook for better cache management in task filtering operations.

* refactor(web): enhance task filtering and virtualization for improved performance

- Optimized task filtering logic with intelligent caching and memoization techniques.
- Implemented window-based virtualization for large task lists to enhance rendering performance.
- Updated UserProfileTask and UserTeamCard components to support new virtualization features.
- Enhanced useTaskVirtualization hook to automatically choose between container and window virtualization based on task count.

* fix(web): update scrolling indicator styling in user profile tasks component

- Adjusted the height property of the scrolling indicator for better visual consistency.
- Maintained existing styles while enhancing the overall appearance in dark mode.

* refactor(web): introduce constant for virtualization threshold in user team card

- Added ITEMS_LENGTH_TO_VIRTUALIZED constant to define the threshold for enabling virtualization in task lists.
- Updated UserTeamCard component to utilize the new constant for improved maintainability and clarity in virtualization logic.

* fix(web): improve daily plans loading state handling and task filtering

- Updated DailyPlanTaskInfoCell to adjust task info cell width for better layout.
- Enhanced UserProfilePlans component to implement loading state logic, ensuring daily plans display correctly during data fetching.
- Fixed synchronization issue in useDailyPlan hook by changing the dependency to prevent premature empty state.
- Improved task filtering logic in useTaskFilter to correctly extract tasks from daily plans, enabling full functionality in the task filter system.

* feat(web): enhance daily plan header with delete functionality and layout improvements

- Integrated delete plan functionality into the PlanHeader component for better user experience.
- Updated layout logic to conditionally display the delete button based on user permissions and plan mode.
- Refactored task time calculations for improved readability and performance.
- Enhanced task filtering and display logic in the FutureTasks and OutstandingFilterDate components to align with new header features.

* refactor(web): optimize task rendering in OutstandingFilterDate component

- Introduced useMemo and useCallback for improved performance in the OutstandingFilterDate component.
- Created optimized style objects and rendering functions to reduce unnecessary re-renders.
- Simplified task rendering logic by extracting it into a dedicated function, enhancing code readability and maintainability.
- Adjusted styles in the SelectComponent for better layout consistency.

* style(web): update task content width in daily plan components

- Added taskContentClassName to AllPlans, FutureTasks, and PastTasks components to standardize task content width.
- Enhanced layout consistency across daily plan components for improved user experience.

* style(web): enhance layout consistency in daily plan components

- Updated taskContentClassName in AllPlans, FutureTasks, and PastTasks components for standardized card width.
- Improved layout consistency across daily plan components to enhance user experience.
- Refactored UserTeamActivity component for better alignment and spacing in the activity display.

* feat(web): implement virtualization for user tasks in UserWorkedTaskTab

- Enhanced UserWorkedTaskTab component to support virtualization for improved performance with large task lists.
- Introduced VirtualizedList component to handle rendering of tasks efficiently, reducing re-renders and optimizing memory usage.
- Added logic to conditionally use virtualization based on task count, improving user experience during task navigation.
- Updated task rendering logic to maintain layout consistency while leveraging virtualization features.

* feat(web): enhance virtualization performance in UserWorkedTaskTab and VirtualizedList

- Updated UserWorkedTaskTab to improve task rendering with a larger buffer size and enhanced scrolling indicator for better user experience.
- Refactored VirtualizedList to utilize dynamic configuration for cache size and overscan multiplier, optimizing performance for varying list sizes.
- Introduced adaptive buffer zones that respond to scroll speed, reducing white space and improving visual continuity during scrolling.
- Preserved original spacing structure in rendered items to maintain layout consistency across components.

* feat(web): implement shared virtualization cache and enhance VirtualizedList performance

- Introduced a shared virtualization cache to improve performance across multiple instances of VirtualizedList, allowing for efficient data retrieval and rendering.
- Enhanced VirtualizedList to support dynamic pagination for large datasets, optimizing rendering based on item count and scroll direction.
- Implemented debounced cache warming and improved buffer zone calculations to reduce visual artifacts during scrolling.
- Updated virtualization configuration to adaptively manage cache size and overscan multiplier, enhancing user experience with large lists.

* feat(web): enhance task rendering and introduce lazy loading in UserWorkedTaskTab

- Updated UserWorkedTaskTab to utilize LazyTaskCard for improved performance and reduced initial load time.
- Implemented memoization techniques with useCallback and useMemo to optimize rendering and prevent unnecessary re-renders.
- Added LazyUserWorkedTaskTab for dynamic import of user tasks, enhancing user experience with lazy loading.
- Introduced TaskCardBlockSKeleton for consistent loading states across task components.
- Refactored VirtualizedList to support flexible renderItem signatures, improving compatibility with various item rendering functions.

* feat(web): add UserTeamActivity component with lazy loading and skeleton support

- Introduced LazyUserTeamActivity for dynamic import, enhancing performance by reducing initial load time.
- Added UserTeamActivitySkeleton for consistent loading states while the component is being fetched.
- Updated UserTeamCard to utilize LazyUserTeamActivity, improving user experience with lazy loading.
- Refactored imports in user-team-card-activity to streamline component usage.

* feat(web): refactor component imports for optimized loading and performance

- Added new optimized components for lazy loading, consolidating imports for better performance across various pages.
- Replaced direct dynamic imports with centralized imports from optimized-components, enhancing code maintainability.
- Introduced new Tabs component for improved tabbed navigation in UserTeamActivity, streamlining the user interface.
- Updated package.json to include @radix-ui/react-tabs for tab functionality.

* chore(deps): update @radix-ui/react-tabs to version 1.1.12 in yarn.lock

* feat(web): refactor component imports for optimized loading and performance

- Consolidated dynamic imports into centralized optimized components for improved performance across various pages.
- Replaced direct dynamic imports with imports from optimized-components, enhancing code maintainability and reducing initial load times.
- Updated multiple components including calendar, dashboard, kanban, reports, and settings to utilize the new optimized imports.
- Improved user experience by ensuring consistent loading states through skeleton components.

* style(web): enhance styling in daily plan components for improved layout

- Updated AccordionContent styles in AllPlans, FutureTasks, OutstandingFilterDate, and PastTasks components to include consistent padding and background color.
- Improved visual consistency across daily plan components, enhancing overall user experience.

* fix: spelling errors

* feat(web): refactor page-component for optimized lazy loading and component imports

- Updated page-component to utilize lazy loading for various team-related components, enhancing performance and reducing initial load times.
- Consolidated imports from optimized-components, improving code maintainability and ensuring consistent loading states with skeleton components.
- Removed deprecated optimized-components file to streamline the codebase.

* feat(web): enhance drag-and-drop functionality in OutstandingFilterDate component

- Introduced local state management with useState and useEffect to handle drag-and-drop operations more effectively.
- Updated rendering logic to utilize the new local state for improved performance and consistency.
- Ensured that the accordion component only opens the first item, aligning behavior with other tabs for a better user experience.

* feat(web): enhance shared virtualization cache with cleanup and error handling

- Added a cleanup interval to manage expired cache entries and prevent memory leaks.
- Implemented a destroy method to clear resources when no instances are left.
- Introduced error handling during instance registration and unregistration to improve robustness.
- Added cleanup on page unload to ensure proper resource management.

* fix: bots suggestions

* feat(web): introduce OptimizedTaskAccordion component for enhanced task display

- Added OptimizedTaskAccordion to display tasks in an accordion format, showing the first five tasks directly and the remaining tasks in a collapsible section.
- Implemented intelligent caching and virtualization for improved performance with large task lists.
- Updated UserWorkedTaskTab to utilize the new OptimizedTaskAccordion for better organization of tasks.
- Enhanced README documentation to include details about the new component and its features.

* feat(web): implement optimized activity tabs for improved performance

- Introduced new components for optimized activity tabs: OptimizedScreenshotsTab, OptimizedAppsTab, OptimizedVisitedSitesTab, and OptimizedTasksTab, leveraging intelligent caching to enhance performance during tab switches.
- Updated UserTeamActivity to utilize the new optimized tabs, replacing legacy components for better organization and efficiency.
- Created a custom hook, useOptimizedActivityTabs, to manage caching and data retrieval for tasks, screenshots, apps, and visited sites.
- Enhanced caching strategies in use-time-daily-activity and use-time-slots hooks for improved data management and reduced recalculation on tab switches.

* refactor(web): improve task filtering and caching mechanisms

- Updated task filtering logic in UserProfileTask to enhance readability.
- Modified useTaskFilterCache to utilize specific task types for better type safety.
- Refactored useEnhancedVirtualization to prevent memory leaks by caching only data, not React components, and optimized cache cleanup to avoid infinite re-renders.
- Introduced helper functions for cache management in useEnhancedVirtualization, improving performance and usability.

* fix(web): update EmptyPlans logic to prevent display when active tasks are present

- Enhanced EmptyPlans component to accept an optional title prop for custom messages.
- Modified task list logic to prevent showing EmptyPlans when there are active tasks, improving user experience and reducing confusion in task-related tabs.

* refactor(web): enhance virtualization and error handling in task components (#3970)

- Updated OptimizedTaskAccordion to improve task rendering and virtualization performance.
- Modified VirtualizedList to include safety checks for virtual items, preventing runtime errors.
- Implemented better error handling and validation in useTanStackVirtual and useEnhancedVirtualization hooks to ensure robust performance with large datasets.
- Adjusted virtualization settings to optimize rendering and scrolling behavior, enhancing user experience.

* [Feature] Support invitation-based onboarding for users without a workspace (#3961)

* Add all necessary keys for i18

* fix auth layout

* add registration form for invitee without wrkspc

* fix build issues

* add invitation expired message card

* add workspace not found message card

* add for validation & form submit handler

* show conditionally the message card or complete registration form

* redirect user to home page or create new workspace

* update the invite callback URL -> accept-invite

* support validateByCode & validateByToken query keys for invitations api calls

* update invite schamas

* redirect user to home page after accepting the invite

* update user schema

* add accept invite skelethon

* add conditionnally tenantId and organizationId to the body

* update i18 keys for invitation registration form

* update i18 files

* set password input auto complete to 'off'

* add user email in the payload when accepting the invite

* add a workspace loader after accept invite was successfull

* clean up the accept invite page component

* add on success callback for accept invitation mutation

* fix spelling errors

* fix build issues

* update invite schemas

* build(deps): bump linkifyjs from 4.3.1 to 4.3.2 (#3967)

Bumps [linkifyjs](https://github.com/nfrasser/linkifyjs/tree/HEAD/packages/linkifyjs) from 4.3.1 to 4.3.2.
- [Release notes](https://github.com/nfrasser/linkifyjs/releases)
- [Changelog](https://github.com/nfrasser/linkifyjs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nfrasser/linkifyjs/commits/v4.3.2/packages/linkifyjs)

---
updated-dependencies:
- dependency-name: linkifyjs
  dependency-version: 4.3.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump form-data from 4.0.2 to 4.0.4 in /apps/mobile (#3968)

Bumps [form-data](https://github.com/form-data/form-data) from 4.0.2 to 4.0.4.
- [Release notes](https://github.com/form-data/form-data/releases)
- [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md)
- [Commits](form-data/form-data@v4.0.2...v4.0.4)

---
updated-dependencies:
- dependency-name: form-data
  dependency-version: 4.0.4
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [Fix bug] Fix UI update for subscribed components after task mutation (#3969)

* fix(tasks): update UI after task mutation

* return the cache data shape after computing new cache data

* fix task estimate update after mutation

* fix types

* fix build isses

* add ai bot suggestions

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Thierry CH. <thierrybakera12@gmail.com>
Co-authored-by: Arick Bulakali <85836702+NdekoCode@users.noreply.github.com>
Co-authored-by: NdekoCode <arickbulakali@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants