Skip to content

Fix - Add a setting for creating a different default report title in New Expensify Collect#59568

Merged
blimpich merged 29 commits into
Expensify:mainfrom
FitseTLT:fix-move-report-fields-feature-to-reports
May 8, 2025
Merged

Fix - Add a setting for creating a different default report title in New Expensify Collect#59568
blimpich merged 29 commits into
Expensify:mainfrom
FitseTLT:fix-move-report-fields-feature-to-reports

Conversation

@FitseTLT

@FitseTLT FitseTLT commented Apr 2, 2025

Copy link
Copy Markdown
Contributor

Details

Fixed Issues

$ #59065
PROPOSAL: #59065 (comment)

Tests

  1. Create new workspace
  2. Go to more features and verify report fields option is no more available
  3. Note that there is Reports menu below Members
  4. Click on it
  5. Note that Custom report names and Prevent members from changing report titles options appear (they are moved from the Rules features options)
  6. Verify that you can set Custom report names
  7. Press on Prevent members from changing report titles and check that upgrade page is opened
  8. Press on Report Fields option and check that upgrade page is opened
  9. Upgrade the workspace
  10. Verify that you can add report fields
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Same as above

  • 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
    • MacOS: Desktop
  • 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
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • 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 approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • 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.js 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(themeColors.componentBG))
  • 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 form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label 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
2025-04-10.18-44-07.mp4
Android: mWeb Chrome
2025-04-10.18-46-40.mp4
iOS: Native
2025-04-10.19-21-19.mp4
iOS: mWeb Safari
2025-04-10.19-23-30.mp4
MacOS: Chrome / Safari
2025-04-10.19-38-14.mp4
MacOS: Desktop
2025-04-10.19-36-36.mp4

@FitseTLT

FitseTLT commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

Waiting for the BE changes I wanted to finish up the FE part so I want comments from design perspective @shawnborton. Is there any way I can have the exact px of the spacing of the design in the OP

2025-04-03.15-58-45.mp4

@shawnborton

Copy link
Copy Markdown
Contributor

Looking pretty close! Some quick comments (cc @Expensify/design to check this too):

In the empty state, we have too much space at the bottom of this card:
CleanShot 2025-04-03 at 16 37 36@2x

The spacing should look more like these from Workflows:
CleanShot 2025-04-03 at 16 38 54@2x

Please check the space between the card title and the toggle below it. Again, check the Workflows page for exact spacing.

@shawnborton

Copy link
Copy Markdown
Contributor

The Add field row should bleed from edge-to-edge:
CleanShot 2025-04-03 at 16 39 29@2x

Again, check Workflows > Add approvals to see how it should actually look:
CleanShot 2025-04-03 at 16 39 46@2x

@shawnborton

Copy link
Copy Markdown
Contributor

It looks like the fields that are added aren't lined up correct either:
CleanShot 2025-04-03 at 16 40 34@2x

They should be over to the left and right some more. Basically if you fix the padding issue you have with the create row, you should fix this padding issue here as well. But notice how the text in the rows aren't left-aligned with the intro text above?

@shawnborton

shawnborton commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

I think we need a period after "extensive formulas" here:
CleanShot 2025-04-03 at 16 41 42@2x

@shawnborton

Copy link
Copy Markdown
Contributor

Yup, similar comment as above, these rows aren't bleeding edge-to-edge:
CleanShot 2025-04-03 at 16 42 17@2x

@shawnborton

Copy link
Copy Markdown
Contributor

@FitseTLT I am happy to share the Figma file with you, but can you first just try to reference other parts of the workspace editor and use the exact spacing you see from say the Workflows page?

@FitseTLT

FitseTLT commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

Yep Will do Pretty helpful guidance Thx 👍

@FitseTLT

FitseTLT commented Apr 4, 2025

Copy link
Copy Markdown
Contributor Author

Here is how it looks now

2025-04-05.00-54-00.mp4

@shawnborton

Copy link
Copy Markdown
Contributor

This is feeling really solid to me! Let us know when it's ready for a test build and I will trigger them for us.

@flaviadefaria

Copy link
Copy Markdown
Contributor

Same! Looking forward to a test build to play around with it a bit more.

@FitseTLT

FitseTLT commented Apr 7, 2025

Copy link
Copy Markdown
Contributor Author

Will do after we get the BE fixed 👍

@flaviadefaria

Copy link
Copy Markdown
Contributor

@FitseTLT I believe we're good to resume the work here now that the BE changes are live!

@FitseTLT

Copy link
Copy Markdown
Contributor Author

@shawnborton or @flaviadefaria We used to have a confirm modal for disabling report field feature in More features page do you think we need to have it now?

@shawnborton

Copy link
Copy Markdown
Contributor

Can you show me what that looks like? I don't mind the idea of using it here too.

@FitseTLT

Copy link
Copy Markdown
Contributor Author
2025-04-10.18-02-31.mp4

@flaviadefaria

Copy link
Copy Markdown
Contributor

Oh I really like adding that modal in!

@trjExpensify

Copy link
Copy Markdown
Contributor

Specifically you mean the Report fields toggle here, right? The Report fields option in More features has gone away with these changes.

image

I agree with that if so. The report fields toggle on the Reports page should be locked (which can be either enabled or disabled) when the accounting solution is connected. When clicked, it shows the alert modal with the reason why and a button to get over to the accounting settings.

@FitseTLT

FitseTLT commented May 7, 2025

Copy link
Copy Markdown
Contributor Author

@suneox Added

@suneox

suneox commented May 7, 2025

Copy link
Copy Markdown
Contributor

@suneox Added

Thanks for the quick update! The new change set works as expected

Screen.Recording.2025-05-08.at.00.40.55.mp4

@melvin-bot melvin-bot Bot requested a review from blimpich May 7, 2025 17:51

@blimpich blimpich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code looks good. @FitseTLT @suneox can one of you provide a video of the new modal for when the user clicks on the toggle and is directed to go to the accounting settings? That way we can all confirm visually its what we expect.

@trjExpensify just to clarify, are you expecting that the toggle will have the "lock" icon on it too?
Screenshot 2025-05-07 at 3 20 27 PM

@trjExpensify

Copy link
Copy Markdown
Contributor

@trjExpensify just to clarify, are you expecting that the toggle will have the "lock" icon on it too?

Yep, it's locked enabled or locked disabled when you're connected to an accounting solution. It all depends on if you're importing coding as report fields or not. But in both cases, you can't "manually" or independently manage report fields once you connect.

@trjExpensify

Copy link
Copy Markdown
Contributor

P.S @FitseTLT conflicts again. 😅

@suneox

suneox commented May 8, 2025

Copy link
Copy Markdown
Contributor

Code looks good. @FitseTLT @suneox can one of you provide a video of the new modal for when the user clicks on the toggle and is directed to go to the accounting settings?

The video has included in my checklist

Screen.Recording.2025-05-08.at.00.40.55.mp4

@FitseTLT

FitseTLT commented May 8, 2025

Copy link
Copy Markdown
Contributor Author

@blimpich Conflict resolved

@blimpich blimpich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job!

@blimpich blimpich merged commit a062a23 into Expensify:main May 8, 2025
@OSBotify

OSBotify commented May 8, 2025

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@MonilBhavsar MonilBhavsar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR might have introduced bug #62065
If anyone could please take a look, thanks!

@dukenv0307

Copy link
Copy Markdown
Contributor

Coming from: #62090. We should move SCREENS.WORKSPACE.RULES_CUSTOM_NAME from [SCREENS.WORKSPACE.RULES] to [SCREENS.WORKSPACE.REPORT_FIELDS]

<OfflineWithFeedback pendingAction={reportTitlePendingFields.defaultValue}>
<MenuItemWithTopDescription
description={translate('workspace.rules.expenseReportRules.customNameTitle')}
title={policy?.fieldList?.[CONST.POLICY.FIELDS.FIELD_LIST_TITLE].defaultValue}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Passing the title value here like this led to the following issue:

we fixed it by wrapping the value with Str.htmlDecode().

Comment on lines +271 to +278
<FlatList
data={reportFieldsSections}
renderItem={renderItem}
style={[shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8, styles.mt6]}
scrollEnabled={false}
/>
{!hasReportAccountingConnections && (
<MenuItem

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should have avoided nesting FlatList inside ScrollView as per docs. Issue: #62240

/>
{!isLoading && (
<ScrollView contentContainerStyle={[styles.flexGrow1, styles.mt3, shouldUseNarrowLayout ? styles.workspaceSectionMobile : styles.workspaceSection]}>
<Section

@QichenZhu QichenZhu Dec 22, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This section didn't have offline styling like the other sections.

We wrapped the title and subtitle in OfflineWithFeedback to fix it.

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.