Skip to content

Conversation

@adrienne-deriv
Copy link
Contributor

Changes:

Please provide a summary of the change.

Screenshots:

Please provide some screenshots of the change.

@boring-cyborg boring-cyborg bot added the Core label Sep 20, 2023
@vercel
Copy link

vercel bot commented Sep 20, 2023

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Sep 20, 2023 9:01am

@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

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

Click here to copy & paste above information.
- **PR**: [https://github.com/binary-com/deriv-app/pull/10191](https://github.com/binary-com/deriv-app/pull/10191)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-adrienne-deriv-wallets-generic-modal.binary.sx?qa_server=red.binaryws.com&app_id=31497
    - **Original**: https://deriv-app-git-fork-adrienne-deriv-wallets-generic-modal.binary.sx
- **App ID**: `31497`

@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 21
🟧 Accessibility 75
🟢 Best practices 92
🟧 SEO 85
🟢 PWA 90

Lighthouse ran with https://deriv-app-git-fork-adrienne-deriv-wallets-generic-modal.binary.sx/

yashim-deriv
yashim-deriv previously approved these changes Sep 20, 2023
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 18 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 15 Code Smells

No Coverage information No Coverage information
13.3% 13.3% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@coveralls
Copy link

coveralls commented Sep 20, 2023

Coverage Status

coverage: 10.584%. remained the same when pulling 87b4d15 on adrienne-deriv:wallets-generic-modal into 790dd16 on binary-com:master.

Copy link

@review-deriv review-deriv left a comment

Choose a reason for hiding this comment

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

AI Review (AI review can be wrong. Do not use it as the only source of feedback)

This code seems reasonably organized and functional for a ModalProvider component and the provider is suitably incorporated in the main application.

However, there are a few areas that could be improved:

  1. Null reference: document.getElementById('wallets_modal_root') can return null and this isn't being handled. The code assumes that a div with id 'wallets_modal_root' would always exist, which if not met, could lead to further problems at runtime when attempting to use createPortal.

  2. Error Handling: The function useModal throws an error if the context isn't available, but there is no catch or user-friendly fallback set up.

  3. Security: There's no explicit security issue present in the given code since it doesn't deal with any sensitive user data, API requests etc. However, injecting user supplied contents within modal could lead to a potential risk of XSS(Cross Site Scripting) vulnerabilities.

In summary, the code is solid in terms of the basic functionality of modal display context setup, but it needs to address null reference issues and has somewhat barebones error handling. It doesn't explicitly have any security issues but care should be taken when integrating it.

@yashim-deriv yashim-deriv merged commit c3023e7 into deriv-com:master Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants