-
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: separate pending fields in workspace general settings #47312
fix: separate pending fields in workspace general settings #47312
Conversation
@DylanDylann 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] |
src/libs/actions/Policy/Policy.ts
Outdated
@@ -1074,6 +1077,7 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s | |||
pendingFields: { | |||
...policy.pendingFields, | |||
generalSettings: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE, |
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 update generalSettings to workspaceName or policyName
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.
we also update generalSettings in other places. Let's create a new workspace offline, you will see that currency and address aren't greyed out
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.
@DylanDylann I think we also need to update the errorFields
. And maybe a BE change is needed to return the correct errorFields
if it's returning generalSettings
error field when we update the WS name failure
And maybe a BE change is needed to return the correct
errorFields
if it's returninggeneralSettings
error field when we update the WS name failure
cc @aldo-expensify Can you please let me know my concern above? Everything works well if BE returns nothing when we update the WS name failure because we also generate the error in FE. If not, we need a BE change to return the correct errorFields
.
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 see generalSettings
in the backend, so I think the backend is not creating this error ever. Did you see it happening?
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.
@dominictb Is this ready for review? I still see this bug
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.
@DylanDylann couldn't reproduce your issue. Can you try to fetch the latest commit?
@@ -1555,7 +1555,7 @@ type Policy = OnyxCommon.OnyxValueWithOfflineFeedback< | |||
/** Workspace account ID configured for Expensify Card */ | |||
workspaceAccountID?: number; | |||
} & Partial<PendingJoinRequestPolicy>, | |||
'generalSettings' | 'addWorkspaceRoom' | 'employeeList' | keyof ACHAccount | keyof Attributes | |||
'addWorkspaceRoom' | 'employeeList' | keyof ACHAccount | keyof Attributes |
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.
Should we add name, outputCurrency, address 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.
@DylanDylann we don't need as name
, outputCurrency
and address
is part of the Policy
type
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.
Ahh see 😄
@dominictb Some minor comments |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-21.at.16.06.48.movAndroid: mWeb ChromeScreen.Recording.2024-08-21.at.15.58.15.moviOS: NativeScreen.Recording.2024-08-21.at.16.08.24.moviOS: mWeb SafariScreen.Recording.2024-08-21.at.16.00.27.movMacOS: Chrome / SafariScreen.Recording.2024-08-21.at.15.56.11.movMacOS: DesktopScreen.Recording.2024-08-21.at.15.58.54.mov |
src/libs/actions/Policy/Policy.ts
Outdated
@@ -1038,6 +1038,9 @@ function updateGeneralSettings(policyID: string, name: string, currencyValue?: s | |||
const customUnitID = distanceUnit?.customUnitID; | |||
const currency = currencyValue ?? policy?.outputCurrency ?? CONST.CURRENCY.USD; | |||
|
|||
const currencyPendingAction = currency !== policy?.outputCurrency ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : null; | |||
const namePendingAction = name !== policy?.name ? CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE : 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.
- Go offline
- Change name
- Change the currency
--> Both the name and the currency should be greyed out
In this case, the pendingFields.name is overwritten with null
value. We can use undefined to avoid overwriting
Screen.Recording.2024-08-21.at.16.00.27.mov
updated! |
✋ 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/aldo-expensify in version: 9.0.25-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.0.25-0 🚀
|
Details
Fixed Issues
$ #46997
PROPOSAL: #46997 (comment)
Tests
Verify that: Only workspace name is grey out. Currency field shouldn't be grey out when changing the workspace name
Offline tests
QA Steps
Verify that: Only workspace name is grey out. Currency field shouldn't be grey out when changing the workspace name
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
compressed_android.webm.mp4
Android: mWeb Chrome
compressed_aweb.webm.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
compressed_iosweb.mp4.mp4
MacOS: Chrome / Safari
compressed_web2.mov.mp4
MacOS: Desktop
compressed_web2.mov.mp4