-
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
Fix client side tag violations and Improve function signatures #36821
Conversation
@cead22 Am I supposed to review this? This one seems to be a WIP. |
@allroundexperts no, or not yet at least, I assigned you and Yuwen as reviewers cause you had context on the deploy blocker. I could've just cc'ed you, but if you want to be the C+ to review this PR, that works |
We shouldn't let the user proceed with creating the request if the required fields are missing |
No that's not true, users should be able to create money requests without entering category and tag even if they're required. And for merchant, we already prevent it |
@cead22 So they are required in the term that they cannot be submitted? |
They can also be submitted, approved, and paid. They're used to highlight violations to users submitting the requests, and those approving them as well |
CategoryPicker is broken for me I will try to understand what is happening tomorrow. |
@rlinoz I'm pretty sure this is known and happening for the tags as well, which is being fixed here (for tags, not categories) https://github.com/Expensify/App/pull/36994/files |
For multi level tags still seeing RBR in the money request preview - Do you want to handle this in the follow up as well? Screen.Recording.2024-02-23.at.5.42.58.AM.mov |
For single tag, the tag selection works as expected but cannot test category due to other bugs |
@cead22 Can you please merge main and resolve the conflicts? |
@s77rt merged main
Yes |
if (policyTagKeys.length === 0) { | ||
newTransactionViolations.push({ | ||
name: CONST.VIOLATIONS.TAG_OUT_OF_POLICY, | ||
type: 'violation', | ||
}); | ||
} |
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.
Revert?
Co-authored-by: Abdelhafidh Belalia <[email protected]>
@s77rt I committed your suggestions |
@cead22 Can you also check #36821 (comment) |
Yeah that change was intentional. I created an issue to follow up to implement violations for multi level tags #37117 |
That removed condition is for empty tags list, does not seem related to the multi tags. |
Is there a specific case you're worried about not working? I tested again and things seem to work fine. There's a couple of non-obvious things at play here
So for the case where there is only 1 tag list, with no tags enabled, and the money request has a tag selected (that is disabled), we don't go into the I say public function requiresTag()
{
...
if (!$this->hasEnabledTags()) {
return false;
}
...
public function hasEnabledTags()
{
...
// If the policy has independent tags, ensure we check each tag list to see if there are any required tags
if ($this->hasIndependentTags()) {
return ArrayUtils::some($this->getTagListsArray(), function (array $tagList, int $i): bool {
$tagCollection = $this->getIndependentTags($i);
return $tagCollection->hasEnabledTags();
});
} |
@cead22 Thank you! That was helpful! |
@neil-marcellini 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] |
@neil-marcellini not sure why you were added here, but a review from either you or @rlinoz works for me :) |
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.
Code looks good and tests well, thanks!
Thank you! Scratch my previous request @neil-marcellini |
✋ 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/cead22 in version: 1.4.44-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
Malformed currency code
when testing (see slack thread in expensify-open-source), so I added a fix to this PRFixed Issues
$ #36889
Tests
Setup
Test
Offline tests
Same as test
QA Steps
Same as tests
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)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
Android: Native
androidnative.mp4
Android: mWeb Chrome
Note I'm still trying to figure out how to test this, and will rely on the reviewer checklist for this
iOS: Native
iosnative.mp4
iOS: mWeb Safari
RPReplay_Final1708627316.MP4
MacOS: Chrome / Safari
desktopbrowser.mp4
MacOS: Desktop
desktop.mp4