Create control workspace if its a control feature#67465
Conversation
| return {successData, optimisticData, failureData, params}; | ||
| } | ||
|
|
||
| function createWorkspace( |
There was a problem hiding this comment.
i changed the code here from individual param to an object because of,
Error: 2260:1 error Function 'createWorkspace' has too many parameters (11). Maximum allowed is 10 @typescript-eslint/max-params
|
|
||
| features.forEach((feature) => { | ||
| // If the feature is not enabled by default and it's programmatically enabled, we need to enable it | ||
| if (!feature.enabledByDefault && feature.programmaticallyEnabled) { |
There was a problem hiding this comment.
I didnt have to change programmaticallyEnabled but i did cause personally i found it harder to read. Like i wasnt sure why its called "programmatically", when in reality it was enabled by the user. I just kept it as enabled so its easier to read.
|
@QichenZhu 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/VideosAndroid: HybridAppandroid-native.mp4Android: mWeb Chromeandroid-web.moviOS: HybridAppios-native.moviOS: mWeb Safariios-web.movMacOS: Chrome / Safarimac-web.movMacOS: Desktopmac-desktop.mov |
|
🎯 @QichenZhu, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #67630. |
|
✋ 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/lakchote in version: 9.1.89-1 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.1.89-21 🚀
|
Explanation of Change
Atm when a non control integration is chosen and a control feature is chosen we,
This is confusing for the user as they wonder why something was upgraded. This is not ideal for our code because it calls two API's for 1 action instead of just 1 i.e., it creates a workspace of type collect and then attempts to upgrade it.
Instead in this PR i pass the selected features to createWorkspace and if its a control feature we create a control workspace, so 1 API Call.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/530218
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop