Skip to content

Addition of the task status dropdown and the extension status button on status site task card#1336

Closed
RishiChaubey31 wants to merge 15 commits intoRealDevSquad:developfrom
RishiChaubey31:feature-migration-rds-status
Closed

Addition of the task status dropdown and the extension status button on status site task card#1336
RishiChaubey31 wants to merge 15 commits intoRealDevSquad:developfrom
RishiChaubey31:feature-migration-rds-status

Conversation

@RishiChaubey31
Copy link
Copy Markdown
Contributor

@RishiChaubey31 RishiChaubey31 commented Mar 10, 2025

Date: 13-03-2025

Developer Name: Rishi Chaubey


Issue Ticket Number

Description

  • Integration of task status update button in the task card on Status site
  • Its the part of migration of features from my site to status site
  • removed the task dropdown modal from the dropdown component
  • skipped four tests for removing the modal
  • Changing status should not alter the progress bar

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
migration.mp4

Test Coverage

Screenshot 1

Screenshot 2025-03-17 003213

Screenshot 2025-03-17 004317

Screenshot 2025-03-17 004355

Screenshot 2025-03-17 005754

Additional Notes

Summary by CodeRabbit

  • New Features

    • Added enhanced task status management with conditional editing interfaces and real-time feedback notifications for both successful updates and errors.
    • Improved the task editing workflow by allowing users to update their own tasks under appropriate conditions.
  • Style

    • Refined the visual presentation of task cards with updated typography, spacing, and interactive button effects for a more cohesive user experience.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 10, 2025

@RishiChaubey31 is attempting to deploy a commit to the RDS-Team Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 10, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes update several task-related components and style definitions. In the TaskDropDown component, a conditional block activated by isDevMode renders an enhanced UI with extra attributes and a nested model component. The TaskStatusEditMode component now incorporates a new mutation hook for self task updates and enhanced toast notifications. The task card rendering logic in index.tsx is modified to leverage additional user data for conditionally enabling the edit interface. Additional CSS classes are introduced in the module stylesheet, and new status message constants are added to the constants file.

Changes

File(s) Change Summary
src/components/tasks/TaskDropDown.tsx Added a conditional isDevMode block that renders an enhanced label, select dropdown (with testing attributes), and includes the TaskDropDownModel component with extra props.
src/components/tasks/card/TaskStatusEditMode.tsx,
src/components/tasks/card/index.tsx
Introduced a new mutation hook useUpdateSelfTaskMutation; updated the task status updating flow to conditionally execute self task updates with toast notifications; enhanced user data handling to conditionally render the edit interface based on dev mode and user ownership.
src/components/tasks/card/card.module.scss Added new CSS classes (.cardPurposeAndStatusFont, .cardPurposeText, .taskStatusDateAndPurposeContainer, .taskStatusUpdate) to improve styling for fonts, layout, and button interactions.
src/constants/constants.ts Added two new status constants: STATUS_UPDATE_SUCCESSFUL and STATUS_UPDATE_ERROR for use in task status update notifications.

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
Loading

Suggested reviewers

  • AnujChhikara
  • iamitprakash

Poem

I'm a rabbit on the run,
Hopping through code under the sun,
With dropdowns and tasks shining anew,
Bugs take a leap like morning dew,
Celebrating changes with a joyful run! 🐇✨


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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
Copy Markdown

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

🧹 Nitpick comments (4)
src/components/tasks/TaskDropDown.tsx (1)

105-138: Enhanced UI for development mode looks good

The 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 taskStatusDateAndPurposeContainer doesn't clearly convey why it's different from taskStatusAndDateContainer in 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 isDevMode as 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 renderTaskStatusComponent function 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

📥 Commits

Reviewing files that changed from the base of the PR and between b9d9182 and e7c8d20.

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

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

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

Good addition of the useUpdateSelfTaskMutation hook alongside the existing task update mutation.


14-19: LGTM - Added necessary imports for notifications

Good addition of the status update constants and toast functionality for providing user feedback.


25-25: LGTM - Added isSelfTask prop to Props interface

Good addition of the optional isSelfTask prop to allow for conditional behavior based on whether the task belongs to the current user.


49-50: LGTM - Added required hooks and constants

Good setup of the updateSelfTask mutation hook and toast type constants.


107-107: LGTM - Conditional StatusIndicator rendering

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

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

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

The 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 data and isUserAuthorized from 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:

  • isSelfTask checks if the current user is the assignee
  • isVerifiedTask checks if the task is in VERIFIED status

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

@RealDevSquad RealDevSquad deleted a comment from coderabbitai bot Mar 12, 2025
@RishiChaubey31 RishiChaubey31 marked this pull request as draft March 13, 2025 17:01
@RishiChaubey31 RishiChaubey31 marked this pull request as ready for review March 16, 2025 19:34
@RishiChaubey31 RishiChaubey31 requested a review from tejaskh3 March 17, 2025 03:56
Copy link
Copy Markdown
Contributor

@AnujChhikara AnujChhikara left a comment

Choose a reason for hiding this comment

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

hello @RishiChaubey31

  • do you have any design doc for this feature?
  • also please add test coverage stats

@MayankBansal12
Copy link
Copy Markdown
Member

@RishiChaubey31 Please update the PR title

@RishiChaubey31 RishiChaubey31 changed the title Added missing features in status site Addition of the task status dropdown and the extension status button on status site task card Mar 28, 2025
pankajjs and others added 9 commits April 3, 2025 00:15
---------

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>
RishiChaubey31 and others added 6 commits April 3, 2025 00:44
… 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>
@RishiChaubey31 RishiChaubey31 force-pushed the feature-migration-rds-status branch from 67c61f1 to a8947ef Compare April 2, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat : add missing features in Task Card Component

7 participants