Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Adds captcha to UGP flow #14189

Merged
merged 1 commit into from
May 25, 2018
Merged

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented May 21, 2018

Resolves #14188

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

  • clean profile
  • start browser with staging flag
  • enable payments
  • claim promotion
  • verify that you can see captcha overlay
  • solve (and try to miss) the captcha
  • make sure that success overlay is displayed
  • close overlay and make sure that you received 10BAT

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@NejcZdovc NejcZdovc self-assigned this May 21, 2018
@NejcZdovc NejcZdovc added this to the 0.22.x Release 4 (Beta channel) milestone May 21, 2018
@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch from d0139c3 to 88f286b Compare May 21, 2018 08:30
@bsclifton bsclifton modified the milestones: 0.22.x Release 4 (Beta channel), 0.22.x Release 5 May 22, 2018
@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch 4 times, most recently from 13e5cee to 0cc88ed Compare May 23, 2018 16:37
@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch 3 times, most recently from d4428e0 to da64db6 Compare May 25, 2018 05:07
@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch from 320d02e to 4e8d576 Compare May 25, 2018 09:58

describe('APP_ON_CAPTCHA_RESPONSE', function () {

})
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need tests on these two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol I added them but then forgot to actually add them 😄 thx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tests added

@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch from 4e8d576 to 1041f91 Compare May 25, 2018 12:01
@NejcZdovc NejcZdovc requested a review from jasonrsadler May 25, 2018 12:01
const promotionStatuses = require('../../../../common/constants/promotionStatuses')

// Styles
const cx = require('../../../../../js/lib/classSet')
Copy link
Contributor

Choose a reason for hiding this comment

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

Were we deprecating the use of className cx()? It's implied from the styling guidelines but I don't know for sure.

Copy link
Contributor Author

@NejcZdovc NejcZdovc May 25, 2018

Choose a reason for hiding this comment

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

not sure, this is what it was used so far

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

[css(styles.enabledContent__overlay)]: true,
[css(styles.enabledContent__captcha)]: true,
'enabledContent__overlay': true
})}
Copy link
Contributor

Choose a reason for hiding this comment

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

can we just use [css(styles.enabledContent__overlay, styles.enabledContent__captcha)]?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -632,6 +644,23 @@ const styles = StyleSheet.create({
}
},

enabledContent__captcha: {
// TODO we need to make sure that text is not in DND zone
Copy link
Contributor

Choose a reason for hiding this comment

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

These don't look like they're used here. They're defined in the captcha component as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@NejcZdovc NejcZdovc requested a review from jasonrsadler May 25, 2018 13:46
@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch from 1041f91 to 1d5794e Compare May 25, 2018 13:46
padding: '20px'
},

enabledContent__captcha__drop: {
Copy link
Contributor

Choose a reason for hiding this comment

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

....this ^

return <div
className={cx({
[css(styles.enabledContent__overlay, styles.enabledContent__captcha)]: true,
'enabledContent__overlay': true
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant:
is styles.enabledContent__overlay and the enabledContent__overlay below it reference the same styling? If so, then just:
className={css(styles.enabledContent__overlay, styles.enabledContent__captcha)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Resolves brave#14188

Auditors:

Test Plan:
@NejcZdovc NejcZdovc requested a review from jasonrsadler May 25, 2018 16:18
@jasonrsadler
Copy link
Contributor

Really awesome.

There were a couple times where I had dragged over the outline but was still told to 'try again'. Should we implement an onhover over the outline coordinates [and maybe bolden the outline on hover] to let the user know when they are dropping on the right answer? (I'm assuming the coordinate answer is sent to the client)

@NejcZdovc NejcZdovc force-pushed the feature/#14188-captcha branch from 1d5794e to fa6124b Compare May 25, 2018 16:18
@NejcZdovc
Copy link
Contributor Author

@jasonrsadler we don't know the coordinates, we just send dropped coordinates to the server and server then decides if it's ok or not

@jasonrsadler
Copy link
Contributor

Had a feeling that's how it was working. Just checking.

Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

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

++ 🥇

@NejcZdovc NejcZdovc merged commit 8e9be72 into brave:master May 25, 2018
NejcZdovc added a commit that referenced this pull request May 25, 2018
NejcZdovc added a commit that referenced this pull request May 25, 2018
@NejcZdovc
Copy link
Contributor Author

master 8e9be72
0.23 97c2bb9
0.22 d99e390

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UGP captcha
4 participants