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

Adapt Split Bill to workspace chats #24058

Merged
merged 13 commits into from
Aug 17, 2023
Merged

Conversation

youssef-lr
Copy link
Contributor

@youssef-lr youssef-lr commented Aug 2, 2023

Details

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/303750

Tests

  • Verify that no errors appear in the JS console

Must be tested with Auth and Web-E PRs.

  1. Create a Control policy.
  2. Enable this policy for expense chats, replace {policyID} with the ID of the policy we just created:
update nameValuePairs set value = JSON_UPDATE(value, '$.isPolicyExpenseChatEnabled', 'true') where name = "expensify_policy{policyID}";
  1. Invite two members, let's call them [email protected] and [email protected]
  2. Set the submitsTo of [email protected] to [email protected], meaning the principal will be the manager of the teacher.
  3. Head to NewDot and log in as the teacher.
  4. Make sure a policy expense chat has been created which belongs to the Control policy.
  5. Make sure the policy expense chat has 2 participants: the policy owner and the manager (principal).
  6. Click on "+" and created a Split Bill request.
  7. Make sure a split bill is created, as well as an expense report.
  8. Clicking on the report preview should take you to the expense report.
  9. Navigate to Onyx data of the expense report, make sure the managerID of the report belongs to the [email protected].

Offline tests

QA Steps

Regression QA

Test that the normal flow of split bill in group DMs / from Global create with a single participant work properly.

For the rest of the QA, please ping me.

  • 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 / Chrome
    • iOS / native
    • iOS / 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 the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 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.
  • 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android

@youssef-lr youssef-lr self-assigned this Aug 2, 2023
@youssef-lr youssef-lr changed the title Adapt Split Bill to workspace chats [HOLD Web-E#38412] Adapt Split Bill to workspace chats Aug 4, 2023
@youssef-lr youssef-lr marked this pull request as ready for review August 9, 2023 23:46
@youssef-lr youssef-lr requested a review from a team as a code owner August 9, 2023 23:46
@melvin-bot melvin-bot bot requested review from thesahindia and removed request for a team August 9, 2023 23:46
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

@thesahindia Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@youssef-lr youssef-lr added the Internal Requires API changes or must be handled by Expensify staff label Aug 9, 2023
@youssef-lr youssef-lr requested review from a team and removed request for thesahindia August 9, 2023 23:46
@melvin-bot melvin-bot bot requested review from fedirjh and removed request for a team August 9, 2023 23:46
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

@fedirjh Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@youssef-lr youssef-lr requested review from a team and removed request for fedirjh August 9, 2023 23:46
@melvin-bot melvin-bot bot requested review from rushatgabhane and removed request for a team August 9, 2023 23:47
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

@rushatgabhane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@youssef-lr youssef-lr removed the request for review from rushatgabhane August 9, 2023 23:47
@youssef-lr
Copy link
Contributor Author

Sorry folks I'm trying to get an internal engineer assigned but it won't work even though I have the Internal label.

@youssef-lr youssef-lr force-pushed the youssef_splitbill_workspace branch from 0c63b50 to 11cfc57 Compare August 10, 2023 15:59
@PauloGasparSv
Copy link
Contributor

Hey @youssef-lr not sure if you are aware of this behaviour:

After I create the "Split Bill" if I click on the first report action created the web app Crashes. Everything starts working again after I click on "refresh" though:

Screen.Recording.2023-08-10.at.15.31.03.mov

@PauloGasparSv PauloGasparSv self-requested a review August 10, 2023 18:42
@youssef-lr
Copy link
Contributor Author

@PauloGasparSv should be fixed now!

@PauloGasparSv
Copy link
Contributor

Hey @youssef-lr tested this on Web and is looking great!!!!

Do you mind taking a look at the following before I test other platforms?

When I open the "bill report" (the following image) I'm redirected to the correct report but there is a warning on the console.

Do you mind checking why that is happening, I tested creating a Split Bill on a 1:1 chat in Staging and I don't think we have that warning there

Warning: Failed prop type: Invalid prop `parentReportID` of type `number` supplied to `ParentNavigationSubtitle`, expected `string`.
    at ParentNavigationSubtitle (webpack-internal:///./src/components/ParentNavigationSubtitle.js:45:37)
    at AvatarWithDisplayName (webpack-internal:///./src/components/AvatarWithDisplayName.js:74:83)
    at withLocalize(AvatarWithDisplayName)
    at withWindowDimensions(withLocalize(AvatarWithDisplayName))
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at HeaderWithBackButton (webpack-internal:///./src/components/HeaderWithBackButton/index.js:51:28)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at MoneyReportHeader (webpack-internal:///./src/components/MoneyReportHeader.js:78:34)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at withWindowDimensions(Component)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at OfflineWithFeedback (webpack-internal:///./src/components/OfflineWithFeedback.js:108:85)
    at withNetwork(OfflineWithFeedback)
    at withLocalize(withNetwork(OfflineWithFeedback))
    at FullPageNotFoundView (webpack-internal:///./src/components/BlockingViews/FullPageNotFoundView.js:67:13)
    at withLocalize(FullPageNotFoundView)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at PickerAvoidingView (webpack-internal:///./node_modules/react-native-picker-select/src/PickerAvoidingView/index.js:22:23)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at KeyboardAvoidingView
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaConsumer
    at ScreenWrapper (webpack-internal:///./src/components/ScreenWrapper/index.js:76:86)
    at withNetwork(ScreenWrapper)
    at withKeyboardState(withNetwork(ScreenWrapper))
    at withWindowDimensions(withKeyboardState(withNetwork(ScreenWrapper)))
    at eval (webpack-internal:///./src/components/withEnvironment.js:62:72)
    at WithNavigation (webpack-internal:///./src/components/withNavigation.js:23:93)
    at ReportScreen (webpack-internal:///./src/pages/home/ReportScreen.js:171:86)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at withNetwork(Component)
    at withWindowDimensions(withNetwork(Component))
    at withLocalize(withWindowDimensions(withNetwork(Component)))
    at WithViewportOffsetTop (webpack-internal:///./src/components/withViewportOffsetTop.js:47:88)
    at ReportScreenWrapper (webpack-internal:///./src/libs/Navigation/AppNavigator/ReportScreenWrapper.js:80:90)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at StaticContainer (webpack-internal:///./node_modules/@react-navigation/core/lib/module/StaticContainer.js:13:16)
    at EnsureSingleNavigator (webpack-internal:///./node_modules/@react-navigation/core/lib/module/EnsureSingleNavigator.js:17:5)
    at SceneView (webpack-internal:///./node_modules/@react-navigation/core/lib/module/SceneView.js:22:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at CardSheet (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardSheet.js:18:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at AnimatedComponent (webpack-internal:///./node_modules/@expensify/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:59:88)
    at AnimatedComponentWrapper
    at Dummy (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/GestureHandler.js:14:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at AnimatedComponent (webpack-internal:///./node_modules/@expensify/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:59:88)
    at AnimatedComponentWrapper
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at Card (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/Card.js:54:1)
    at CardContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardContainer.js:27:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at NativeScreen (webpack-internal:///./node_modules/react-native-screens/lib/module/index.js:57:1)
    at AnimatedComponent (webpack-internal:///./node_modules/@expensify/react-native-web/dist/vendor/react-native/Animated/createAnimatedComponent.js:59:88)
    at AnimatedComponentWrapper
    at MaybeScreen (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:32:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at MaybeScreenContainer (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Screens.js:20:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at Background (webpack-internal:///./node_modules/@react-navigation/stack/node_modules/@react-navigation/elements/lib/module/Background.js:15:5)
    at CardStack (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/CardStack.js:191:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at SafeAreaProviderCompat (webpack-internal:///./node_modules/@react-navigation/stack/node_modules/@react-navigation/elements/lib/module/SafeAreaProviderCompat.js:40:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at StackView (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/views/Stack/StackView.js:34:1)
    at PreventRemoveProvider (webpack-internal:///./node_modules/@react-navigation/core/lib/module/PreventRemoveProvider.js:43:5)
    at NavigationContent (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:10:5)
    at eval (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:27:7)
    at StackNavigator (webpack-internal:///./node_modules/@react-navigation/stack/lib/module/navigators/createStackNavigator.js:18:5)
    at Suspender (webpack-internal:///./node_modules/react-freeze/dist/index.modern.js:10:21)
    at Suspense
    at Freeze (webpack-internal:///./node_modules/react-freeze/dist/index.modern.js:30:22)
    at FreezeWrapper (webpack-internal:///./src/libs/Navigation/FreezeWrapper.js:30:66)
    at CentralPaneNavigator
    at StaticContainer (webpack-internal:///./node_modules/@react-navigation/core/lib/module/StaticContainer.js:13:16)
    at EnsureSingleNavigator (webpack-internal:///./node_modules/@react-navigation/core/lib/module/EnsureSingleNavigator.js:17:5)
    at SceneView (webpack-internal:///./node_modules/@react-navigation/core/lib/module/SceneView.js:22:5)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at ThreePaneView (webpack-internal:///./src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/ThreePaneView.js:48:101)
    at PreventRemoveProvider (webpack-internal:///./node_modules/@react-navigation/core/lib/module/PreventRemoveProvider.js:43:5)
    at NavigationContent (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:10:5)
    at eval (webpack-internal:///./node_modules/@react-navigation/core/lib/module/useComponent.js:27:7)
    at ResponsiveStackNavigator (webpack-internal:///./src/libs/Navigation/AppNavigator/createResponsiveStackNavigator/index.js:38:23)
    at AuthScreens (webpack-internal:///./src/libs/Navigation/AppNavigator/AuthScreens.js:167:86)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at withWindowDimensions(Component)
    at AppNavigator (webpack-internal:///./src/libs/Navigation/AppNavigator/index.js:16:13)
    at EnsureSingleNavigator (webpack-internal:///./node_modules/@react-navigation/core/lib/module/EnsureSingleNavigator.js:17:5)
    at BaseNavigationContainer (webpack-internal:///./node_modules/@react-navigation/core/lib/module/BaseNavigationContainer.js:89:5)
    at ThemeProvider (webpack-internal:///./node_modules/@react-navigation/native/lib/module/theming/ThemeProvider.js:12:5)
    at NavigationContainerInner (webpack-internal:///./node_modules/@react-navigation/native/lib/module/NavigationContainer.js:42:5)
    at NavigationRoot (webpack-internal:///./src/libs/Navigation/NavigationRoot.js:92:74)
    at DeeplinkWrapper (webpack-internal:///./src/components/DeeplinkWrapper/index.website.js:33:23)
    at Expensify (webpack-internal:///./src/Expensify.js:131:77)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at withLocalize(Component)
    at BaseErrorBoundary (webpack-internal:///./src/components/ErrorBoundary/BaseErrorBoundary.js:51:86)
    at ThemeStylesProvider (webpack-internal:///./src/styles/ThemeStylesProvider.js:27:75)
    at ThemeProvider (webpack-internal:///./src/styles/themes/ThemeProvider.js:27:88)
    at EnvironmentProvider (webpack-internal:///./src/components/withEnvironment.js:32:23)
    at PickerStateProvider (webpack-internal:///./node_modules/react-native-picker-select/src/PickerStateProvider.js:44:86)
    at CurrentReportIDContextProvider (webpack-internal:///./src/components/withCurrentReportID.js:34:66)
    at PopoverContextProvider (webpack-internal:///./src/components/PopoverProvider/index.js:25:70)
    at KeyboardStateProvider (webpack-internal:///./src/components/withKeyboardState.js:47:86)
    at WindowDimensionsProvider (webpack-internal:///./src/components/withWindowDimensions.js:47:66)
    at RenderersPropsProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/context/RenderersPropsProvider.js:46:44)
    at ListStyleSpecsProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/context/ListStyleSpecsProvider.js:70:3)
    at SharedPropsProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/context/SharedPropsProvider.js:82:48)
    at RenderRegistryProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/context/RenderRegistryProvider.js:41:3)
    at RenderHTMLConfigProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/RenderHTMLConfigProvider.js:72:5)
    at TRenderEngineProvider (webpack-internal:///./node_modules/react-native-render-html/lib/commonjs/TRenderEngineProvider.js:121:3)
    at BaseHTMLEngineProvider (webpack-internal:///./src/components/HTMLEngineProvider/BaseHTMLEngineProvider.js:91:13)
    at HTMLEngineProvider (webpack-internal:///./src/components/HTMLEngineProvider/index.js:18:18)
    at withWindowDimensions(HTMLEngineProvider)
    at LocaleContextProvider (webpack-internal:///./src/components/withLocalize.js:94:86)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at WithCurrentUserPersonalDetails (webpack-internal:///./src/components/withCurrentUserPersonalDetails.js:54:27)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at withOnyx(LocaleContextProvider)
    at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///./src/components/SafeArea/index.js:6:23)
    at PortalProviderComponent (webpack-internal:///./node_modules/@gorhom/portal/lib/module/components/portalProvider/PortalProvider.js:18:3)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at NativeSafeAreaProvider (webpack-internal:///./node_modules/react-native-safe-area-context/lib/module/NativeSafeAreaProvider.web.js:28:5)
    at SafeAreaProvider (webpack-internal:///./node_modules/react-native-safe-area-context/lib/module/SafeAreaContext.js:38:5)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at Provider (webpack-internal:///./src/components/createOnyxContext.js:32:19)
    at withOnyx (webpack-internal:///./node_modules/react-native-onyx/dist/web.development.js:2350:9)
    at ComposeProviders (webpack-internal:///./src/components/ComposeProviders.js:20:214)
    at OnyxProvider (webpack-internal:///./src/components/OnyxProvider.js:75:12)
    at ComposeProviders (webpack-internal:///./src/components/ComposeProviders.js:20:214)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at GestureHandlerRootView
    at App
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at div
    at eval (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/View/index.js:52:25)
    at AppContainer (webpack-internal:///./node_modules/@expensify/react-native-web/dist/exports/AppRegistry/AppContainer.js:23:24)

@youssef-lr
Copy link
Contributor Author

Hmm I managed to produce it once but never consistently, still on it.

@youssef-lr
Copy link
Contributor Author

@PauloGasparSv I think that got fixed in Web-E main, after merging main on Web-E I can no longer see the error. I'll push an update to the Web-E PR.

@PauloGasparSv
Copy link
Contributor

@PauloGasparSv I think that got fixed in Web-E main, after merging main on Web-E I can no longer see the error. I'll push an update to the Web-E PR.

Nice, re-testing this with the update Web-e branch!

@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Aug 14, 2023

Looks like everything is working fine!

  1. Make sure the policy expense chat has 2 participants: the policy owner and the manager (principal).

I see things a little different here but I think it's still correct, since I logged in as the teacher I only see 2 participants: The teacher and the Policy Owner (I do not see the Principal/manager there).

Despite that, the manager id and email used in the Split Bill report is the Pricinpal's/Manager's so I think this is ok.

Screenshots

image

image

image

@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Aug 14, 2023

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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 the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • 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 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 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.
  • 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-08-17.at.13.29.58.mov
Screen.Recording.2023-08-17.at.13.46.24.mov
Mobile Web - Chrome
Screen.Recording.2023-08-17.at.17.05.57.mov
Mobile Web - Safari
Screen.Recording.2023-08-17.at.17.03.14.mov
Desktop
Screen.Recording.2023-08-17.at.16.50.04.mov
iOS
Screen.Recording.2023-08-17.at.16.55.48.mov
Android
Screen.Recording.2023-08-17.at.18.47.06.mov

@PauloGasparSv
Copy link
Contributor

@youssef-lr can you please complete the Author's checklist? Will wait on that to finish testing on all platforms : )

@youssef-lr
Copy link
Contributor Author

On it! I just merged Web-E, we'll still need to wait for it to deploy before merging this.

@youssef-lr youssef-lr changed the title [HOLD Web-E#38412] Adapt Split Bill to workspace chats Adapt Split Bill to workspace chats Aug 17, 2023
@@ -132,8 +132,13 @@ function IOUPreview(props) {
const sessionAccountID = lodashGet(props.session, 'accountID', null);
const managerID = props.iouReport.managerID || '';
const ownerAccountID = props.iouReport.ownerAccountID || '';
const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(props.chatReport);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add this chatReport to the propTypes and defaultProps

@@ -1852,6 +1868,7 @@ function getIOUReportActionMessage(type, total, comment, currency, paymentType =
* @param {Boolean} [isSettlingUp] - Whether we are settling up an IOU.
* @param {Boolean} [isSendMoneyFlow] - Whether this is send money flow
* @param {Object} [receipt]
* @param {Boolean} [isOwnPolicyExpenseChat] - Whether this is an expense report create from the current user's policy expense chat
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* @param {Boolean} [isOwnPolicyExpenseChat] - Whether this is an expense report create from the current user's policy expense chat
* @param {Boolean} [isOwnPolicyExpenseChat] - Whether this is an expense report created from the current user's policy expense chat

Nitpicking here!

@PauloGasparSv
Copy link
Contributor

@youssef-lr tests are looking good but can you check one thing?

In the following evidence (at ~1:14) I opened the split bill report and it quickly showed a negative value.
I don't think this was happening before and I can't see this happening when Splitting a Bill in Staging or Dev.

Do you mind taking a look if it happens for you too?

Screen.Recording.2023-08-17.at.13.29.58.mov

Also left 2 very small review comments : )

@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Aug 17, 2023

I couldn't reproduce this after creating another Split Bill in the same Policy/Workspace!

But I was able to reproduce it again after creating a new Control Policy* (re-doing all test steps with the same accounts):

Screen.Recording.2023-08-17.at.13.46.24.mov

@youssef-lr
Copy link
Contributor Author

Checking now @PauloGasparSv!

@youssef-lr
Copy link
Contributor Author

Sorry @PauloGasparSv I'm trying to fix an issue in my dev env https://expensify.slack.com/archives/C05F0U613LY/p1692292276076729, it's preventing me from testing properly

@PauloGasparSv
Copy link
Contributor

PauloGasparSv commented Aug 17, 2023

Only missing android now (build is super slow here), testing good on all platforms!

I'll check I checked that screenshots or videos are included for tests on [all platforms](https://github.com/Expensify/App/blob/main/contributingGuides/CONTRIBUTING.md#make-sure-you-can-test-on-all-platforms) off the reviewer checklist since we already have my evidence so I think we can merge this


Trying to run using Android Studio (also following the recent "[ACTION REQUIRED] Manually update your NewDot XCode scheme" email for that)


Still waiting on this:
image


I'm having this issue now (CloucFlare certificate related I think), trying to fix it!

@youssef-lr
Copy link
Contributor Author

Thank you so much @PauloGasparSv!

@PauloGasparSv
Copy link
Contributor

Still waiting for my latest build attempt after following this! Will merge this asap : )

image

Copy link
Contributor

@PauloGasparSv PauloGasparSv left a comment

Choose a reason for hiding this comment

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

LGTM and tests well on all platforms.

Android took a huge amount time to Build and was really slow, prob related to Cloudflare. Sorry for the delay anyway.

I left a couple of comments but I think they don't need to be addressed right now, going to merge this already!

@PauloGasparSv PauloGasparSv merged commit bed8941 into main Aug 17, 2023
@PauloGasparSv PauloGasparSv deleted the youssef_splitbill_workspace branch August 17, 2023 21:51
@OSBotify
Copy link
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.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/PauloGasparSv in version: 1.3.56-0 🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@mvtglobally
Copy link

@youssef-lr This is ready to QA

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal Requires API changes or must be handled by Expensify staff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants