activeprospect / leadconduit-types

This Node.JS module parses lead data and provides specialized functionality by lead data category.
1 stars 0 forks source link

Sc 50139/super admin can export leads with full dob #157

Closed johnrb2 closed 1 year ago

johnrb2 commented 1 year ago

Description of the change

remove dob masking (index.js)
set dob.maskable to false (which triggers data-masking in lib/handler/middleware/source.js)
remove dob.parsed.masked (which triggers masking in requests via leadconduit-mask)
add function getHideableType(field)
   needed because event data from db doesn't have explicit type info
   returns "dob" if field has age & year attributes
   return null otherwise
add function shouldHide(field)
   returns boolean based on call to getHideableType() being null or not
add function hide(field)
  calls getHideableType(field)
  if result is not null, mask raw & normal based on type (e.g., "dob")

Type of change

Related tickets

https://app.shortcut.com/active-prospect/story/50139/super-admin-can-export-leads-with-full-dob

Checklists

Development and Testing

Code Review

Tracking

QA

shortcut-integration[bot] commented 1 year ago

This pull request has been linked to Shortcut Story #50139: Super Admin Can Export Leads with Full DoB.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 :tada:

Comparison is base (c9f5e29) 97.43% compared to head (739c546) 97.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #157 +/- ## ========================================== + Coverage 97.43% 97.46% +0.03% ========================================== Files 37 37 Lines 701 710 +9 ========================================== + Hits 683 692 +9 Misses 18 18 ``` | [Impacted Files](https://app.codecov.io/gh/activeprospect/leadconduit-types/pull/157?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=activeprospect) | Coverage Δ | | |---|---|---| | [lib/types/dob.js](https://app.codecov.io/gh/activeprospect/leadconduit-types/pull/157?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=activeprospect#diff-bGliL3R5cGVzL2RvYi5qcw==) | `100.00% <ø> (ø)` | | | [lib/index.js](https://app.codecov.io/gh/activeprospect/leadconduit-types/pull/157?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=activeprospect#diff-bGliL2luZGV4Lmpz) | `88.46% <100.00%> (+1.22%)` | :arrow_up: |

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

johnrb2 commented 1 year ago

I have decided to bump questions and optimizations about the mask function to another story so that we can get this functionality out

johnrb2 commented 1 year ago

Reductions in coverage have to do with Date object not being tested in the mask function due to removing the dob checks