Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f07a43a
remove in_person_variant_c
svalexander Jun 7, 2023
9d72f17
remove variant b and make variant a default view
svalexander Jun 7, 2023
cfde66b
make variant a the default bucket
svalexander Jun 7, 2023
22f51bd
remove unused inPersonSelected
svalexander Jun 8, 2023
a866520
update link in review step spec
svalexander Jun 8, 2023
8043cbc
remove unused prompt_detail_b text used by variant b
svalexander Jun 8, 2023
9407ba8
update strings
svalexander Jun 9, 2023
edb5e4e
Merge branch 'main' into shannon/lg-8332-stop-ipp_cta_ab_test
svalexander Jun 9, 2023
681afcb
Merge branch 'main' into shannon/lg-8332-stop-ipp_cta_ab_test
svalexander Jun 9, 2023
8245289
Merge branch 'main' into shannon/lg-8332-stop-ipp_cta_ab_test
svalexander Jun 12, 2023
d8fbed6
update attempts string
svalexander Jun 12, 2023
d8e5160
normalize yaml
svalexander Jun 12, 2023
9567c07
Merge branch 'main' into shannon/lg-8332-stop-ipp_cta_ab_test
svalexander Jun 13, 2023
db3ca56
remove ab testing variants
svalexander Jun 14, 2023
8e05394
remove in_person_cta_variant
svalexander Jun 14, 2023
4147d75
fix ready to verify controller spec
svalexander Jun 14, 2023
b16460c
fix lint issues and analytics spec
svalexander Jun 14, 2023
67db8ac
remove configs for cta variant
svalexander Jun 14, 2023
be631de
changelog: User-Facing Improvements, In person cta, make variant a th…
svalexander Jun 14, 2023
878caae
fix merge conflict
svalexander Jun 14, 2023
d7de89c
update ab_tests file to match current main
svalexander Jun 14, 2023
66f1e90
remove alt text for in person CTA component
Jun 14, 2023
c4abf16
update analytics event
svalexander Jun 15, 2023
4c7da81
update try online string name
svalexander Jun 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions app/controllers/concerns/idv/document_capture_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,6 @@ def extract_pii_from_doc(user, response, store_in_session: false)
track_document_issuing_state(user, pii_from_doc[:state])
end

def in_person_cta_variant_testing_variables
bucket = AbTests::IN_PERSON_CTA.bucket(document_capture_session_uuid)
session[:in_person_cta_variant] = bucket
{
in_person_cta_variant_testing_enabled:
IdentityConfig.store.in_person_cta_variant_testing_enabled,
in_person_cta_variant_active: bucket,
}
end

def stored_result
return @stored_result if defined?(@stored_result)
@stored_result = document_capture_session&.load_result
Expand Down
1 change: 0 additions & 1 deletion app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def extra_view_variables
failure_to_proof_url: return_to_sp_failure_to_proof_url(step: 'document_capture'),
}.merge(
acuant_sdk_upgrade_a_b_testing_variables,
in_person_cta_variant_testing_variables,
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def extra_view_variables
}.merge(
native_camera_ab_testing_variables,
acuant_sdk_upgrade_a_b_testing_variables,
in_person_cta_variant_testing_variables,
)
end

Expand Down
9 changes: 1 addition & 8 deletions app/controllers/idv/in_person/ready_to_verify_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ReadyToVerifyController < ApplicationController
before_action :confirm_in_person_session

def show
analytics.idv_in_person_ready_to_verify_visit(**extra_analytics_attributes)
analytics.idv_in_person_ready_to_verify_visit
@presenter = ReadyToVerifyPresenter.new(enrollment: enrollment)
end

Expand All @@ -24,13 +24,6 @@ def confirm_in_person_session
def enrollment
current_user.pending_in_person_enrollment
end

def extra_analytics_attributes
extra = {}
bucket = session[:in_person_cta_variant]
extra[:in_person_cta_variant] = bucket if bucket
extra
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ interface DocumentCaptureTroubleshootingOptionsProps {
* help at SP
*/
showSPOption?: boolean;

altInPersonCta?: string;
altInPersonPrompt?: string;
altInPersonCtaButtonText?: string;
}

function DocumentCaptureTroubleshootingOptions({
Expand All @@ -45,9 +41,6 @@ function DocumentCaptureTroubleshootingOptions({
showDocumentTips = true,
showAlternativeProofingOptions,
showSPOption = true,
altInPersonCta,
altInPersonPrompt,
altInPersonCtaButtonText,
}: DocumentCaptureTroubleshootingOptionsProps) {
const { t } = useI18n();
const { inPersonURL } = useContext(InPersonContext);
Expand All @@ -56,13 +49,7 @@ function DocumentCaptureTroubleshootingOptions({

return (
<>
{showAlternativeProofingOptions && inPersonURL && (
<InPersonCallToAction
altHeading={altInPersonCta}
altPrompt={altInPersonPrompt}
altButtonText={altInPersonCtaButtonText}
/>
)}
{showAlternativeProofingOptions && inPersonURL && <InPersonCallToAction />}
<TroubleshootingOptions
heading={heading}
options={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ import { Button } from '@18f/identity-components';
import { useInstanceId } from '@18f/identity-react-hooks';
import { t } from '@18f/identity-i18n';
import AnalyticsContext from '../context/analytics';
import { InPersonContext } from '../context';

interface InPersonCallToActionProps {
altHeading?: string;
altPrompt?: string;
altButtonText?: string;
}

function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPersonCallToActionProps) {
function InPersonCallToAction() {
const instanceId = useInstanceId();
const { trackEvent } = useContext(AnalyticsContext);
const { inPersonCtaVariantActive } = useContext(InPersonContext);

return (
<section
Expand All @@ -23,22 +15,20 @@ function InPersonCallToAction({ altHeading, altPrompt, altButtonText }: InPerson
>
<hr className="margin-y-5" />
<h2 id={`in-person-cta-heading-${instanceId}`} className="margin-y-2">
{altHeading || t('in_person_proofing.headings.cta')}
{t('in_person_proofing.headings.cta')}
</h2>
<p>{altPrompt || t('in_person_proofing.body.cta.prompt_detail')}</p>
<p>{t('in_person_proofing.body.cta.prompt_detail')}</p>
<Button
type="submit"
isBig
isOutline
isWide
className="margin-top-3 margin-bottom-1"
onClick={() => {
trackEvent('IdV: verify in person troubleshooting option clicked', {
in_person_cta_variant: inPersonCtaVariantActive,
});
trackEvent('IdV: verify in person troubleshooting option clicked');
}}
>
{altButtonText || t('in_person_proofing.body.cta.button')}
{t('in_person_proofing.body.cta.button')}
</Button>
</section>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { InPersonContext } from '../context';
import UploadContext from '../context/upload';

function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, registerField }) {
const { inPersonCtaVariantActive, inPersonURL } = useContext(InPersonContext);
const { inPersonURL } = useContext(InPersonContext);
const { t } = useI18n();
const [inProgress, setInProgress] = useState<boolean>(false);
const [isLoadingLocations, setLoadingLocations] = useState<boolean>(false);
Expand Down Expand Up @@ -77,7 +77,6 @@ function InPersonLocationPostOfficeSearchStep({ onChange, toPreviousStep, regist
if (flowPath !== 'hybrid') {
trackEvent('IdV: location submitted', {
selected_location: selectedLocationAddress,
in_person_cta_variant: inPersonCtaVariantActive,
});
forceRedirect(inPersonURL!);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useContext, useEffect } from 'react';
import { useContext } from 'react';
import { Link, PageHeading, ProcessList, ProcessListItem } from '@18f/identity-components';
import { getConfigValue } from '@18f/identity-config';
import { useI18n } from '@18f/identity-react-i18n';
import { FormStepsButton } from '@18f/identity-form-steps';
import UploadContext from '../context/upload';
import MarketingSiteContext from '../context/marketing-site';
import AnalyticsContext from '../context/analytics';
import BackButton from './back-button';
import InPersonTroubleshootingOptions from './in-person-troubleshooting-options';
import { InPersonContext } from '../context';
Expand All @@ -14,14 +13,8 @@ import InPersonUspsOutageAlert from './in-person-usps-outage-alert';
function InPersonPrepareStep({ toPreviousStep }) {
const { t } = useI18n();
const { flowPath } = useContext(UploadContext);
const { setSubmitEventMetadata } = useContext(AnalyticsContext);
const { securityAndPrivacyHowItWorksURL } = useContext(MarketingSiteContext);
const { inPersonURL, inPersonCtaVariantActive, inPersonUspsOutageMessageEnabled } =
useContext(InPersonContext);

useEffect(() => {
setSubmitEventMetadata({ in_person_cta_variant: inPersonCtaVariantActive });
}, []);
const { inPersonURL, inPersonUspsOutageMessageEnabled } = useContext(InPersonContext);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,34 +80,20 @@ function ReviewIssuesStep({
useDidUpdateEffect(onPageTransition, [hasDismissed]);

const { onFailedSubmissionAttempt } = useContext(FailedCaptureAttemptsContext);
const { inPersonURL, inPersonCtaVariantActive } = useContext(InPersonContext);
const { inPersonURL } = useContext(InPersonContext);
useEffect(() => onFailedSubmissionAttempt(), []);
function onWarningPageDismissed() {
trackEvent('IdV: Capture troubleshooting dismissed');

setHasDismissed(true);
}
function onInPersonSelected() {
trackEvent('IdV: verify in person troubleshooting option clicked', {
in_person_cta_variant: inPersonCtaVariantActive,
});
}

// let FormSteps know, via FormStepsContext, whether this page
// is ready to submit form values
useEffect(() => {
changeStepCanComplete(!!hasDismissed);
}, [hasDismissed]);

useEffect(() => {
if (!inPersonURL || isFailedResult) {
return;
}
trackEvent('IdV: IPP CTA Variant Displayed', {
in_person_cta_variant: inPersonCtaVariantActive,
});
}, []);

if (!hasDismissed) {
if (pii) {
return <BarcodeAttentionWarning onDismiss={onWarningPageDismissed} pii={pii} />;
Expand Down Expand Up @@ -138,120 +124,43 @@ function ReviewIssuesStep({

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
<strong>{t('idv.failure.attempts', { count: remainingAttempts })}</strong>
<strong>{t('idv.failure.attempts_html', { count: remainingAttempts })}</strong>
</p>
)}
</Warning>
<Cancel />
</>
);
}
if (inPersonCtaVariantActive === 'in_person_variant_a') {
return (
<Warning
heading={t('errors.doc_auth.throttled_heading')}
actionText={t('idv.failure.button.warning_variant')}
actionOnClick={onWarningPageDismissed}
location="doc_auth_review_issues"
remainingAttempts={remainingAttempts}
troubleshootingOptions={
<DocumentCaptureTroubleshootingOptions
location="post_submission_warning"
showAlternativeProofingOptions={!isFailedResult}
heading={t('components.troubleshooting_options.ipp_heading')}
altInPersonCta={t('in_person_proofing.headings.cta_variant')}
altInPersonCtaButtonText={t('in_person_proofing.body.cta.button_variant')}
Comment thread
tomas-nava marked this conversation as resolved.
/>
}
>
<h2>{t('errors.doc_auth.throttled_subheading')}</h2>
{!!unknownFieldErrors &&
unknownFieldErrors
.filter((error) => !['front', 'back'].includes(error.field!))
.map(({ error }) => <p key={error.message}>{error.message}</p>)}

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
{remainingAttempts === 1
? formatWithStrongNoWrap(t('idv.failure.attempts.one_variant_a_html'))
: formatWithStrongNoWrap(
t('idv.failure.attempts.other_variant_a_html', { count: remainingAttempts }),
)}
</p>
)}
</Warning>
);
}
if (inPersonCtaVariantActive === 'in_person_variant_b') {
return (
<Warning
heading={t('errors.doc_auth.throttled_heading')}
actionText={t('idv.failure.button.warning_variant')}
actionOnClick={onWarningPageDismissed}
altActionText={t('in_person_proofing.body.cta.button_variant')}
altActionOnClick={onInPersonSelected}
altHref="#prepare"
location="doc_auth_review_issues"
remainingAttempts={remainingAttempts}
troubleshootingOptions={
<DocumentCaptureTroubleshootingOptions
location="post_submission_warning"
showAlternativeProofingOptions={false}
heading={t('components.troubleshooting_options.ipp_heading')}
/>
}
>
{!!unknownFieldErrors &&
unknownFieldErrors
.filter((error) => !['front', 'back'].includes(error.field!))
.map(({ error }) => <p key={error.message}>{error.message}</p>)}

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
{remainingAttempts === 1
? formatWithStrongNoWrap(t('idv.failure.attempts.one_variant_b_html'))
: formatWithStrongNoWrap(
t('idv.failure.attempts.other_variant_b_html', { count: remainingAttempts }),
)}
</p>
)}
<p>{t('in_person_proofing.body.cta.prompt_detail_b')}</p>
</Warning>
);
}
if (inPersonCtaVariantActive === 'in_person_variant_c') {
return (
<Warning
heading={t('errors.doc_auth.throttled_heading')}
actionText={t('idv.failure.button.warning')}
actionOnClick={onWarningPageDismissed}
location="doc_auth_review_issues"
remainingAttempts={remainingAttempts}
troubleshootingOptions={
<DocumentCaptureTroubleshootingOptions
location="post_submission_warning"
showAlternativeProofingOptions={false}
heading={t('components.troubleshooting_options.ipp_heading')}
/>
}
>
{!!unknownFieldErrors &&
unknownFieldErrors
.filter((error) => !['front', 'back'].includes(error.field!))
.map(({ error }) => <p key={error.message}>{error.message}</p>)}

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
<strong>
{remainingAttempts === 1
? t('idv.failure.attempts.one')
: t('idv.failure.attempts.other', { count: remainingAttempts })}
</strong>
</p>
)}
</Warning>
);
}
return (
<Warning
heading={t('errors.doc_auth.throttled_heading')}
actionText={t('idv.failure.button.try_online')}
actionOnClick={onWarningPageDismissed}
location="doc_auth_review_issues"
remainingAttempts={remainingAttempts}
troubleshootingOptions={
<DocumentCaptureTroubleshootingOptions
location="post_submission_warning"
showAlternativeProofingOptions={!isFailedResult}
heading={t('components.troubleshooting_options.ipp_heading')}
/>
}
>
<h2>{t('errors.doc_auth.throttled_subheading')}</h2>
{!!unknownFieldErrors &&
unknownFieldErrors
.filter((error) => !['front', 'back'].includes(error.field!))
.map(({ error }) => <p key={error.message}>{error.message}</p>)}

{remainingAttempts <= DISPLAY_ATTEMPTS && (
<p>
{formatWithStrongNoWrap(t('idv.failure.attempts_html', { count: remainingAttempts }))}
</p>
)}
</Warning>
);
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ describe('AnalyticsContextProvider', () => {

result.current.trackVisitEvent(stepName);

expect(trackEvent).to.have.been.calledWith(`IdV: ${stepName} visited`, {
in_person_cta_variant: '',
});
expect(trackEvent).to.have.been.calledWith(`IdV: ${stepName} visited`);
});

it('calls trackEvent with submit event', () => {
Expand Down
Loading