Addition of the task status dropdown and the extension status button on status site task card#1336
Conversation
|
@RishiChaubey31 is attempting to deploy a commit to the RDS-Team Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes update several task-related components and style definitions. In the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant TSE as TaskStatusEditMode
participant API as Task API Mutation
participant Toast as Toast Notifications
U->>TSE: Change task status
alt isDevMode & isSelfTask true
TSE->>API: execute updateSelfTask
else
TSE->>API: execute updateTask
end
API-->>TSE: return response (success/error)
alt Success
TSE->>Toast: Trigger success notification
else Failure
TSE->>Toast: Trigger error notification
end
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
src/components/tasks/TaskDropDown.tsx (1)
105-138: Enhanced UI for development mode looks goodThe conditional rendering for development mode provides a more styled interface with proper test attributes. This implementation allows for different UIs between development and production environments, which is useful for testing and development purposes.
One minor suggestion: consider extracting the common dropdown code between both rendering paths to avoid duplication. The main differences are just the styling classes and the label test attributes.
src/components/tasks/card/index.tsx (3)
547-553: Consider using a more descriptive variable name.The conditional class name assignment works correctly, but the class name
taskStatusDateAndPurposeContainerdoesn't clearly convey why it's different fromtaskStatusAndDateContainerin dev mode.- className={ - isDevMode - ? styles.taskStatusDateAndPurposeContainer - : styles.taskStatusAndDateContainer - } + className={ + isDevMode + ? styles.taskStatusDatePurposeDevContainer + : styles.taskStatusAndDateContainer + }
580-605: Consider refactoring the conditional rendering logic.The code now conditionally renders the TaskStatusEditMode component when not in dev mode, but you're still passing
isDevModeas a prop. This separation creates duplication with the dev mode rendering block later in the component.- {!isDevMode && ( - <div className={styles.taskStatusEditMode}> - {isEditable ? ( - <TaskStatusEditMode - task={editedTaskDetails} - setEditedTaskDetails={setEditedTaskDetails} - isDevMode={isDevMode} - /> - ) : ( - <div className={styles.statusContainer} style={{}}> - <p className={styles.cardSpecialFont}> - Status: - </p> - <p - data-testid="task-status" - className={styles.statusText} - > - {beautifyStatus( - cardDetails.status, - isDevMode - )} - </p> - </div> - )} - </div> - )}Consider creating a reusable
renderTaskStatusComponentfunction to avoid duplication.
589-589: Remove unnecessary empty style object.Both instances of the status container have an empty style object that doesn't serve any purpose.
- <div className={styles.statusContainer} style={{}}> + <div className={styles.statusContainer}>Also applies to: 658-658
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/components/tasks/TaskDropDown.tsx(2 hunks)src/components/tasks/card/TaskStatusEditMode.tsx(4 hunks)src/components/tasks/card/card.module.scss(2 hunks)src/components/tasks/card/index.tsx(5 hunks)src/constants/constants.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build (18.x)
🔇 Additional comments (13)
src/constants/constants.ts (1)
9-10: LGTM - Nice addition of status notification constantsThe addition of these status message constants is a good practice for maintaining consistent messaging throughout the application. Having them centralized in the constants file will make it easier to maintain and update messages in the future.
src/components/tasks/TaskDropDown.tsx (1)
4-4: LGTM - Appropriate style import addedGood addition of the style import that will be used for the new dev mode UI elements.
src/components/tasks/card/TaskStatusEditMode.tsx (5)
9-11: LGTM - Added mutation hook for self task updatesGood addition of the
useUpdateSelfTaskMutationhook alongside the existing task update mutation.
14-19: LGTM - Added necessary imports for notificationsGood addition of the status update constants and toast functionality for providing user feedback.
25-25: LGTM - Added isSelfTask prop to Props interfaceGood addition of the optional
isSelfTaskprop to allow for conditional behavior based on whether the task belongs to the current user.
49-50: LGTM - Added required hooks and constantsGood setup of the updateSelfTask mutation hook and toast type constants.
107-107: LGTM - Conditional StatusIndicator renderingGood conditional rendering of the StatusIndicator component based on the isDevMode flag. This provides appropriate UI feedback in production while hiding it in development mode.
src/components/tasks/card/card.module.scss (3)
94-102: LGTM - Added styles for purpose and status textGood addition of styles for task purpose and status fonts. The color choices and font sizes are consistent with the application's design.
260-267: LGTM - Added container styles for task status, date, and purposeThe grid layout provides a clean way to organize the task information with appropriate spacing and alignment.
273-289: LGTM - Added well-styled task status update buttonThe task status update button styling looks good with appropriate hover effects and transitions. The border, padding, and color choices are well-defined.
src/components/tasks/card/index.tsx (3)
76-76: Good data extraction from useUserData hook.You've now extracted both
dataandisUserAuthorizedfrom the useUserData hook, which allows you to access the current user's information (specifically username) for task ownership verification.
269-270: Good addition of task and user relationship checks.These new variables improve the logic readability and make the task editing permissions clearer:
isSelfTaskchecks if the current user is the assigneeisVerifiedTaskchecks if the task is in VERIFIED statusThis supports the conditional rendering logic later in the component.
651-656: New conditional rendering improves user access control.The updated logic now allows users to edit their own task statuses in development mode if they are the task assignee and the task is not verified. This is a good improvement for user experience and testing.
AnujChhikara
left a comment
There was a problem hiding this comment.
hello @RishiChaubey31
- do you have any design doc for this feature?
- also please add test coverage stats
|
@RishiChaubey31 Please update the PR title |
--------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com> Fixes date picker alignment and date value not showing up while editing on task details page (RealDevSquad#1260) * fix: date picker alignment and prefilled * fix: test cases for dates and details * update: test files * refactor: detail content component * fix: useEffect to be conditional * Improved test coverage for taskDates * revert back to original change * fix: edge case of invalid date * fix: redundancy in detailsContent * added more restriction to date validation * fix: test case for invalid-date * fix: test case with await * updated test case for failure onsave * refactor: detailsContent * update test case for isValidDate utils * updated feature flag * fix: test case name --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com> Co-authored-by: Yash Raj <56453897+yesyash@users.noreply.github.com> add loading skeleton for user profile in the navbar (RealDevSquad#1270) * add loading skeleton for user profile in the navbar * Add tests for NavBar skeleton loader, user info, and GitHub login button FF removal for PR RealDevSquad#1260 (RealDevSquad#1275) * remove FF * fix: tests Remove dev flag to show the new UI changes (RealDevSquad#1277) * fix: remove dev flag and related test and old UI code * fix: change received value * chore: change component name Fix shimmer card component in mine page (RealDevSquad#1284) * fix: remove dev flag and related test and old UI code * fix: change received value * chore: change component name * fix: change shimmer card ui * fix: change shimmer card style and made it similar to task card feat: added modal for updating task progress and task percentage. (RealDevSquad#1290) * feat: added modal for updating task progress - Require users to provide a task update before modifying progress percentage. - Restrict progress updates to tasks with status In Progress only. - Addressed the issue where users could update progress without providing updates or changing task status. - Ensures better task tracking and accountability. * fix: added the missing props * fix: preserve modal styling after task progress update Resolves an issue where the task update modal's styling was reverting to default styles after submitting progress updates. The implementation now maintains consistent styling throughout the update process by properly managing the props on modal state and preventing unintended style resets. * fix: restore progress bar in task details section Reimplements the progress bar in task details section to be visible in both default and dev mode, while ensuring updates are only possible through the task update modal. Progress bar now maintains a read-only state in the details view while remaining interactive in the modal. * Test: progress update flow modal (RealDevSquad#1291) * fix: failing tests accroding to the component change * test(TaskUpdateModal): add unit tests for TaskUpdateModal component - Test rendering of modal in open and closed states - Verify functionality of close button - Ensure correct props are passed to ProgressContainer and ProgressForm - Mock dependencies (Modal, ProgressContainer, ProgressForm) for isolation - Validate display of current date * fix: test cases after the component gets changed * fix: improve test coverage for TaskUpdateModal component Prevent Unauthorized Message on Mine page when load (RealDevSquad#1296) * fix useAuthentication hook * fix tests * fix flaky tests * wrap async calls with waitFor chore: remove feature flag from the new progress update flow modal (RealDevSquad#1298) feat: add shimmer cards for task loading in dev mode (RealDevSquad#1300) - Added shimmer cards to display while tasks are being fetched in dev mode. - Implemented tests to ensure correct rendering and behavior of shimmer cards. fix_updating_progress_slider_from_mobile (RealDevSquad#1304) Merge pull request RealDevSquad#1292 from AnujChhikara/feature/show-progress-updater-info Feature: Display User Details for Task Progress Updates Merge pull request RealDevSquad#1294 from Hariom01010/fix/Update-users-self-api-endpoint Updated deprecated /users/self API endpoint to the current working endpoint /users?profile=true Update Progress Fetching Logic to Include `dev` Query Parameter (RealDevSquad#1308) * added dev query in getProgressApi hook * fix test naming * add dev=flase test * improve the progresses test Merge pull request RealDevSquad#1315 from VinuB-Dev/remove-ff/tasks-page-shimmer-cards chore: Remove feature flag for shimmer card addition in tasks page. Refactor Tooltip Component to Auto-calculate Position (RealDevSquad#1309) * refactor: tooltip component to auto-calculate position instead of requiring manual input * chore: Declared tooltip constant outside the tooltip functions to reuse the same in showTooltip and hideTooltip functions. * Auto Placement Tooltip changes: - Removed unnecessary comments. - Added aria role and describedby using unique id for tooltip. - Simplified the JSDoc for the component. - Added multiple additional test cases for the tooltip. --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com> Merge pull request RealDevSquad#1323 from iAmAshuSahoo/develop feat: add shimmer effect in the task details page Add modal to acknowledge user about status change on marking progress to 100% (RealDevSquad#1322) * initial commit * refactor code * added feature flag * refactored some code * changed casing and removed comments * changed to predefined colouring * removed unnecessary useCallbacks * removed onstatus function * resolved commented changes * decereased the mismatch between the modal and design doc modal * changed button color * font change * used the already created modal component * dimensional changes * refactored function * small refactoring * async await updated * applied callback on close icon * refactored to named exports * removed a div element * rounded off the rem values * put the close icon inside button wrapper * rounded off rems * rounded off rem values Fixed: Added a button to close model. (RealDevSquad#1312) * Close button added * Added cross button on update modal * Formatting done * All Test Passed * Unnecessery Code Removed * Fix test to check if setIsOpen is called on close button click Tests / Add modal to acknowledge user about status change on marking progress to 100% (RealDevSquad#1324) * initial changes * removed unnecessary lines * removed the onStatusChange tests * added one more check to ensure that the onclose() function is working * added more tests * added should before each line * added braces * added dev flag tests * added the testid check * added skip to tests * added skeleton components to pass linitng checks * added one more test case * removed skips * added a getAllByRole Merge pull request RealDevSquad#1333 from RishiChaubey31/fix/add-testid-to-modal test: Add data-testid to modal and update related tests chore-remove-feature-flag-from-display-userdetails-for-progresses-updates (RealDevSquad#1330) chore: remove feature flag done (RealDevSquad#1334) * chore/remove-featurew-flag-DONE * change in task-status.tsx file , reintialize the COMPLETED value * revert back from COMPLETED to DONE * resolve test cases * resolve test cases * Update TaskDropDown.tsx * Update TaskDropDown.tsx * Update TaskDropDown.tsx --------- Co-authored-by: Vikas Singh <59792866+vikasosmium@users.noreply.github.com> Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com> initial commit refactored code added tests removed status freeze on verfied refactored some parts refactor and remove progress update on status change code refactoring after featureflag removal initial commit
…rogress-updater-info Feature: Display User Details for Task Progress Updates
) * refactor: tooltip component to auto-calculate position instead of requiring manual input * chore: Declared tooltip constant outside the tooltip functions to reuse the same in showTooltip and hideTooltip functions. * Auto Placement Tooltip changes: - Removed unnecessary comments. - Added aria role and describedby using unique id for tooltip. - Simplified the JSDoc for the component. - Added multiple additional test cases for the tooltip. --------- Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com>
… to 100% (RealDevSquad#1322) * initial commit * refactor code * added feature flag * refactored some code * changed casing and removed comments * changed to predefined colouring * removed unnecessary useCallbacks * removed onstatus function * resolved commented changes * decereased the mismatch between the modal and design doc modal * changed button color * font change * used the already created modal component * dimensional changes * refactored function * small refactoring * async await updated * applied callback on close icon * refactored to named exports * removed a div element * rounded off the rem values * put the close icon inside button wrapper * rounded off rems * rounded off rem values
…progress to 100% (RealDevSquad#1324) * initial changes * removed unnecessary lines * removed the onStatusChange tests * added one more check to ensure that the onclose() function is working * added more tests * added should before each line * added braces * added dev flag tests * added the testid check * added skip to tests * added skeleton components to pass linitng checks * added one more test case * removed skips * added a getAllByRole
…id-to-modal test: Add data-testid to modal and update related tests
* chore/remove-featurew-flag-DONE * change in task-status.tsx file , reintialize the COMPLETED value * revert back from COMPLETED to DONE * resolve test cases * resolve test cases * Update TaskDropDown.tsx * Update TaskDropDown.tsx * Update TaskDropDown.tsx --------- Co-authored-by: Vikas Singh <59792866+vikasosmium@users.noreply.github.com> Co-authored-by: Achintya Chatterjee <55826451+Achintya-Chatterjee@users.noreply.github.com>
67c61f1 to
a8947ef
Compare
Date: 13-03-2025
Developer Name: Rishi Chaubey
Issue Ticket Number
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
migration.mp4
Test Coverage
Screenshot 1
Additional Notes
Summary by CodeRabbit
New Features
Style