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

[Due for payment 2025-02-25] [$250] Add Expensify Promoting banner to the Company cards page #56485

Open
mountiny opened this issue Feb 6, 2025 · 18 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@mountiny
Copy link
Contributor

mountiny commented Feb 6, 2025

Problem

Coming from this internal issue.

We want to make sure we promote the Expensify card to customers who have the company cards or seeking this setup.

Solution

Lets add a promotional banner to the Company cards page:

Image

The copy has already been approved.

When the admin clicks on the Learn more button we should take them to Expensify card page

If the feature is not enabled, also optimistically enable it and call the api to enable the feature. Then navigate to the page

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021887624605895025012
  • Upwork Job ID: 1887624605895025012
  • Last Price Increase: 2025-02-06
  • Automatic offers:
    • ikevin127 | Contributor | 106039306
Issue OwnerCurrent Issue Owner: @sakluger
@mountiny mountiny added Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 labels Feb 6, 2025
@mountiny mountiny self-assigned this Feb 6, 2025
Copy link

melvin-bot bot commented Feb 6, 2025

Triggered auto assignment to @sakluger (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@mountiny mountiny added the External Added to denote the issue can be worked on by a contributor label Feb 6, 2025
Copy link

melvin-bot bot commented Feb 6, 2025

Job added to Upwork: https://www.upwork.com/jobs/~021887624605895025012

@melvin-bot melvin-bot bot changed the title Add Expensify Promoting banner to the Company cards page [$250] Add Expensify Promoting banner to the Company cards page Feb 6, 2025
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 6, 2025
Copy link

melvin-bot bot commented Feb 6, 2025

Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 (External)

@FitseTLT
Copy link
Contributor

FitseTLT commented Feb 6, 2025

🚨 Edited by proposal-police: This proposal was edited at 2025-02-06 22:26:10 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Add Expensify Promoting banner to the Company cards page

What is the root cause of that problem?

New Feature

What changes do you think we should make in order to solve the problem?

Create the banner and display in CompanyCardPage

>
{(isFeedAdded || isPending) && !!selectedFeed && (
<WorkspaceCompanyCardsListHeaderButtons
policyID={policyID}

with the appropriate design, icon and copy. We can either display this banner always or if user has no card yet or use onyx state to remove the banner once a user clicked learn more or according to any other expectation needed.
And on click of learn more button we will check policy?.areExpensifyCardsEnabled and if it is false we will enable expensify card via enableExpensifyCard and (we can use some delay/may beWORKSPACE_ENABLE_FEATURE_REDIRECT_DELAY before navigating) navigate to ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID) if the feature is enabled we will only navigate
We will need to update enableExpensifyCard adding a param to disable goBackWhenEnableFeature which we don't need in this case
if (enabled && getIsNarrowLayout()) {
goBackWhenEnableFeature(policyID);
}

optionally we can also simply avoid goBackWhenEnableFeature if the current route is not more features page but I think the param is simpler.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N / A

What alternative solutions did you explore? (Optional)

@nkdengineer
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Add Expensify Promoting banner to the Company cards page

What is the root cause of that problem?

This is a new feature

What changes do you think we should make in order to solve the problem?

We need to add the promoting banner here

  1. Create a translation key for the title and subtitle of the banner
  2. Create the banner UI based on the UI. Here is the example implementation, other styles can be done in the PR.
<View style={styles.expensifyPromotingBannerWrapper}>
    <Icon
        src={Illustrations.CreditCardsNew}
        width={40}
        height={40}
    />
    <View style={[styles.flexColumn, styles.gap1, styles.flex1]}>
        <Text style={[{fontSize: 16}, styles.textBold]}>Get the Expensify Card</Text>
        <Text style={[styles.preWrap, styles.breakWord, styles.textLabel]}>
            Enjoy cash back on every US purchase, up to 50% off your Expensify bill, unlimited virtual cards, and so much more.
        </Text>
    </View>
    <Button
        text={translate('workspace.upgrade.commonFeatures.benefits.learnMore')}
        success
        onPress={() => {
            if (!policy?.areExpensifyCardsEnabled) {
                enableExpensifyCard(policyID, true, false);
                InteractionManager.runAfterInteractions(() => {
                    Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID));
                });
                return;
            }
            Navigation.navigate(ROUTES.WORKSPACE_EXPENSIFY_CARD.getRoute(policyID));
        }}
    />
</View>

{(isFeedAdded || isPending) && !!selectedFeed && (

  1. When we click on the Learn more button if the Expensify card feature is not enabled we will enable it and then navigate to the Expensify card page (In this case we need to wrap the navigate logic into InteractionManager.runAfterInteractions to wait the enable API is complete before navigating to Expensify card page). Otherwise, navigate to the Expensify card page

  2. To avoid navigating back to the initial page on the small screen, we can define a new param in enableExpensifyCard function like shouldNavigate and add this here and we will pass this as false when we click on Learn more button in the banner.

function enableExpensifyCard(policyID: string, enabled: boolean, shouldNavigate = true) {
if (enabled && getIsNarrowLayout() && shouldNavigate) {

if (enabled && getIsNarrowLayout()) {
goBackWhenEnableFeature(policyID);
}

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

This is a new UI, no need the test

What alternative solutions did you explore? (Optional)

Result

Screen.Recording.2025-02-07.at.10.24.23.mov

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@ikevin127
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue

Add Expensify Promoting banner to the Company cards page.

What is the root cause of that problem?

This is a NewFeature request.

What changes do you think we should make in order to solve the problem?

  1. Create a new banner component named ExpensifyCardPromotionBanner using our already existing BillingBanner component like we've done for other banners (see EarlyDiscountBanner, SubscriptionBillingBanner or PreTrialBillingBanner).

    • the component will take policy as parameter in order to be able to access policy specific data (policyID, areExpensifyCardsEnabled)
    • the Learn more button action will be using already existing enableExpensifyCard function, slightly modified with the addition of shouldNavigateToExpensifyCardPage boolean parameter which will be used to return early after the enable call is mad,e then navigate to Expensify Card page and set NVP variable to remember the banner was seen after Learn more was pressed (see more details on the logic below in the test branch)
    • this will require translated strings for both 🇬‍🇧 / 🇪‍🇸
    • this required extracting and matching our current theme / colors to what the design looks like in OP (already done, check test branch below)

  2. Add the new banner component to WorkspaceCompanyCardPageEmptyState above the FeatureList component on this line (and other places in case it's needed not only on the WorkspaceCompanyCardPageEmptyState page as shown in OP)

    • ℹ in the test branch presented below, the banner does scroll with the Import company cards block, if we want the banner to stick at the top, that can be easily changed later depending on the decision (cc @Expensify/design see scrolling video below)
    • we render the banner component based on the NVP variable (NVP_SEEN_EXPENSIFY_CARD_PROMOTION) to ensure we only show it once (see more details on the logic below in the test branch)

  3. In PolicyUtils.ts under existing goBackWhenEnableFeature, duplicate and add new function named goToExpensifyCardPage which will be responsible for navigating to the workspace Expensify Card page and also set the NVP variable to true after the user will press Learn more once.

  4. Added new styles to the dark / light theme files and new NVP variable th the ONYXKEYXS file.

    • we might want to consider adding this to KEYS_TO_PRESERVE in order to remember that the banner was already seen once, in case the user will perform Clear cache and restart

Note

Test branch: ikevin127-expensifyCardPromotion

Find detailed code / logic implementation which covers everything, working exactly as requested in OP.

What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

N/A.

Results

MacOS: Chrome
Expensify Card: Disabled Expensify Card: Already Enabled
expensify-card-disabled.mov
expensify-card-enabled.mov
MacOS / mWeb (Scrolling behaviour)
Screen.Recording.2025-02-06.at.20.30.13.mov
mWeb / Native Layout Image

@shawnborton
Copy link
Contributor

if we want the banner to stick at the top, that can be easily changed later depending on the decision (cc @Expensify/design see scrolling video below)

I don't think we want the banner to be fixed IMO, it should scroll with the rest of the page

@dubielzyk-expensify
Copy link
Contributor

Yep. Agree that it should be part of the content and not sticky 👍

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 7, 2025
Copy link

melvin-bot bot commented Feb 7, 2025

📣 @ikevin127 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@mountiny
Copy link
Contributor Author

mountiny commented Feb 7, 2025

@ikevin127 proposal seems the best assigning

@ikevin127
Copy link
Contributor

♻ I started working on the PR, should be ready for review in a few hours.

@Expensify/design May I have the SVG asset for the green cards like shown in the design ? Or we're fine with using the already existing one which I used in the test branch ? (already existing on the Company Cards Import company cards empty page)

New asset Already existing
Image Image

@dannymcclain
Copy link
Contributor

I think we want the green ones since this banner is specifically about Expensify Cards. Here ya go!

simple-illustration__creditcards--green.svg.zip

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Feb 7, 2025
@ikevin127
Copy link
Contributor

@mountiny PR #56561 has been ready for your review / merge for the past 2 days 🚀

@ikevin127
Copy link
Contributor

🔄 PR was merged and awaiting deploy to staging then production.

@mountiny
Copy link
Contributor Author

PR being deployed 🎉

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Feb 18, 2025
@melvin-bot melvin-bot bot changed the title [$250] Add Expensify Promoting banner to the Company cards page [Due for payment 2025-02-25] [$250] Add Expensify Promoting banner to the Company cards page Feb 18, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 18, 2025
Copy link

melvin-bot bot commented Feb 18, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Feb 18, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.99-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-02-25. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Feb 18, 2025

@ikevin127 / @c3024 @sakluger @ikevin127 / @c3024 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
Status: No status
Development

No branches or pull requests

9 participants