woocommerce-android icon indicating copy to clipboard operation
woocommerce-android copied to clipboard

Display manuals per country

Open rossanafmenezes opened this issue 2 years ago • 2 comments

Closes: #7194

Description

This PR:

  • removes the Card Reader Manuals row from the IPP Hub when the store is not in the US or Canada, and of course, shows the row only if it's US and Canada.
  • Adds the logic so, when on a Canadian store, only the wisepad3 Manual is displayed and when on a US store only the M2 and BBPOS chipper are displayed

Testing instructions

Please test using a store in the US, a store in Canada and a store o an unsupported country:

US Store:

  • Go to Menu - Payments -> Make sure the row Card Reader Manuals is displayed
  • Click on Card Reader Manuals -> Make sure both the BBPOS Chipper and the M2 reader are displayed (and only those)

Canadian Store:

  • Go to Menu - Payments -> Make sure the row Card Reader Manuals is displayed
  • Click on Card Reader Manuals -> Make sure the Wisepad3 is displayed (and only this one)

Unsupported Store:

  • Go to Menu - Payments -> Make sure the row Card Reader Manuals is NOT displayed

Images/gif

manualsScreen

  • [ ] I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

rossanafmenezes avatar Sep 02 '22 00:09 rossanafmenezes

You can test the changes on this Pull Request by downloading an installable build, or scanning this QR code:

wpmobilebot avatar Sep 02 '22 00:09 wpmobilebot

Fails
:no_entry_sign:

Danger failed to run /app/danger-0.eys3kfmtupn.ts.

Error TypeError

Cannot read property 'diffForFile' of undefined
TypeError: Cannot read property 'diffForFile' of undefined
    at Object.exports.default (/app/danger-0.eys3kfmtupn.ts:27:46)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Dangerfile

22|     // Calculate the changes to Test files because we don't want to limit those
23|     // Note that linesOfCode() function in the latest GitDSL can solve this problem in a more elegant way,
24|     // but the version of Danger currently used by Peril doesn't have it yet.
25|     const testFiles = [...modifiedFiles, ...createdFiles, ...deletedFiles].filter((path: string) => path.includes("/src/test"));
26|     let changesToTests = 0;
------------------------------------------------^
27|     for (let file of testFiles) {        
28|         const stringDiffs = await danger.git.diffForFile(file)
29|         const addedLines = stringDiffs.added.split("\n").filter(x => x.startsWith("+")).length;
30|         const removedLines = stringDiffs.removed.split("\n").filter(x => x.startsWith("-")).length;

Generated by :no_entry_sign: dangerJS

peril-woocommerce[bot] avatar Oct 04 '22 11:10 peril-woocommerce[bot]

Found 1 violations:

The PR caused the following dependency changes:

expand

+\--- project :libs:cardreader
+     \--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.6.10 (*)

Please review and act accordingly

<this is a auto generated comment from violation-comments-lib F7F8ASD8123FSDF>

<ACCUMULATED-VIOLATIONS>

wpmobilebot avatar Oct 04 '22 11:10 wpmobilebot

Codecov Report

Base: 44.22% // Head: 44.25% // Increases project coverage by +0.03% :tada:

Coverage data is based on head (61c2493) compared to base (437d41b). Patch coverage: 96.96% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff              @@
##              trunk    #7333      +/-   ##
============================================
+ Coverage     44.22%   44.25%   +0.03%     
- Complexity     3289     3295       +6     
============================================
  Files           584      585       +1     
  Lines         33020    33042      +22     
  Branches       4276     4280       +4     
============================================
+ Hits          14603    14623      +20     
- Misses        17091    17092       +1     
- Partials       1326     1327       +1     
Impacted Files Coverage Δ
...manuals/CardReaderManualsSupportedReadersMapper.kt 88.88% <88.88%> (ø)
.../payments/cardreader/hub/CardReaderHubViewModel.kt 96.99% <100.00%> (+0.07%) :arrow_up:
...s/cardreader/manuals/CardReaderManualsViewModel.kt 100.00% <100.00%> (ø)
...oid/cardreader/internal/config/CardReaderConfig.kt 100.00% <100.00%> (ø)
...eader/internal/config/CardReaderConfigForCanada.kt 100.00% <100.00%> (ø)
...rdreader/internal/config/CardReaderConfigForUSA.kt 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov-commenter avatar Oct 04 '22 13:10 codecov-commenter