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

Feature/privacy statement cx 1711 #316

Merged
merged 20 commits into from Mar 21, 2018

Conversation

stefaniacardenas
Copy link
Contributor

Problem

Users should be aware of the Privacy Policy and Onfido Terms of Use before submitting their documents.

Solution

Added legal documentation view before first document capture to assist client with user privacy notifications and compliance.

  • The screen will be displayed on both desktop and mobile on the document step
  • Clicking on Decline will take user back to the previous screen
  • Once the terms have been accepted the users won't see the screen again
  • Added tracking

Checklist

put n/a if item is not relevant to PR changes

  • Have the CHANGELOG, README, MIGRATION, RELEASE_GUIDELINES docs been updated?
  • Have new automated tests been implemented?
  • [n/a] Have new manual tests been written down?
  • Have tests passed locally?
  • Have any new strings been translated?

@rfreitas
Copy link
Contributor

rfreitas commented Mar 5, 2018

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 5, 2018

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 6, 2018

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 7, 2018

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 7, 2018

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 7, 2018

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

rfreitas commented Mar 7, 2018

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

onWebcamError: this.onWebcamError,
error: this.state.error,
...other}}/>
<div>
Copy link
Contributor

Choose a reason for hiding this comment

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

This wrapping div looks unnecessary, no?

@import (less) "../Theme/constants.css";

.privacy {
height: calc(~"100% - 112px");
Copy link
Contributor

Choose a reason for hiding this comment

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

calc isn't a less mixin, or anything - it's a native CSS function

You should just be able to do calc(100% - 112px), right?

Copy link
Contributor

Choose a reason for hiding this comment

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

what do we need calc for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need it because the privacy component has an absolute positioning and we want to make sure that its height never covers the footer so it has a 100% height minus the height (including paddings/margins) of the footer.
@stephencookdev If I use calc(100% - 112px) it gets computed as height: calc(-12%);

Copy link
Contributor

Choose a reason for hiding this comment

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

so we can't use padding instead? Also, the computation is a bit weird, does padding have a height os 12%?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, calc does not work as expected with LESS that's why I'm using the following syntax calc(~"100% - 112px"); see this issue.
I cannot use a padding but I could get rid of absolute positioning and give it a fixed height

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment for now as this behaviour is also used in the confirm screen where there is already a comment explaining why we are using calc. This will have to be refactored as part of the header/footer positioning ticket

{i18n.t('privacy.small_print_p1')}
<a href='https://onfido.com/termofuse' target='_blank'>{i18n.t('privacy.terms_link')}</a>
{i18n.t('privacy.small_print_p2')}
<a href='https://onfido.com/privacy' target='_blank'>{i18n.t('privacy.privacy_link')}</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a really brittle way of doing i18n

You're assuming that any language you want to translate to will fit into the structure you've written here. But you might get a language where it sounds way more natural to order this as "Onfido Terms of Use you are agreeing to" (Japanese is like that, I think)

We're handling this elsewhere by explicitly storing i18n as markdown, and parsing that. But it's fairly heavyweight, we can just get away with it for now. You might want to either make an explicit fragment class, or trust your translations and use dangerouslySetInnerHtml through a translation wrapper (as sort of discussed here)

But also feel free to just kick the bucket down with this one. It'll definitely bite you at some point though, so bear it in mind

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a very good point. I will have look at fixing this tomorrow.

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@@ -43,6 +45,11 @@ class Capture extends Component {
if (allInvalid) this.onFileGeneralError()
}

acceptTerms = () => {
this.props.actions.acceptTerms()
this.setState({privacyTermsAccepted: true})
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this a prop already?


class PrivacyStatement extends Component {
componentDidMount() {
sendScreen(['privacy'])
Copy link
Contributor

Choose a reason for hiding this comment

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

can't just use the tracking component wrapper for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can but the screen name on woopra will be appended to the capture component one, resulting in something like screen_document_front_capture_privacy and we just want screen_privacy

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should have as an option to get rid of the prefixes

@import (less) "../Theme/constants.css";

.privacy {
height: calc(~"100% - 112px");
Copy link
Contributor

Choose a reason for hiding this comment

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

what do we need calc for?

actions.setDocumentType(documentType)
actions.acceptTerms()
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 have a comment on why we are accepting this. also, if the UI order changes and privacy shows after the cross device can be started, this will introduce a bug, which is something to bear in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

At the moment, you will never be able to reach cross device if you don't accept the privacy terms, even if you change the steps order. The acceptance criteria didn't say that the privacy screen should not be showed for face capture so I am double checking with @seewah what's the expected behaviour

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After our conversation this morning, we agreed on showing the privacy screen also for the face step. Given the current implementation, the terms will always be accepted when the user reaches the cross device client. I could send the termsAccepted prop to the cross device client and trigger this action once we have received it but it seems redundant to me because a user cannot reach the cross device flow without accepting terms first.

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@@ -90,6 +90,8 @@ const baseStyleRules = (disableExtractToFile = false) =>
const PROD_CONFIG = {
'ONFIDO_API_URL': 'https://api.onfido.com',
'ONFIDO_SDK_URL': 'https://sdk.onfido.com',
'ONFIDO_TERMS_URL': 'https://onfido.com/termofuse',
Copy link
Contributor

Choose a reason for hiding this comment

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

oops sorry my bad it should be /termsofuse (I realise I mistyped termofuse in the ticket!)

@@ -102,6 +104,8 @@ const TEST_CONFIG = { ...PROD_CONFIG, PUBLIC_PATH: '/', 'MOBILE_URL' : '/' }
const STAGING_CONFIG = {
'ONFIDO_API_URL': 'https://apidev.onfido.com',
'ONFIDO_SDK_URL': 'https://sdk-staging.onfido.com',
'ONFIDO_TERMS_URL': 'https://dev.onfido.com/termofuse',
Copy link
Contributor

Choose a reason for hiding this comment

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

oops sorry my bad it should be /termsofuse (I realise I mistyped termofuse in the ticket!)

@seewah
Copy link
Contributor

seewah commented Mar 15, 2018

Apart from my comment re: termsofuse (as opposed to termofuse) I am happy with the ticket. @rfreitas you suggested you would make the change. Do you mind doing that, and I can accept and merge thanks!

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@seewah
Copy link
Contributor

seewah commented Mar 16, 2018

OK one more issue, on Safari, the onfido logo is obscured on the privacy screen. @stefaniacardenas please work with @danielspagnolo to see what options we have. I see this as a blocker for now.

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://staging-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://release-316-pr-onfido-sdk-ui-onfido.surge.sh

@rfreitas
Copy link
Contributor

Travis automatic deployment: https://316-pr-onfido-sdk-ui-onfido.surge.sh

@seewah seewah merged commit 4479088 into development Mar 21, 2018
@rfreitas rfreitas deleted the feature/privacy-statement-cx-1711 branch July 23, 2018 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants