-
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
Create WorkspaceTagsSettingsPage #37755
Conversation
Assigning @mkhutornyi for review! |
Please resolve conflict |
@mkhutornyi Updated and resolved |
No Tests / QA Steps specified. Please also add platform screenshots |
@mkhutornyi Updated everything, also fixed fonts and bugs |
Looks like linked issues added by Carlos are overwritten. @waterim please link again like this:
Also, please add more test cases from those linked issues |
@mkhutornyi updated |
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 few comments
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, | ||
value: { | ||
requiresTag, | ||
errors: { |
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 think this should be errorFields
. errors
is just an object keyed by timestamp, so this wouldn't work as we have here. Same for the others below.
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.
errors are working, it shows an error, we have the same in categories
Maybe Im missing something
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'm seeing the following issues when simulating an error from the API:
- For enable/disable the error shows up in the LHN instead of the RHN under the toggle. Clearing the error also clears the entire policy
Screen.Recording.2024-03-08.at.3.14.18.PM.mov
- App crashes when simulating an error on the rename API:
Screen.Recording.2024-03-08.at.3.15.17.PM.mov
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 thread resolved?
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'm retesting this now
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.
No, this is still happening. I think we can continue with this and I'll address it in a fast following PR.
src/libs/actions/Policy.ts
Outdated
[newName]: {...oldPolicyTags, name: newName}, | ||
[oldName]: 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.
Hmm I think the correct pattern here is to have the old tagList pending as delete and the new one pending as add
[newName]: {...oldPolicyTags, name: newName}, | |
[oldName]: null, | |
[newName]: {...oldPolicyTags, name: newName, pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}, | |
[oldName]: | |
{pendingAction:CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}, |
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.
In addition, we'd have successData to remove the pendingActions and delete the old taglist
@mkhutornyi This one is already in development in moreFeatures PR |
ok given reported issues are planned to be fixed in next PRs, will go ahead checklist |
After enable tags, it takes super long to load tags list initially. Also, at the moment tags are loaded, Tags menu briefly disappears. Also disabled category is automatically enabled. This can be clearly reproduced after logout and re-login desktop.mov |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
@mkhutornyi I found that issue too and my PR will fix that - #38096. I based my PR on this branch so the commit history is a bit off now. |
ok let's get that PR merged asap |
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.
@waterim please note all the reported bugs in this PR and make sure to cover them in next PR
@luacmartins looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Tests were passing. Removing label. |
✋ 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: 1.4.51-0 🚀
|
This PR is failing because of issue #38188 The issue is reproducible in: All platforms Bug6411610_1710280159625.20240313_054753.1.mp4 |
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.51-3 🚀
|
color={theme.spinner} | ||
/> | ||
)} | ||
{tagList.length === 0 && !isLoading && ( |
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 line caused a bug later on. The deleted tags in offline mode had there state set as pending
.
@@ -2639,6 +2653,109 @@ function setWorkspaceRequiresCategory(policyID: string, requiresCategory: boolea | |||
API.write('SetWorkspaceRequiresCategory', parameters, onyxData); | |||
} | |||
|
|||
function setPolicyRequiresTag(policyID: string, requiresTag: boolean) { |
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.
Details
Create Tags Settings Page
Fixed Issues
$ #37310
$ #37848
$ #37873
Tests
Navigate to staging.new.expensify.com
Go to Workspace settings > Collect workspace
Select the "Tags" tab
Add some tags via classic app
Refresh the page to see the newly added tags
Offline tests
Same as tests
QA Steps
None
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
IOS
Android