Skip to content

Conversation

@ameerul-deriv
Copy link
Contributor

@ameerul-deriv ameerul-deriv commented Nov 9, 2023

Changes:

Please provide a summary of the change.

  • passed missing value prop which is causing the console log issues
  • fixed the console log issue when the user finishes editing their advert by removing observer from the component.
  • added useP2PAdvertiserPaymentMethods hook's update function instead of using my-profile-store's updatePaymentMethod function
  • Deleted updatePaymentMethod from my-profile-store
  • Also fixed console error showing after clicking on adding payment method in buy sell modal.
  • Issue was because we are passing a component as a title which is wrapped by Text, so instead opted to pass in the string only
  • Also added other props for return icon and onReturn functions.

Screenshots:

Please provide some screenshots of the change.

Staging console errors while adding/editing payment method

Screen.Recording.2023-11-09.at.11.24.30.AM.mov

No more console errors while adding/editing payment method

Screen.Recording.2023-11-09.at.11.25.48.AM.mov

Previous Console Error related to payment method in buy sell modal

Screen.Recording.2023-11-30.at.11.44.19.AM.mov

No more error

Screen.Recording.2023-11-30.at.11.44.52.AM.mov

@vercel
Copy link

vercel bot commented Nov 9, 2023

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Nov 30, 2023 4:00am

};

export default observer(EditPaymentMethodForm);
export default EditPaymentMethodForm;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrapping this component with observer caused the console logging error issue, which is caused by updating the payment method, which is then updating any observables inside this component whilst it is unmounting.

We don't need to have observer wrapping this component since it doesn't need to listen to any changes except if there are errors whilst updating the payment method

@coveralls
Copy link

coveralls commented Nov 9, 2023

Coverage Status

coverage: 29.024%. remained the same
when pulling 038ced9 on ameerul-deriv:FEQ-872-getting-console-error-when-adding-payment-method
into 36d1841 on binary-com:master.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 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/11293](https://github.com/binary-com/deriv-app/pull/11293)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-ameerul-deriv-feq-872-getting-console-80afee.binary.sx?qa_server=red.derivws.com&app_id=32761
    - **Original**: https://deriv-app-git-fork-ameerul-deriv-feq-872-getting-console-80afee.binary.sx
- **App ID**: `32761`

@github-actions
Copy link
Contributor

github-actions bot commented Nov 9, 2023

🚨 Lighthouse report for the changes in this PR:

Category Score
🔺 Performance 16
🟧 Accessibility 75
🟢 Best practices 92
🟢 SEO 92
🟧 PWA 80

Lighthouse ran with https://deriv-app-git-fork-ameerul-deriv-feq-872-getting-console-80afee.binary.sx/

farrah-deriv
farrah-deriv previously approved these changes Nov 9, 2023
@chrisgodfrey-deriv
Copy link

Please use the [FEQ] prefix for the PR title
Nice PR description though!

@ameerul-deriv ameerul-deriv changed the title Ameerul /FEQ-872 Getting console error while adding payment method in P2P [FEQ] Ameerul /FEQ-872 Getting console error while adding payment method in P2P Nov 10, 2023
@gitguardian
Copy link

gitguardian bot commented Nov 30, 2023

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id Secret Commit Filename
- Generic High Entropy Secret 3134575 nx.json View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
7.0% 7.0% Duplication

onReturn={onReturn}
portalId='modal_root'
title={<BuySellModalTitle is_buy={is_buy_advert} />}
title={getModalTitle()}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted to pass a string instead of the component because this is what caused the console error issues. Because we had passed it as a component, the title prop in Modal component is wrapped inside Text which is strange as we had previously returned it as a Text Component.

We could create another prop for specifically passing a component, but the styles are already there, and we don't need to repeat it again and style it ourselves from the child to the parent.

There's no issue with the MobileFullPageModal, so I had left it as it is

@github-actions
Copy link
Contributor

github-actions bot commented Nov 30, 2023

Generating Lighthouse report...

@ameerul-deriv ameerul-deriv changed the title [FEQ] Ameerul /FEQ-872 Getting console error while adding payment method in P2P [FEQ] Ameerul /FEQ-872/Getting console error while adding payment method in P2P Nov 30, 2023
@ameerul-deriv ameerul-deriv changed the title [FEQ] Ameerul /FEQ-872/Getting console error while adding payment method in P2P [FEQ] Ameerul / FEQ-872 / Getting console error while adding payment method in P2P Nov 30, 2023
@github-actions
Copy link
Contributor

❌ Smoke test run (1) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (2) failed. See logs for details: Visit Action

@github-actions
Copy link
Contributor

❌ Smoke test run (1) failed. See logs for details: Visit Action

@farrah-deriv farrah-deriv merged commit 73cdb3a into deriv-com:master Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants