Skip to content
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

Refactor TaskDetails Component for Improved Maintainability and Performance #1243

Merged
merged 15 commits into from
Sep 3, 2024

Conversation

Achintya-Chatterjee
Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee commented Aug 28, 2024

Date: 29 August, 2024

Developer Name: @Achintya-Chatterjee


Issue Ticket Number

Description

Refactors the TaskDetails component by breaking it down into smaller, modular subcomponents. The refactor includes the creation of new subcomponents such as TaskHeader, TaskDescription, TaskDetailsSection, TaskParticipants, TaskDates, TaskDependencies, and TaskProgress. Performance optimizations have been applied using React best practices, ensuring the component is efficient and easy to maintain.

  • Modularized TaskDetails into distinct subcomponents.
  • Retained original CSS classes to maintain the existing design and layout.
  • Applied React performance optimizations (e.g., useCallback, useMemo).
  • Ensured that all features and functionality remain intact post-refactor.
  • Handled all edge cases and ensured the component remains robust.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
Screen.Recording.2024-08-30.at.23.41.17.mp4

Test Coverage

Screenshot 1 Screenshot 2024-09-02 at 01 39 52 Screenshot 2024-09-02 at 01 38 55

Additional Notes

  • This refactor was thoroughly tested to ensure that no functionality was lost.
  • The refactor prepares the codebase for future enhancements and features, making the component easier to maintain
    and extend.
  • This PR follows the stack PR approach so the first test PR Add Unit Tests for Refactored TaskDetails Subcomponents #1245 will be merged to this branch feature/refactor-taskdetails-component then this PR will be merged to develop

…for improved maintainability and performance

- Broke down TaskDetails component into smaller, focused subcomponents: TaskHeader, TaskDescription, TaskDetailsSection, TaskParticipants, TaskDates, TaskDependencies, and TaskProgress.
- Maintained consistent styling using existing CSS classes from task-details.module.scss.
- Ensured all functionalities, including editing, API integration, and state management, remain intact.
- Added performance optimizations using React best practices, such as useCallback and useMemo where applicable.
- Handled loading and error states, as well as edge cases like empty data gracefully.
Copy link

vercel bot commented Aug 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
status-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 3, 2024 9:04am

@Achintya-Chatterjee Achintya-Chatterjee self-assigned this Aug 28, 2024
…nal rendering

- Resolved type issues, ensuring  is correctly handled as a number.
- Fixed conditional rendering to prevent the edit button from appearing for unauthorized users.
- Ensured consistent date formatting using  utility.
- Improved type safety across the TaskDetails subcomponents to prevent future issues.
- Maintained all functionality from previous refactor, including state management and API integration.
- Adjusted the position of the 'Status' and 'Link' fields within the TaskDetailsSection component to ensure they are displayed correctly.
- Ensured that the 'Status' dropdown is only visible in edit mode and does not appear twice.
- Verified that the layout matches the design specifications when switching between view and edit modes.
…onents

- Reverted changes in the component structure that affected the layout and styling.
- Ensured the CSS classes are applied correctly and match the pre-refactor styling.
- Adjusted the JSX structure to maintain the original visual layout.
iamitprakash
iamitprakash previously approved these changes Aug 31, 2024
@iamitprakash iamitprakash self-requested a review August 31, 2024 09:11
src/components/taskDetails/TaskDescription.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskDependencies.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskDates.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskDates.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskDates.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskProgress.tsx Outdated Show resolved Hide resolved
@yesyash
Copy link
Contributor

yesyash commented Aug 31, 2024

  • can we use named exports instead of default exports in all new components as it makes it easy to find references?

ashifkhn
ashifkhn previously approved these changes Sep 1, 2024
@ashifkhn ashifkhn self-requested a review September 1, 2024 18:09
src/components/taskDetails/TaskDates.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskDescription.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskHeader.tsx Outdated Show resolved Hide resolved
src/components/taskDetails/TaskProgress.tsx Outdated Show resolved Hide resolved
…encies components and directly use underlying components
tejaskh3
tejaskh3 previously approved these changes Sep 2, 2024
@iamitprakash iamitprakash merged commit 075a72e into develop Sep 3, 2024
3 checks passed
@iamitprakash iamitprakash deleted the feature/refactor-taskdetails-component branch September 3, 2024 12:04
@Achintya-Chatterjee Achintya-Chatterjee mentioned this pull request Sep 3, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor TaskDetails Component for Improved Maintainability and Performance
5 participants