-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add merchant and date fields to manual requests #23648
Add merchant and date fields to manual requests #23648
Conversation
merchant and date value are taken from the "iou" key-value pair. Clearing this up with Alex.
@shawnborton @0xmiroslav One of you needs to 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] |
@lukemorawski thanks for the PR!! Looks like there's at least 1 file with a conflict :D @0xmiroslav can you please put this relatively high on your priority list? We would love to get this in the App soon, as a few other issues are waiting for it 👍 |
…lds_to_manual_requests
conflict resolved |
onPress={toggleShowAllFields} | ||
text={showAllFields ? translate('common.showLess') : translate('common.showMore')} | ||
shouldShowRightIcon | ||
iconRight={showAllFields ? Expensicons.UpArrow : Expensicons.DownArrow} |
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.
Can we make the icon use our standard colors.icon color?
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 can be a global change for all default buttons too
Looks good so far, curious to see this on desktop too. Is there ever a situation where a "Show less" button appears? |
@shawnborton Ah no, forgot to remove that show less thing :) Will do that in a mo. |
@shawnborton sorry, but I couldn't find an example in the app where an button icon is stylised with the colour you mention. Can you point to a place in the app where this colour is used? |
Ok, I think I got it |
@0xmiroslav can you please test this on all platforms today? If not, can you let me know so I can find a new C+ who is available? |
I am available to review right now |
Ping'd you both in slack 👍 |
@situchan you're up! Please review! And thanks for being available quickly 🙏 |
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.
Let's make this PR simple by undoing any unnecessary changes.
src/libs/actions/IOU.js
Outdated
...(isNewChatReport ? {pendingFields: {createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}} : {}), | ||
...(isNewChatReport | ||
? { | ||
pendingFields: { | ||
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}, | ||
} | ||
: {}), |
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.
Please revert any unnecessary changes like this as long as they don't break lint.
src/libs/actions/IOU.js
Outdated
...(isNewIOUReport | ||
? { | ||
pendingFields: { | ||
createChat: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD, | ||
}, | ||
} | ||
: {}), |
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.
Same ^
src/libs/actions/IOU.js
Outdated
@@ -336,7 +361,6 @@ function requestMoney(report, amount, currency, payeeEmail, payeeAccountID, part | |||
if (iouReport) { | |||
if (isPolicyExpenseChat) { | |||
iouReport = {...iouReport}; | |||
|
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.
Same ^
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 undo'ed yet
src/libs/actions/IOU.js
Outdated
...(existingGroupChatReport ? {} : {[groupCreatedReportAction.reportActionID]: groupCreatedReportAction}), | ||
...(existingGroupChatReport | ||
? {} | ||
: { | ||
[groupCreatedReportAction.reportActionID]: groupCreatedReportAction, | ||
}), |
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.
Same ^
src/libs/actions/IOU.js
Outdated
? {} | ||
: { | ||
[groupCreatedReportAction.reportActionID]: {pendingAction: null}, | ||
}), |
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.
Same ^
src/libs/actions/IOU.js
Outdated
API.write('SendMoneyWithWallet', params, { | ||
optimisticData, | ||
successData, | ||
failureData, | ||
}); |
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.
Same ^
src/libs/actions/IOU.js
Outdated
API.write('SendMoneyViaPaypal', params, { | ||
optimisticData, | ||
successData, | ||
failureData, | ||
}); |
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.
Same ^
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 undo'ed yet
src/libs/actions/IOU.js
Outdated
Onyx.merge(ONYXKEYS.IOU, { | ||
participants, | ||
}); |
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.
Same ^
src/libs/actions/IOU.js
Outdated
splitBill, | ||
splitBillAndOpenReport, | ||
payMoneyRequest, | ||
requestMoney, | ||
resetMoneyRequestInfo, | ||
sendMoneyElsewhere, | ||
sendMoneyViaPaypal, | ||
payMoneyRequest, | ||
sendMoneyWithWallet, | ||
startMoneyRequest, | ||
resetMoneyRequestInfo, | ||
setMoneyRequestId, | ||
setMoneyRequestAmount, | ||
setMoneyRequestCurrency, | ||
setMoneyRequestDescription, | ||
setMoneyRequestId, | ||
setMoneyRequestParticipants, | ||
splitBill, | ||
splitBillAndOpenReport, | ||
startMoneyRequest, |
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.
please keep original orders so I can see clearly what are removed and what are newly added
@@ -1,4 +1,4 @@ | |||
import React, {useCallback, useEffect, useRef, useMemo} from 'react'; | |||
import React, {useCallback, useEffect, useMemo, useRef} from 'react'; |
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.
Same ^
@lukemorawski please re-request review from me when ready. Thanks |
Code is looking great!! I still see a few places changes that weren't necessary (reordering the Also FYI @lukemorawski I'm going to remove |
@Beamanator hey, yeah no worries, remove the name 😃 |
Done! 😅 👍 |
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.
Looks good, minor feedback
@@ -103,6 +113,9 @@ function MoneyRequestConfirmationList(props) { | |||
// Prop functions pass props itself as a "this" value to the function which means they change every time props change. | |||
const {translate, onSendMoney, onConfirm, onSelectParticipant} = props; | |||
|
|||
// A flag and a toggler for showing the rest of the form fields | |||
const [showAllFields, toggleShowAllFields] = useReducer((state) => !state, false); |
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.
Why not useState
here?
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.
I like this approach as it exposes a bool flag and a toggle function in one line. With useState
you have declare a separate function to toggle the flag. Nice and clean.
src/languages/es.js
Outdated
@@ -148,6 +148,8 @@ export default { | |||
someone: 'Alguien', | |||
total: 'Total', | |||
edit: 'Editar', | |||
showMore: 'Mostrar más', | |||
merchant: 'comerciante', |
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.
Is this correct? Just asking because first letter is not capitalized like English
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.
Yep, should be capitalized.
Reviewer Checklist
Screenshots/VideosWebweb.movMobile Web - Chromemchrome.movMobile Web - Safarimsafari.movDesktopdesktop.moviOSios.mov |
Oof, @lukemorawski can you please fix the conflicts & respond to @situchan 's comments? Then @situchan can you please do a re-review after conflicts are fixed to make sure nothing's broken? Anything keeping us from getting this merged today, y'all?? |
…lds_to_manual_requests
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.
Re-tested latest code. Confirmed nothing broken
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.
Thanks so much gents, let's merge!
✋ 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/Beamanator in version: 1.3.50-0 🚀
|
@lukemorawski @shawnborton @Beamanator |
Yes @mvtglobally - sorry we missed that, but I tested in staging and it's working well! 👍 |
@Beamanator just to confirm, did this get deployed/we can close #295259 now? |
@dylanexpensify technically we can probably close the internal issue, BUT we won't close the App one yet since we have to pay out the C+ here once it's on prod for 7 days And also, this PR is only on staging for today, we're currently not planning to deploy today so won't get to prod till next week |
Ahh nice nice, ok let's leave open until at prod! TY! <3 |
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.50-3 🚀
|
🚀 Deployed to staging by https://github.com/Beamanator in version: 1.3.51-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
Details
We want to add new fields to the money request page - merchant and date.
Those new fields need to be hidden under the “Show more” button. Button disappears when the details are shown.
Values of those fields are taken from the “iou” object created when creating a new money request.
Fixed Issues
$ #23245
PROPOSAL:
We need to add a simple bool state flag to the MoneyRequestConfirmationList.js and a small button with horizontal line that will toggle this flag. The flag will control the visibility of two new MenuItemWithTopDescription components.
New props would need to be introduced to the MoneyRequestConfirmationList component - one for passing the date and the other to pass the merchant value.
Those props are passed from the MoneyRequestConfirmPage component, and are taken from an Onyx subscription to ‘iou’ object
In order get the new default values in the ‘iou’ object we need to add them to the object merged in resetMoneyRequestInfo function from IOU.js. Default value for merchant is an empty string and date is current date.
In future PRs those values will be editable.
desktop.chrome.mov
Tests
Open app
log in
click on the FAB + button on the main screen
select Request Money
fill out details and reach the Details screen
Verify that no errors appear in the JS console
Offline tests
QA Steps
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