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

DTRA / Kate / DTRA-1722 / Show error message on purchase button if index was turned off from BO #16705

Merged

Conversation

kate-deriv
Copy link
Contributor

@kate-deriv kate-deriv commented Sep 2, 2024

Changes:

  • Added disabling logic for purchase button if index was turned off from BO + added text with error under the label.
  • Added conditional rendering for PPP (Vanillas), Barrier (Turbos), Max payout (Acc): ff there is an error, we won't render them. In case if values haven't not loaded yet we would show Skeleton Loader.
  • Refactored tests

Screenshots:

Screenshot 2024-09-02 at 4 27 53 PM
Screenshot 2024-09-02 at 3 14 53 PM
Screenshot 2024-09-02 at 3 14 45 PM

@boring-cyborg boring-cyborg bot added the Trader label Sep 2, 2024
Copy link

vercel bot commented Sep 2, 2024

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Sep 2, 2024 2:00pm

Copy link
Contributor

github-actions bot commented Sep 2, 2024

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/16705](https://github.com/binary-com/deriv-app/pull/16705)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-kate-deriv-kate-dtra-1722showerrorfrombo.binary.sx?qa_server=red.derivws.com&app_id=32766
    - **Original**: https://deriv-app-git-fork-kate-deriv-kate-dtra-1722showerrorfrombo.binary.sx
- **App ID**: `32766`

Copy link
Contributor

github-actions bot commented Sep 2, 2024

🚨 Lighthouse report for the changes in this PR:

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

Lighthouse ran with https://deriv-app-git-fork-kate-deriv-kate-dtra-1722showerrorfrombo.binary.sx/


const getAmount = () => {
const { stake, obj_contract_basis } = info;

if (is_multiplier) return stake;
if (is_accumulator) return Number(current_stake);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed is_accumulator from checks in this component as we do not render content for Accumulator purchase button anymore.

return payout;
};

if (is_vanilla || is_vanilla_fx || is_turbos || is_high_low || is_touch) return null;
Copy link
Contributor Author

@kate-deriv kate-deriv Sep 2, 2024

Choose a reason for hiding this comment

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

All this checks are now inside of has_no_button_content prop. I moved it to parent component as I don't want to pass extra props.

Copy link

sonarcloud bot commented Sep 2, 2024

}: TPurchaseButtonContent) => {
const { current_stake: localized_current_stake, payout, stake } = getLocalizedBasis();
if (has_no_button_content && !error) return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can move this check to the parent (create conditional rendering) but only after Maryia's PR will be merged

@kate-deriv kate-deriv marked this pull request as ready for review September 2, 2024 13:42
@coveralls
Copy link

coveralls commented Sep 2, 2024

Coverage Status

coverage: 47.057% (+0.008%) from 47.049%
when pulling 871f2ba on kate-deriv:kate/DTRA-1722/show_error_from_bo
into 74f7bfd on binary-com:master.

Copy link
Contributor

github-actions bot commented Sep 2, 2024

Generating Lighthouse report...

@vinu-deriv vinu-deriv merged commit fc46cb5 into binary-com:master Sep 4, 2024
9 checks passed
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.

4 participants