Skip to content

Fix Submit/Collect upgrade RHP to reflect the selected plan#93464

Draft
MelvinBot wants to merge 1 commit into
mainfrom
claude-submitUpgradeShowsCollectPlan
Draft

Fix Submit/Collect upgrade RHP to reflect the selected plan#93464
MelvinBot wants to merge 1 commit into
mainfrom
claude-submitUpgradeShowsCollectPlan

Conversation

@MelvinBot

Copy link
Copy Markdown
Contributor

Explanation of Change

On a Submit workspace, choosing Collect in the Plan RHP and pressing Upgrade opened the Control upgrade RHP (wrong copy, wrong pricing, and the upgrade itself targeted Control). The same root cause produced the wrong RHP when a Collect workspace tried to upgrade. The upgrade screen never knew which plan the user actually picked — it always fell back to Control's intro view.

This change threads the plan the user selected in the Plan RHP through to the Upgrade RHP and the upgrade action:

  • ROUTES.WORKSPACE_UPGRADE now accepts an optional upgradePlanType query param, and the corresponding navigation param was added in Navigation/types.ts.
  • DynamicWorkspaceOverviewPlanTypePage passes the selected plan (currentPlan) when navigating to the upgrade screen for Submit→Team/Corporate and Team→Corporate.
  • WorkspaceUpgradePage reads upgradePlanType and uses it to drive the actual upgradeSubmit targetType, and forwards it to UpgradeIntro.
  • UpgradeIntro uses upgradePlanType to select Team (Collect) pricing, and GenericFeaturesView renders Collect-specific title, "starts at" copy, and benefit bullets when the selected plan is Collect.
  • Added the two new Collect upgrade strings (workspace.upgrade.commonFeatures.collect.title / .startsAtFull) to all 10 locale files; Collect benefit bullets reuse the existing subscription.yourPlan.collect.* strings.

Fixed Issues

$ #93326
PROPOSAL: #93326 (comment)

Tests

// TODO: The human co-author must fill out the tests you ran before marking this PR as "ready for review".
// Please describe what tests you performed that validate your changes worked.

  1. Open a Submit workspace (requires the submit2026 beta).
  2. Go to Workspace Overview → Plan type.
  3. Select Collect and press Save / Upgrade.
  4. Verify the Upgrade RHP shows the Collect title, Collect "starts at" pricing, and Collect benefit bullets (not Control), and that completing the upgrade moves the workspace to Collect.
  5. Repeat selecting Control and verify the Control upgrade RHP still shows correctly.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  1. On a Submit workspace, open Plan type, select Collect, press Upgrade.
  2. Verify the Collect upgrade RHP (title/pricing/benefits) is shown and the upgrade targets Collect.
  3. Verify selecting Control still shows the Control upgrade RHP.
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

Propagate the plan chosen in the Plan RHP to the Upgrade RHP and the
upgrade action so display copy, pricing, and the upgrade targetType
match the selected plan instead of always defaulting to Control.

Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index d66a67c9f37..99eca551acc 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6995,9 +6995,9 @@ Fordern Sie Spesendetails wie Belege und Beschreibungen an, legen Sie Limits und
             commonFeatures: {
                 title: 'Upgrade auf den Control-Tarif',
                 collect: {
-                    title: 'Upgrade auf den Collect-Tarif',
+                    title: 'Zum Collect-Tarif upgraden',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Der Collect-Tarif beginnt bei <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `pro Mitglied und Monat.` : `pro aktivem Mitglied und Monat.`}. <a href="${learnMoreMethodsRoute}">Erfahre mehr</a> über unsere Tarife und Preise.</muted-text>`,
+                        `<muted-text>Der Collect-Tarif beginnt bei <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `pro Mitglied pro Monat.` : `pro aktivem Mitglied und Monat.`} <a href="${learnMoreMethodsRoute}">Erfahren Sie mehr</a> über unsere Tarife und Preise.</muted-text>`,
                 },
                 note: 'Schalte unsere leistungsstärksten Funktionen frei, darunter:',
                 benefits: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 371d5350e93..993cdb4e550 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1753,7 +1753,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_MARK_AS_DONE]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> lo marques como listo.`;
@@ -6979,7 +6978,7 @@ ${amount} para ${merchant} - ${date}`,
                 title: 'Mejorar al plan Controlar',
                 collect: {
                     title: 'Mejorar al plan Recopilar',
-                    startsAtFull: (learnMoreMethodsRoute, formattedPrice, hasTeam2025Pricing) =>
+                    startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
                         `<muted-text>El plan Recopilar comienza desde <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `por miembro al mes.` : `por miembro activo al mes.`} <a href="${learnMoreMethodsRoute}">Más información</a> sobre nuestros planes y precios.</muted-text>`,
                 },
                 note: 'Desbloquea nuestras funciones más potentes, incluyendo:',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index d73c15d57e9..9c317ece844 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1,6 +1,7 @@
 /**
  *   _____                      __         __
  *  / ___/__ ___  ___ _______ _/ /____ ___/ /
+ * / (_ / -_) _ \/ -_) __/ _ \`/ __/ -_) _  /
  * \___/\__/_//_/\__/_/  \_,_/\__/\__/\_,_/
  *
  * This file was automatically generated. Please consider these alternatives before manually editing it:
@@ -862,7 +863,7 @@ const translations: TranslationDeepObject<typeof en> = {
         beginningOfChatHistory: (users: string) => `Cette discussion est avec ${users}.`,
         beginningOfChatHistoryPolicyExpenseChat: (workspaceName: string, submitterDisplayName: string) =>
             `C’est ici que <strong>${submitterDisplayName}</strong> soumettra des dépenses à <strong>${workspaceName}</strong>. Utilisez simplement le bouton +.`,
-        beginningOfChatHistoryPolicyExpenseChatTrack: 'C\u2019est ici que vous suivrez vos dépenses',
+        beginningOfChatHistoryPolicyExpenseChatTrack: 'C’est ici que vous suivrez vos dépenses',
         beginningOfChatHistorySelfDM: 'Ceci est votre espace personnel. Utilisez-le pour vos notes, tâches, brouillons et rappels.',
         beginningOfChatHistorySystemDM: 'Bienvenue ! Procédons à la configuration.',
         chatWithAccountManager: 'Discutez avec votre gestionnaire de compte ici',
@@ -7022,7 +7023,7 @@ Rendez obligatoires des informations de dépense comme les reçus et les descrip
                 collect: {
                     title: 'Passer au forfait Collect',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Le plan Collect commence à <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `par membre et par mois.` : `par membre actif et par mois.`} <a href="${learnMoreMethodsRoute}">En savoir plus</a> sur nos plans et nos tarifs.</muted-text>`,
+                        `<muted-text>Le forfait Collect commence à <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `par membre et par mois.` : `par membre actif et par mois.`} <a href="${learnMoreMethodsRoute}">En savoir plus</a> sur nos forfaits et nos tarifs.</muted-text>`,
                 },
                 note: 'Débloquez nos fonctionnalités les plus puissantes, notamment :',
                 benefits: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index c14ab78534f..41cc5805f08 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -6980,7 +6980,7 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo
                 collect: {
                     title: 'Passa al piano Collect',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Il piano Collect parte da <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per utente al mese.` : `per membro attivo al mese.`} <a href="${learnMoreMethodsRoute}">Scopri di più</a> sui nostri piani e prezzi.</muted-text>`,
+                        `<muted-text>Il piano Collect parte da <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per membro al mese.` : `per membro attivo al mese.`} <a href="${learnMoreMethodsRoute}">Scopri di più</a> sui nostri piani e prezzi.</muted-text>`,
                 },
                 note: 'Sblocca le nostre funzioni più potenti, tra cui:',
                 benefits: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index aab2628da08..52a71611cd5 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6904,9 +6904,9 @@ ${reportName}
             commonFeatures: {
                 title: 'Controlプランにアップグレード',
                 collect: {
-                    title: 'Collectプランにアップグレード',
+                    title: 'Collect プランにアップグレード',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Collect プランは <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `メンバー1人あたり月額` : `アクティブメンバー1人あたり月額`} からご利用いただけます。プランと料金の詳細は <a href="${learnMoreMethodsRoute}">こちら</a> をご覧ください。</muted-text>`,
+                        `<muted-text>Collect プランは <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `メンバー1人あたり月額` : `アクティブメンバー1人あたり/月`} からご利用いただけます。プランと料金の詳細は <a href="${learnMoreMethodsRoute}">こちら</a> をご覧ください。</muted-text>`,
                 },
                 note: '以下を含む、最も強力な機能をアンロックしましょう:',
                 benefits: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 37162401390..5a4ceaf2bc2 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6959,7 +6959,7 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar
                 collect: {
                     title: 'Upgrade naar het Collect-abonnement',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Het Collect-abonnement begint bij <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per lid per maand.` : `per actieve deelnemer per maand.`} <a href="${learnMoreMethodsRoute}">Meer informatie</a> over onze abonnementen en prijzen.</muted-text>`,
+                        `<muted-text>Het Collect-abonnement begint bij <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `per lid per maand.` : `per actief lid per maand.`} <a href="${learnMoreMethodsRoute}">Meer informatie</a> over onze abonnementen en prijzen.</muted-text>`,
                 },
                 note: 'Ontgrendel onze krachtigste functies, waaronder:',
                 benefits: {
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 8b0008dd05c..e283a88119a 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6953,7 +6953,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
                 collect: {
                     title: 'Ulepsz do planu Collect',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
-                        `<muted-text>Plan Collect zaczyna się od <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `za użytkownika miesięcznie.` : `na aktywnego członka miesięcznie.`} <a href="${learnMoreMethodsRoute}">Dowiedz się więcej</a> o naszych planach i cenach.</muted-text>`,
+                        `<muted-text>Plan Collect zaczyna się od <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `za użytkownika miesięcznie.` : `za aktywnego członka miesięcznie.`} <a href="${learnMoreMethodsRoute}">Dowiedz się więcej</a> o naszych planach i cenach.</muted-text>`,
                 },
                 note: 'Odblokuj nasze najpotężniejsze funkcje, w tym:',
                 benefits: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 5bc4808d8d0..fef411b5dd6 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6955,7 +6955,7 @@ Exija dados de despesas como recibos e descrições, defina limites e padrões e
             commonFeatures: {
                 title: 'Faça upgrade para o plano Control',
                 collect: {
-                    title: 'Faça upgrade para o plano Collect',
+                    title: 'Fazer upgrade para o plano Collect',
                     startsAtFull: (learnMoreMethodsRoute: string, formattedPrice: string, hasTeam2025Pricing: boolean) =>
                         `<muted-text>O plano Collect começa em <strong>${formattedPrice}</strong> ${hasTeam2025Pricing ? `por membro por mês.` : `por membro ativo por mês.`} <a href="${learnMoreMethodsRoute}">Saiba mais</a> sobre nossos planos e preços.</muted-text>`,
                 },

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants