-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[NoQA] feat: show submit button in MoneyReportHeader when report is in draft #28998
[NoQA] feat: show submit button in MoneyReportHeader when report is in draft #28998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment, besides LGTM.
@cubuspl42 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] |
@mountiny Updated! |
@mountiny Updated! |
Can you please merge main to resolve conflicts from #28918 thank you! |
@mountiny Updated! |
@BeeMargarida Why is this unusual "Required setup" necessary? |
There's no support for reports in draft/open state in NewDot, so this "required setup" forces one of them to this state so that we can test that the submit button is working. |
@cubuspl42 no need for c+ review here, will take care of this, thanks! |
Reviewer Checklist
Screenshots/VideosFeature which is not accessible by the users yet WebMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
success={chatReport.isOwnPolicyExpenseChat} | ||
text={translate('common.submit')} | ||
style={[styles.w100, styles.pr0]} | ||
onPress={() => IOU.submitReport(moneyRequestReport)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not exported right now I believe, wont we get complains about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's being exported from lib/actions/IOU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I must have seen some commit diff then, sorry.
✋ 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/mountiny in version: 1.3.81-0 🚀
|
🚀 Deployed to staging by https://github.com/mountiny in version: 1.3.83-0 🚀
|
}, [policyType, isManager, isApproved, isSettled]); | ||
return isManager && !isDraft && !isApproved && !isSettled; | ||
}, [policyType, isManager, isDraft, isApproved, isSettled]); | ||
const shouldShowSubmitButton = isDraft; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Admin can submit and approve it is own report when Prevent self approval
is enabled. So we should have prevented submitting it, ref: #36425
Details
Adds submit button in
MoneyReportHeader
for a money request report that is in the open/draft state.Fixed Issues
$ #28765
Tests
To test this currently, it requires some setup. Check the dropdown below.
Required setup
ReportScreen.js
and copy paste the code below inside theuseEffect
with empty dependency array, afterfetchReportIfNeeded
. Use the report ID of the previous post. This will make the report have the status of open/draft.Offline tests
Same as above
QA Steps
N/A
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android