Skip to content

Conversation

@Dhirenderchoudhary
Copy link
Contributor

@Dhirenderchoudhary Dhirenderchoudhary commented Dec 25, 2025

Date: 25-12-2025

Developer Name: Dhirender


Issue Ticket Number:-

#1109

Description:

The OOO feature is migrated from the user status page to the requests module by removing the dev=true feature flag. This change makes all OOO requests go through the approval workflow, ,so that no developer can change there OOO status by there own.

Is Under Feature Flag

  • Yes
  • No

Database changes

  • Yes
  • No

Breaking changes

  • Yes
  • No

Is Development Tested?

  • Yes
  • No

Tested in staging?

  • Yes
  • No

Screenshot below

Screenshot 2025-12-25 at 7 04 17 AM Screenshot 2025-12-25 at 7 02 54 AM Screenshot 2025-12-27 at 7 18 13 PM Screenshot 2025-12-27 at 7 18 37 PM

@coderabbitai
Copy link

coderabbitai bot commented Dec 25, 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

This PR removes dev mode feature flagging from user status components and consolidates the Out Of Office (OOO) workflow to exclusively use a dedicated createOOORequest method. The dev mode conditional logic is eliminated from components, templates, constants, and tests while maintaining existing OOO functionality through a unified request path.

Changes

Cohort / File(s) Summary
Component Logic & API Updates
app/components/user-status-modal.js, app/constants/apis.js
Removed featureFlag service dependency; simplified updateStatusBasedOnMode signature from (isDevMode, newStateObj) to (newStateObj); updated OOO request invocation to use newStateObj.from and newStateObj.until instead of component properties; removed dev=true query parameter from CREATE_OOO_REQUEST_URL constant
Template & UI Updates
app/components/user-status.hbs, app/templates/status.hbs, app/components/user-status.js
Removed @dev-based conditional branching for OOO button rendering; updated OOO option display text from "Change your status to OOO" to "Request OOO Status"; removed @dev={{this.isDevMode}} prop from component invocations
Test Updates
tests/integration/components/user-status-modal-test.js, tests/integration/components/user-status-test.js
Replaced @updateStatus prop with @createOOORequest in UserStatusModal test; removed @dev and isDevMode test state; updated test assertions to validate createOOORequest(from, until, reason) payload structure; updated text assertion for OOO button label

Possibly related issues

  • website-dashboard#1033: Consolidates OOO workflow to use dedicated requests API path instead of dev-mode conditional status updates, aligning with the retrieved issue's OOO migration to /requests endpoint.
  • website-www#1109: Migrates OOO handling from direct status changes to a requests-based flow by routing through createOOORequest and updating the API constant, matching the retrieved issue's unified OOO workflow requirement.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Away with dev flags, hop and bound,
The OOO path is now profound!
One method true, no branching ways,
Cleaner code through brighter days! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description clearly explains the migration of the OOO feature from the user status page to the requests module by removing the dev flag, aligning with the changeset modifications.
Title check ✅ Passed The title 'Feature flag removed : user OOO approve reject' mentions feature flag removal and references OOO approval/rejection, which aligns with the PR's objective of removing the dev feature flag and migrating OOO to an approval workflow.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f0b914 and 2179472.

📒 Files selected for processing (7)
  • app/components/user-status-modal.js
  • app/components/user-status.hbs
  • app/components/user-status.js
  • app/constants/apis.js
  • app/templates/status.hbs
  • tests/integration/components/user-status-modal-test.js
  • tests/integration/components/user-status-test.js
🧰 Additional context used
🧬 Code graph analysis (2)
tests/integration/components/user-status-modal-test.js (1)
tests/unit/controllers/status-test.js (6)
  • from (134-134)
  • from (179-179)
  • until (135-137)
  • until (180-182)
  • reason (138-138)
  • reason (183-183)
app/components/user-status-modal.js (1)
app/constants/user-status.js (2)
  • USER_STATES (18-24)
  • USER_STATES (18-24)
🔇 Additional comments (8)
app/components/user-status.js (1)

23-23: LGTM! UI text accurately reflects the new approval workflow.

The message change from "Change your status to OOO" to "Request OOO Status" correctly communicates that OOO now requires approval rather than being an immediate status change.

tests/integration/components/user-status-test.js (1)

49-49: LGTM! Test expectation correctly updated.

The test assertion correctly reflects the UI text change to "Request OOO Status".

app/components/user-status.hbs (1)

28-53: LGTM! Dev mode branching successfully removed.

The conditional logic now consistently renders OOO-related options without dev mode checks:

  • Shows "Cancel OOO" button when status is OOO
  • Shows available status options (including "Request OOO Status") for other statuses

This correctly implements the migration away from feature-flagged dev mode.

app/components/user-status-modal.js (2)

57-57: LGTM! Simplified method signature.

The removal of the isDevMode parameter from updateStatusBasedOnMode correctly reflects the elimination of dev mode branching logic.


107-117: LGTM! Logic correctly refactored from dev mode to status type.

The method now branches based on newStatus type rather than dev mode, which is the correct approach. For OOO status, it calls createOOORequest with the timestamp fields from newStateObj, and for other statuses, it calls updateStatus with the complete status object.

tests/integration/components/user-status-modal-test.js (1)

56-73: LGTM! Test correctly validates the new createOOORequest API.

The test properly validates the new OOO request flow:

  • Handler signature matches createOOORequest(from, until, reason)
  • Validates reason is passed correctly
  • Validates from and until are numeric timestamps
  • Component receives the @createOOORequest prop

Also applies to: 81-81

app/templates/status.hbs (1)

9-9: The controller correctly implements the createOOORequest action.

The status controller implements createOOORequest at line 70 with the expected signature (from, until, reason). The action properly converts date parameters, makes the API request to CREATE_OOO_REQUEST_URL, and handles responses with appropriate toast notifications. The updateStatus action remains in place for non-OOO status flows.

app/constants/apis.js (1)

38-38: The endpoint integration is properly implemented in the frontend; backend confirmation is needed separately.

The CREATE_OOO_REQUEST_URL endpoint is correctly configured without the dev=true parameter and consistently used across the codebase. The POST request includes proper error handling and request validation. However, verification that the backend /requests endpoint exists and properly handles OOO request creation requires confirmation from the backend service, which is outside the scope of code review.

@MayankBansal12
Copy link
Member

@Dhirenderchoudhary

  • Please improve PR title and link issue correctly
  • Please attach screen recording for working of your feature
  • Build is failing please fix the test

@Dhirenderchoudhary Dhirenderchoudhary changed the title code changes OOO flow Migrated from users page to request flow Migrate OOO Flow to Requests. Dec 25, 2025
Comment on lines 114 to 116
} else {
await this.args.updateStatus({ currentStatus: newStateObj });
}
Copy link
Member

Choose a reason for hiding this comment

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

any other case where code would reach this else statement? we can only change status to OOO, is there any other status available?

@MayankBansal12
Copy link
Member

MayankBansal12 commented Dec 28, 2025

@Dhirenderchoudhary

  • Please improve PR title, see other merged PRs for reference
  • One test is failing in CI, kindly look into that

@Dhirenderchoudhary Dhirenderchoudhary changed the title Migrate OOO Flow to Requests. Feature flag removed : user OOO approve reject Dec 28, 2025
@iamitprakash iamitprakash merged commit 9108de8 into RealDevSquad:develop Dec 31, 2025
3 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 31, 2025
10 tasks
@MayankBansal12 MayankBansal12 mentioned this pull request Dec 31, 2025
10 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 1, 2026
9 tasks
iamitprakash added a commit that referenced this pull request Jan 1, 2026
* Feature flag removed : user OOO approve reject (#1110)

* code changes OOO flow Migrated from users page to request flow

* removed console log

* changed assert.expect

* fix: pass date strings instead of timestamps to createOOORequest

* fixed errors

* wrong commit fix

* removed else

* removed stateobj

---------

Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom>

* fix: OOO migration date issues (#1112)

* fixed date issues

* fix lint

---------

Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom>

* fix: Update OOO request button text (#1116)

* message changed

* message fix

* lint fix

---------

Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom>

---------

Co-authored-by: Dhirender Choudhary <[email protected]>
Co-authored-by: Dhirenderchoudhary <dhirenderchoudhary0001@gmailcom>
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.

4 participants