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

Streamline OS Redirect logic and enhance cookie management for accounts redirection #17877

Conversation

shahzaib-deriv
Copy link
Contributor

@shahzaib-deriv shahzaib-deriv commented Dec 23, 2024

This PR adds the OSRedirect component to improve its functionality and maintainability with the following changes:

Changes

  • Enhanced cookie management with support for wallet login ID
  • Combined separate route lists into a unified routes_list for better maintainability
  • Added new routes for financial and trading assessment redirects
  • Simplified route handling logic by removing redundant conditionals
  • Improved type handling for trade routes
  • Streamlined cookie removal process using array iteration

Technical Details

  • Added handling for active_wallet_loginid cookie
  • Merged dtrader_routes and accounts_routes into a single routes_list
  • Added new patterns for /financial-assessment and /trading-assessment routes
  • Simplified route matching and redirection logic

amina-deriv and others added 9 commits November 25, 2024 08:29
* feat: test redirection

* feat: test redirection

* Amina/redirection test (deriv-com#17606)

* feat: test redirection

* feat: test redirection

* fix: query param

* fix: sidebar

* fix: sidebar

* fix: linting --no-verify

* fix: button

* fix: button
* Amina/redirection test (deriv-com#17643)

* feat: test redirection

* feat: test redirection

* Amina/redirection test (deriv-com#17606)

* feat: test redirection

* feat: test redirection

* fix: query param

* fix: sidebar

* fix: sidebar

* fix: linting --no-verify

* fix: button

* fix: button

* feat: add OSRedirect component and update routes config

* chore: wait for logged in state before redirection

---------

Co-authored-by: amina-deriv <[email protected]>
Copy link

vercel bot commented Dec 23, 2024

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Dec 24, 2024 4:46am

Copy link
Contributor

github-actions bot commented Dec 23, 2024

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 32
🟧 Accessibility 70
🟢 Best practices 92
🟧 SEO 77
🟧 PWA 78

Lighthouse ran with https://deriv-app-git-fork-shahzaib-deriv-config-redirects-from-aea58d.binary.sx/

- Remove direct redirection to hub.deriv.com from page-overlay
- Add is_from_tradershub_os computed property in common store
- Add platform detection utility for traders hub OS
- Update types and components to handle traders hub OS platform
- Clean up imports organization in page-overlay component
@coveralls
Copy link

coveralls commented Dec 23, 2024

Pull Request Test Coverage Report for Build 12478155101

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 1 of 24 (4.17%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.02%) to 53.883%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/src/App/Constants/routes-config.js 0 1 0.0%
packages/core/src/App/Containers/OSRedirect/os-redirect.tsx 1 23 4.35%
Files with Coverage Reduction New Missed Lines %
packages/bot-web-ui/src/app/app-main.tsx 1 84.21%
packages/trader/src/App/Components/Elements/market-countdown-timer.tsx 1 83.7%
packages/trader/src/AppV2/Components/ServicesErrorSnackbar/services-error-snackbar.tsx 1 90.32%
packages/trader/src/AppV2/Components/TradeParameters/Barrier/barrier-input.tsx 1 94.64%
Totals Coverage Status
Change from base Build 12431059658: -0.02%
Covered Lines: 33039
Relevant Lines: 57141

💛 - Coveralls

@shahzaib-deriv shahzaib-deriv changed the title Config/redirects from os to deriv app Streamline OS Redirect logic and enhance cookie management for accounts redirection Dec 24, 2024
habib-deriv
habib-deriv previously approved these changes Dec 24, 2024
Copy link
Contributor

github-actions bot commented Dec 24, 2024

A production App ID was automatically generated for this PR. (log)

Click here to copy & paste above information.
- **PR**: [https://github.com/deriv-com/deriv-app/pull/17877](https://github.com/deriv-com/deriv-app/pull/17877)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-shahzaib-deriv-config-redirects-from-aea58d.binary.sx?qa_server=red.derivws.com&app_id=23848
    - **Original**: https://deriv-app-git-fork-shahzaib-deriv-config-redirects-from-aea58d.binary.sx
- **App ID**: `23848`

@shahzaib-deriv shahzaib-deriv self-assigned this Dec 24, 2024
Copy link
Contributor

Generating Lighthouse report...

@shahzaib-deriv shahzaib-deriv merged commit 8fd853a into deriv-com:master Dec 24, 2024
26 checks passed
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.

6 participants