Skip to content

Conversation

farhan-nurzi-deriv
Copy link
Contributor

Changes:

  • Creating new hook useAdvertiserAdverts to get the list of adverts under the current client
  • Write test cases for the hook

Copy link

vercel bot commented Dec 14, 2023

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

Name Status Preview Updated (UTC)
deriv-app ✅ Ready (Inspect) Visit Preview Dec 14, 2023 6:56am

@coveralls
Copy link

coveralls commented Dec 14, 2023

Coverage Status

coverage: 31.623% (+0.005%) from 31.618%
when pulling 5491f0e on farhan-nurzi-deriv:farhan/p2p-advertiser-adverts-hook
into f3020d6 on binary-com:master.

Copy link
Contributor

github-actions bot commented Dec 14, 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/12262](https://github.com/binary-com/deriv-app/pull/12262)
- **URLs**:
    - **w/ App ID + Server**: https://deriv-app-git-fork-farhan-nurzi-deriv-farhan-p2p-adverti-62995b.binary.sx?qa_server=red.derivws.com&app_id=24186
    - **Original**: https://deriv-app-git-fork-farhan-nurzi-deriv-farhan-p2p-adverti-62995b.binary.sx
- **App ID**: `24186`

Copy link
Contributor

github-actions bot commented Dec 14, 2023

🚨 Lighthouse report for the changes in this PR:

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

Lighthouse ran with https://deriv-app-git-fork-farhan-nurzi-deriv-farhan-p2p-adverti-62995b.binary.sx/

jim-deriv
jim-deriv previously approved these changes Dec 14, 2023
jim-deriv
jim-deriv previously approved these changes Dec 14, 2023
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
5.5% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

Generating Lighthouse report...

return flatten_data.map(advert => ({
...advert,
/** Determine if the rate is floating or fixed */
is_floating: advert?.rate_type === 'float',
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are checking the undefined data you don't need to pass optional chain here and for the rest of the keys/values in this obj

Suggested change
is_floating: advert?.rate_type === 'float',
is_floating: advert.rate_type === 'float',

Copy link
Contributor Author

@farhan-nurzi-deriv farhan-nurzi-deriv Dec 18, 2023

Choose a reason for hiding this comment

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

The value inside the flatten_map can still be undefined because the return value from flatten map can be p2p_advert_list[] or undefined[] @niloofar-deriv 🙏

image

@ali-hosseini-deriv ali-hosseini-deriv merged commit 48a5018 into deriv-com:master Dec 21, 2023
lubega-deriv pushed a commit to lubega-deriv/deriv-app that referenced this pull request Dec 26, 2023
* feat: ✨ createuseAdvertiserAdverts hook

* chore: add test for fetchnextpage

* chore: ✨ add doc for function

Signed-off-by: lubega-deriv <lubega@deriv.com>
lubega-deriv pushed a commit to lubega-deriv/deriv-app that referenced this pull request Dec 26, 2023
* feat: ✨ createuseAdvertiserAdverts hook

* chore: add test for fetchnextpage

* chore: ✨ add doc for function

Signed-off-by: lubega-deriv <lubega@deriv.com>
farhan-nurzi-deriv added a commit to farhan-nurzi-deriv/deriv-app that referenced this pull request Dec 27, 2023
* feat: ✨ createuseAdvertiserAdverts hook

* chore: add test for fetchnextpage

* chore: ✨ add doc for function

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>
matin-deriv pushed a commit that referenced this pull request Dec 29, 2023
…#12424)

* chore: ✨ unit tests for WalletListCardDetails component

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Hamza/2302/create password component (#12418)

* chore: create password component

* chore: create password component new files

* chore: update the width

* chore: added the description

* chore: destructure the React Fc

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Aizad/TRAH-2305/Content Switcher (#12409)

* chore: added Content Switcher Tab inside of Tradershub package

* fix: updated TSDocs with examples

* fix: split components into different files

* chore: fix sonarcloud issues
- wrapped ContentHeaderList with memo
- wrapped activeIndex, setActiveIndex with memo
- rename useTabIndex to useContentSwitch for global use

* fix: resolve comments

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [DTRA] Maryia/DTRA-484/feat: hide uncontrolled popover tooltip when target icon is tapped again (#11881)

* feat: update popover functionality to toggle bubble when target is focused

* chore: removed state control from outside for vanilla and turbos

* docs: update readme

* test: add test for popover

* test: popover

* feat: add useDevice hook to components

* test: fix tests

* revert: unnecessary setting of visibility from events in bubble

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: added jurisdiction footnote title (#12426)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [FEQ] Ameerul / FEQ-1002 / P2P Order Create Hook (#12246)

* feat: added p2p_order_create hook

* chore: changed comments

* fix: annotations

* chore: added tsdoc for response

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* translations: 📚 sync translations with crowdin (#12432)

Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com>
Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Lubega /WALL-3053/ Chore: WalletTextField unit test (#12356)

* chore: wallet textfield unit test

* fix: applied comments

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL?] [Fix] Rostislav / WALL-2260 / Fix legacy cashier crypto withdrawal page error message (#11983)

* fix: the thing

* refactor: padding

* fix: line-height

* refactor: increase gap a bit

* refactor: `margin-inline`

* fix: appearance

* refactor: merge conflict

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* refactor: minor

* fix: align padding w Figma

* refactor: better css

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* Ako/ fix account status type (#12434)

* ci: fix account status type

* build: update package-lock

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* style: 💄 remove gaps between accounts (#12411)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* style: 💄 fix left and right paddings around label (#12412)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: unused computed value removed payment_methods_list_values from store (#12388)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: ✨ unit test for TradingAccountCard component (#12358)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* chore: ✨ unit tests for WalletListCardBadge component (#12389)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [FEQ] Farhan/FEQ-993/P2P advertiser Adverts (#12262)

* feat: ✨ createuseAdvertiserAdverts hook

* chore: add test for fetchnextpage

* chore: ✨ add doc for function

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* fix: fixed the theme of the df iframe to light mode (#12400)

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [TRAH] Hamza/TRAH-2315/added JurisdictionTncSection (#12433)

* chore: added tnc section

* chore: added Link component

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Aum/WALL-3001/unit tests for wallet withdrawal-fiat module (#12361)

* chore: added unit tests for WithdrawalFiat module

* chore: changed the format for the data-testid

* chore: added verification code in the tests

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [trah]thisyahlen/chore: add get a deriv account banner (#12430)

* chore: add get a deriv account banner

* fix: import

* fix: added tsdoc

* chore: komen

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [COJ]Amina/coj 407 success message after upgrade (#12338)

* feat: migration success modal

* chore: mobile view of success modal

* fix: mobile

* fix: testcases for migration success modal

* fix: testcases for migration success modal

* fix: testcases for migration success modal

* fix: remove hardcoded values

* fix: review comments

* fix: rename varible

* fix: review comments

* fix: review comments

* fix: loading

* fix:  merge master

---------

Co-authored-by: Taysuisin <suisin@regentmarkets.com>
Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [WALL] Farhan/WALL-2896/Unit test for WalletListCardBalance component (#12399)

* chore: ✨ unit tests for WalletListCardBalance component

* refactor: ⚙️ change description

Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>

---------

Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>

* [WALL] george / WALL-2826 / transfer messages from wallet to wallet for unverified users (#12378)

* feat: ✨ add wallet to wallet transfer messages for unverified users

* feat: ✨ add transfer messages between wallets

implement transfer messages between wallets for unverified users, setup localization

* chore: 🚑 fix messages content

* fix: 🚑 setup translations for transfer messages

* fix: 🚑 apply comments

* fix: 🚑 lifetime transfer messages content

* refactor: 🎨 refactor translations, remove config

* perf: 🎨 improve message structure

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [DTRA] Maryia/DTRA-674/fix: Vanilla profit & contract value in mobile (#12336)

* fix: vanilla profit in mobile

* test: the change

* fix: vanilla mobile contract card

* test: positions-modal-card.spec.tsx

* refactor: component and tests

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* [BOT]Maryia/BOT-958/feat: adding matches/differs and over/under contract types on quick strategies (#11462)

* feat: adding Matches/differs and over/under contract types on quick strategy

* feat: add prediction tool tip

* feat: validate last digit prediction from 0-9 as text to prevent the user from entering a dot

* feat: add last_digit_prediction to Martingale, D'Alembert, Oscar Grind, and other strategies

* feat: prediction field

* chore: remove minor things

* chore: nitpick change

* fix: cognitive complexity

* fix: value to check existence of a valid variable

* fix: bug when user switches to digits after multipliers trade type category

* refactor: take the function addDinamicallyBlockToDOM() to utils

* fix: change the order and grouping of fields PREDICTION

* fix: minimisation of code, purity

* refactor: add regex prop in the prediction field config

* fix: type script issues in some files

* fix: bug loading saved values into the quick strategies form

* fix: type script issues in some files

* fix: remove unnecessary hidden category

* fix: test case of contract_type component

* fix: sonarcloud code smells

* fix: remove unnecessary changes of bot skeleton

* chore: remove comment

* chore: temporary remove improvement

* refactor: improvement implementation

* fix: save values from the form the first time the browser is used

* test: update trade type test case

* fix: remove unnecessary code, add logic for the field text

* refactor: remove formik mock

* Revert "refactor: remove formik mock"

This reverts commit 00a25a1.

* refactor: validation of prediction block

* refactor: validation of prediction block(2)

* fix: validation of btn minus for prediction block

* fix: validation of btn minus for prediction block(2)

* fix: min/max values

* chore: rename function

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* refactor: ✨ change login id

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>

* fix: import

---------

Signed-off-by: Farhan Ahmad Nurzi <farhan.nurzi@regentmarkets.com>
Co-authored-by: Muhammad Hamza <120543468+hamza-deriv@users.noreply.github.com>
Co-authored-by: Aizad Ridzo <103104395+aizad-deriv@users.noreply.github.com>
Co-authored-by: Maryia <103177211+maryia-deriv@users.noreply.github.com>
Co-authored-by: ameerul-deriv <103412909+ameerul-deriv@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: DerivFE <80095553+DerivFE@users.noreply.github.com>
Co-authored-by: lubega-deriv <142860499+lubega-deriv@users.noreply.github.com>
Co-authored-by: Rostik Kayko <119863957+rostislav-deriv@users.noreply.github.com>
Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
Co-authored-by: George Usynin <103181646+heorhi-deriv@users.noreply.github.com>
Co-authored-by: Aum Bhatt <125039206+aum-deriv@users.noreply.github.com>
Co-authored-by: thisyahlen <104053934+thisyahlen-deriv@users.noreply.github.com>
Co-authored-by: amina-deriv <84661147+amina-deriv@users.noreply.github.com>
Co-authored-by: Taysuisin <suisin@regentmarkets.com>
Co-authored-by: Nijil Nirmal <62882794+nijil-deriv@users.noreply.github.com>
Co-authored-by: maryia-matskevich-deriv <103181650+maryia-matskevich-deriv@users.noreply.github.com>
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.

8 participants