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-1886 / Kate / Trade type updates #17501

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kate-deriv
Copy link
Contributor

@kate-deriv kate-deriv commented Nov 13, 2024

Changes:

  • Expanded functionality of Carousel: added opportunity to pass custom icons (instead of default arrows) and callbacks for onNextButtonClick and onPreviousButtonClick.
  • Refactored Guide and GuideDescriptionModal: made triggering button optional, added opportunity to chose if the content should be shown in a modal or not. Did decomposition.
  • Refactored TradeTypes: added carousel inside, did decomposition.
  • Removed divider from trade types list.
  • Refactored tests.

Screenshots:

Screen.Recording.2024-11-13.at.5.54.46.PM.mov

Screenshot 2024-11-13 at 6 40 05 PM
Screenshot 2024-11-13 at 6 40 24 PM
Screenshot 2024-11-13 at 6 40 45 PM

Copy link

vercel bot commented Nov 13, 2024

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Nov 13, 2024 3:30pm

Copy link
Contributor

github-actions bot commented Nov 13, 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/17501](https://github.com/deriv-com/deriv-app/pull/17501)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-kate-deriv-kate-dtra-1886addcarouselt-1c6c3f.binary.sx?qa_server=red.derivws.com&app_id=23938
    - **Original**: https://deriv-app-git-fork-kate-deriv-kate-dtra-1886addcarouselt-1c6c3f.binary.sx
- **App ID**: `23938`

Copy link
Contributor

github-actions bot commented Nov 13, 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-1886addcarouselt-1c6c3f.binary.sx/

@coveralls
Copy link

coveralls commented Nov 13, 2024

Pull Request Test Coverage Report for Build 11820720075

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

  • 44 of 45 (97.78%) changed or added relevant lines in 9 files are covered.
  • 166 unchanged lines in 13 files lost coverage.
  • Overall coverage decreased (-0.04%) to 53.165%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/trader/src/AppV2/Containers/Trade/trade-types.tsx 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
packages/trader/src/AppV2/Components/TradeParameters/Barrier/barrier.tsx 1 77.78%
packages/wallets/src/components/DerivAppsSection/DerivAppsGetAccount.tsx 1 89.8%
packages/wallets/src/features/cfd/screens/CompareAccounts/CompareAccountsTitleIcon.tsx 1 95.06%
packages/trader/src/AppV2/Components/TradeParameters/Barrier/barrier-input.tsx 2 94.59%
packages/trader/src/AppV2/Utils/trade-params-utils.tsx 2 86.4%
packages/wallets/src/components/DerivAppsSection/DerivAppsTradingAccount.tsx 2 80.65%
packages/wallets/src/components/OptionsAndMultipliersListing/OptionsAndMultipliersListing.tsx 2 83.67%
packages/wallets/src/features/cfd/components/CFDPlatformsListAccounts/CFDPlatformsListAccounts.tsx 3 56.52%
packages/wallets/src/features/cfd/constants.tsx 4 74.47%
packages/wallets/src/features/cfd/screens/CompareAccounts/compareAccountsConfig.ts 5 77.65%
Totals Coverage Status
Change from base Build 11814538338: -0.04%
Covered Lines: 32713
Relevant Lines: 57387

💛 - Coveralls

@@ -57,9 +62,9 @@ const DraggableCategory: React.FC<{
category: TDraggableListCategory;
draggedItemId: string | null;
onRightIconClick: (item: TDraggableListItem) => void;
onAction?: () => void;
}> = ({ category, draggedItemId, onRightIconClick, onAction }) => (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

onAction was not used in this file, hence removing

render(<CarouselHeader {...mock_props} current_index={1} />);

const arrow_icon = screen.getByText('LabelPairedArrowLeftMdRegularIcon');
expect(arrow_icon).toBeInTheDocument();

expect(mock_props.onPrevClick).not.toBeCalled();
userEvent.click(arrow_icon);
await userEvent.click(arrow_icon);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here and below all async-await were added automatically
Screenshot 2024-11-13 at 5 43 43 PM

pages={action_sheet_content}
title={<Localize i18n_default_text='Trade types' />}
next_icon={LabelPairedPresentationScreenSmRegularIcon}
onNextButtonClick={() => sendOpenGuideToAnalytics(contract_type, 'trade_type_page')}
Copy link
Contributor Author

@kate-deriv kate-deriv Nov 13, 2024

Choose a reason for hiding this comment

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

Added function for analytics collection. Previously it was inside Guide button, but now we are not rendering this part in trade type selection modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kate-deriv kate-deriv marked this pull request as ready for review November 13, 2024 15:41
@kate-deriv kate-deriv changed the title DTRA-1886 / Kate / Trade type updates [WIP] DTRA-1886 / Kate / Trade type updates Nov 13, 2024
Copy link
Contributor

github-actions bot commented Nov 13, 2024

Generating Lighthouse report...

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.

3 participants