[No QA] Bootstrap secondary actions getter#57678
Conversation
|
@allgandalf 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] |
…ied-actions-get-secondary-action
| } | ||
|
|
||
| const isPaymentProcessing = true; // TODO | ||
| const hasDailyNachaCutoffPassed = false; // TODO |
There was a problem hiding this comment.
@luacmartins I'm not sure how to determine this value
There was a problem hiding this comment.
The cutoff is 23:45 PM UTC the day the payment was made
There was a problem hiding this comment.
Hmm so here I have to find payment transaction and get it's creation date and check if it's after 23:45 on that day?
There was a problem hiding this comment.
Yes, you can probably use getIOUActionForReportID to get the IOU action and check if it's a pay action and then use the reportAction date
|
@jnowakow please also fix the failing test |
| } | ||
|
|
||
| if (isEmptyObject(report) || report.isWaitingOnBankAccount) { | ||
| if (isEmptyObject(report)) { |
…ied-actions-get-secondary-action
|
@jnowakow when do you think you can get this PR out of draft |
I think I will mark it as ready to review today |
|
Nice! Let's push to get this one reviewed today then! |
|
@luacmartins @allgandalf it's ready (I hope 🤞) |
|
@jnowakow quoting from the design doc:
Are we not doing it in this PR? |
allgandalf
left a comment
There was a problem hiding this comment.
@jnowakow please update the ReportSecondaryActionUtils, it doesn't follow the style we follow in our codebase, i didn't comment on some functions but the same applies to all the functions, do let reach out to me if you need any extra help here, thanks !
| } | ||
|
|
||
| const isAdmin = policy?.role === CONST.POLICY.ROLE.ADMIN; | ||
| const isReimbursed = report.statusNum === CONST.REPORT.STATUS_NUM.REIMBURSED; |
There was a problem hiding this comment.
isReportReimbursed please
@allgandalf we're gonna handle UI changes in a separate PR |
ohh, it confused me as it was written in the design doc section of |
|
@allgandalf I renamed all variables according to your suggestion |
|
Ready for another review from @allgandalf |
allgandalf
left a comment
There was a problem hiding this comment.
okay, code LGTM! just one comment, but that won't block me from testing out this PR.
Completing checklist now
|
This PR has nothing to test in particular but i will try building each platform and verify that we are able to build successfully |
Reviewer Checklist
Screenshots/Videos |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.1.11-1 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.1.12-7 🚀
|
| const isReportSubmitter = isCurrentUserSubmitter(report.reportID); | ||
| const isReportApprover = isApproverUtils(policy, getCurrentUserAccountID()); | ||
|
|
||
| if (!isReportSubmitter && !isReportApprover) { |
There was a problem hiding this comment.
This check should include to ensure that the current user is neither the admin nor the manager before returning false to match the behaviour shown on report preview. Fixed here
| if (hasAllPendingRTERViolations) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
Coming from #63137, we need to check isProcessingReport here to prevent displaying approve button if expense is not submitted and hasAllPendingRTERViolations is true.
|
|
||
| const autoReportingFrequency = getCorrectedAutoReportingFrequency(policy); | ||
|
|
||
| const isScheduledSubmitEnabled = policy?.harvesting?.enabled && autoReportingFrequency !== CONST.POLICY.AUTO_REPORTING_FREQUENCIES.MANUAL; |
There was a problem hiding this comment.
Coming from this issue #62266 , here on isSubmitAction we are checking that when Scheduled Submit is enabled for the workspace, the Submit button appears as a secondary action. This behavior caused an issue if the workspace has Manual Submit enabled then Submit button does not appear for duplicate expenses. context: #62266 (comment)
| const paymentDatetime = new Date(action.created); | ||
| const nowUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds())); | ||
| const cutoffTimeUTC = new Date(Date.UTC(paymentDatetime.getUTCFullYear(), paymentDatetime.getUTCMonth(), paymentDatetime.getUTCDate(), 23, 45, 0)); | ||
| return nowUTC.getTime() < cutoffTimeUTC.getTime(); |
There was a problem hiding this comment.
Coming from #66225 BugZero checklist:
the implementation of the hasDailyNachaCutoffPassed condition is described in #57678 (comment) check if it's after 23:45 on that day so that mean the current time must be > cut off time






Explanation of Change
Adds logic for determining what secondary actions should be available for report.
Fixed Issues
$ #57438
PROPOSAL: N/A
Tests
Verify that
npm run testpassesOffline tests
N/A
QA Steps
N/A
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop