-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Feature/kuba nowakowski/add empty state to expense view #58795
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
Merged
mountiny
merged 26 commits into
Expensify:main
from
software-mansion-labs:feature/kuba-nowakowski/Add-empty-State-to-Expense-View
Mar 28, 2025
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
17ede8a
fix logic for showing Create report button
SzymczakJ b701d06
modify EmptyStateComponent to accept new styles
SzymczakJ ea89c3a
empty state
SzymczakJ f1fec3c
moving widget to correct place
sumo-slonik efd6879
moving widget to correct place
sumo-slonik c451508
work in progress
sumo-slonik 4dac413
fix bug with duplicate report
sumo-slonik e3fd62d
Merge branch 'main' into @szymczak/Add-empty-State-to-Expense-View
sumo-slonik 013aa45
add header state
sumo-slonik 89828e5
add header state
sumo-slonik d7c0c5a
fix lint
sumo-slonik f89ed26
changes after review
sumo-slonik 11a2d5c
Merge branch 'main' into feature/kuba-nowakowski/Add-empty-State-to-E…
sumo-slonik c4ea777
Merge branch 'main' into feature/kuba-nowakowski/Add-empty-State-to-E…
sumo-slonik 9246657
resolve conflicts
sumo-slonik 79b3c4d
fix position on empty stater component
sumo-slonik 437fdbb
confirm spanish version
sumo-slonik f9ae2ea
fixes comments from review
sumo-slonik e2e322f
Merge branch 'main' into feature/kuba-nowakowski/Add-empty-State-to-E…
sumo-slonik f76c73c
fix report name population logic
SzymczakJ 95009ad
fix report title optimistic value
SzymczakJ c1dd407
add next steps from onyx
sumo-slonik d9543f6
add display name
sumo-slonik 8b3cac3
remove unnecessary translation
sumo-slonik 9330f42
add header data to optimistic message
sumo-slonik 71cbf7f
Merge branch 'main' into feature/kuba-nowakowski/Add-empty-State-to-E…
sumo-slonik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/components/MoneyRequestReportView/SearchMoneyRequestReportEmptyState.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
| import EmptyStateComponent from '@components/EmptyStateComponent'; | ||
| import LottieAnimations from '@components/LottieAnimations'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
| import CONST from '@src/CONST'; | ||
|
|
||
| function SearchMoneyRequestReportEmptyState() { | ||
| const {translate} = useLocalize(); | ||
| const styles = useThemeStyles(); | ||
|
|
||
| return ( | ||
| <View style={styles.flex1}> | ||
| <EmptyStateComponent | ||
| cardStyles={[styles.appBG]} | ||
| cardContentStyles={[styles.pt5, styles.pb0]} | ||
| headerMediaType={CONST.EMPTY_STATE_MEDIA.ANIMATION} | ||
| headerMedia={LottieAnimations.GenericEmptyState} | ||
| title={translate('search.moneyRequestReport.emptyStateTitle')} | ||
| subtitle={translate('search.moneyRequestReport.emptyStateSubtitle')} | ||
| headerStyles={[styles.emptyStateMoneyRequestReport]} | ||
| lottieWebViewStyles={styles.emptyStateFolderWebStyles} | ||
| headerContentStyles={styles.emptyStateFolderWebStyles} | ||
| /> | ||
| </View> | ||
| ); | ||
| } | ||
sumo-slonik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| SearchMoneyRequestReportEmptyState.displayName = 'SearchMoneyRequestReportEmptyState'; | ||
|
|
||
| export default SearchMoneyRequestReportEmptyState; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -134,6 +134,12 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t | |
| currentUserAccountID, | ||
| shouldChangeUserDisplayName: true, | ||
| }); | ||
| const isReportContainingTransactions = | ||
| report && | ||
| ((report.total !== 0 && report.total !== undefined) || | ||
| (report.unheldTotal !== 0 && report.unheldTotal !== undefined) || | ||
| (report.unheldNonReimbursableTotal !== 0 && report.unheldNonReimbursableTotal !== undefined)); | ||
|
|
||
| const ownerDisplayName = ownerPersonalDetails?.displayName ?? ownerPersonalDetails?.login ?? getDisplayNameForParticipant({accountID: ownerAccountID}); | ||
| const policyOwnerDisplayName = policyOwnerPersonalDetails?.displayName ?? policyOwnerPersonalDetails?.login ?? getDisplayNameForParticipant({accountID: policy.ownerAccountID}); | ||
| const nextApproverDisplayName = getNextApproverDisplayName(report, isUnapprove); | ||
|
|
@@ -229,7 +235,7 @@ function buildNextStep(report: OnyxEntry<Report>, predictedNextStatus: ValueOf<t | |
| }; | ||
|
|
||
| // Scheduled submit enabled | ||
| if (harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL) { | ||
| if (harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL && isReportContainingTransactions) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add test for NextStepsUtils for this - added here #59295 |
||
| optimisticNextStep.message = [ | ||
| { | ||
| text: 'Waiting for ', | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.