-
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
#26126: Tag menu item and Tag picker (1st PR) #26954
#26126: Tag menu item and Tag picker (1st PR) #26954
Conversation
@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] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-09-11.at.02.18.13.movMobile Web - SafariiOSScreen.Recording.2023-09-11.at.03.00.27.movAndroidScreen.Recording.2023-09-11.at.10.36.32.mov |
@rushatgabhane I made a commit containing the types and a correction to the recently used tags collection. It should not cause any difference in behaviour, since this is currently using mock data. This came from a review from #26501, which I'm also covering now. |
@BeeMargarida this is from the design doc. Would recently used tags be part of next PRs? |
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.
LGTM!
just left some non blocking comments
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.
More than 8 tags
When a policy has 8 or more tags, we'll render up to three sections, as well as show the text input for search.
@BeeMargarida as per the design doc,
- when we have more than 8 tags we should show search input.
- If a tag name is super long, it will continue onto a second line in the same OptionRow.
Is this in scope on this PR?
Will be implemented in the next PR, since it's the one that will contain sections in the tag picker component.
No, it will come in the next one. This one is only for the less than 8 tags. In the next one, I'll include the complete tag picker behaviour, including that super long behaviour. |
@rushatgabhane Update and ready for another review |
Updated! |
@puneetlath all you! |
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! A couple tiny comments.
@puneetlath Ready for a review |
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, but more conflicts 😢
Conflicts fixed! |
✋ 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/amyevans in version: 1.3.70-0 🚀
|
@@ -499,6 +520,16 @@ function MoneyRequestConfirmationList(props) { | |||
disabled={didConfirm || props.isReadOnly} | |||
/> | |||
)} | |||
{canUseTags && !!tagList && ( |
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 just noticed this line is incorrect, we should use !_.isEmpty(tagList)
instead of !!tagList
. @BeeMargarida can you add that change to your next PR?
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.
Yap!
🚀 Deployed to production by https://github.com/thienlnam in version: 1.3.70-8 🚀
|
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.
Good job. Looks solid!
// Fetches the first tag list of the policy | ||
const tagListKey = _.first(_.keys(policyTags)); | ||
const tagList = lodashGet(policyTags, tagListKey, {}); | ||
const tagListName = lodashGet(tagList, 'name', ''); |
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.
just a minor thing, but that way we could remove the OR
operator on line 70 :)
const tagListName = lodashGet(tagList, 'name', translate('common.tag'));
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.
Thank you, I applied this refactor in the PR I have opened!
shouldEnableMaxHeight | ||
> | ||
<HeaderWithBackButton | ||
title={tagListName || translate('common.tag')} |
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.
if the tagListName had a default of translate('common.tag') than
titleparam value could be just
tagListName`. See above
@@ -544,6 +546,7 @@ export default { | |||
`changed the ${valueName} to ${newValueToDisplay} (previously ${oldValueToDisplay})`, | |||
threadRequestReportName: ({formattedAmount, comment}: ThreadRequestReportNameParams) => `${formattedAmount} request${comment ? ` for ${comment}` : ''}`, | |||
threadSentMoneyReportName: ({formattedAmount, comment}: ThreadSentMoneyReportNameParams) => `${formattedAmount} sent${comment ? ` for ${comment}` : ''}`, | |||
tagSelection: ({tagName}: TagSelectionParams) => `Select a ${tagName} to add additional organization to your money`, |
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 don't think this copy was checked? It does not really read like a proper English sentence. We're going to create an issue to modify 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 the copy that was in the mocks in the design doc, but yeah I am not sure if it was run through marketing prior to landing in the mocks (I did not run it through after, that much I know 😅). I agree it's a bit awkward wording and could be improved.
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.
Fixed here: #38242
Details
This PR includes the tag menu item in a Money Request Confirmation as well as a way of choosing another tag. The picker is still on it's simpler form, the more complex form will come in the next PR.
This is using mock data with the setup mentioned in the collapsed section below. It does not change the IOU data, this will come in another PR.
Note: I added support for this working by creating the money request from the FAB menu. Let me know if the solution implemented is correct.
Mock data
MoneyRequestConfirmPage
add the following code to auseEffect(() => {...}, [])
:Fixed Issues
$ #26126
Tests
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
webs_t.mp4
webc_t.mp4
Mobile Web - Chrome
mchrome_t.mp4
Mobile Web - Safari
msafari_t.mp4
Desktop
desktop_t.mp4
iOS
ios_t.mp4
Android
android_t.mp4