-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Added Workspace Menu #5921
Added Workspace Menu #5921
Conversation
…rkspace-popup-menu
Hi @chiragsalian, One major question is, I was trying to get the latest pull and it turns out I am not able to access this component. Did we change the flow? This is the sidebar I see on click. Does the component have to be moved to this one? |
@chiragsalian Were you able to check the questions in the previous comment ? |
Thanks @chiragsalian for the response. I'll do an update on the code and hopefully nothing major in terms of changes.
I couldn't find this in the current code. If it was added with the new n6-update, I'll have to check. Afaik, it isn't added. Hence, can you help me point to the code where delete is implemented or the API so that I can add the actions on the frontend. |
Ah yes good question. The endpoint for deleting the workspace is not implemented in App. But creating it should be easy since we have the endpoint. The API endpoint is called "Policy_Delete" and the argument it needs are Adding the delete method should be very similar to how we call Policy_Create like here. Let me know if that helps or if you have any questions around it 👍 |
…rkspace-popup-menu # Conflicts: # src/components/HeaderWithCloseButton.js # src/languages/en.js # src/languages/es.js # src/pages/workspace/WorkspaceInitialPage.js
@chiragsalian I've made updates to the PR and currently testing. Can you help with one last thing?
I am using the above code to unset the value for the policy. How do I delete a key from Onyx? |
So there is no way to delete a key from Onyx atm. We usually just set it to empty string or null just as you have.
Once you update that just make sure to test that setting it to null doesn't break anything else 🙂 |
…rkspace-popup-menu # Conflicts: # src/components/HeaderWithCloseButton.js # src/libs/actions/Policy.js # src/pages/workspace/WorkspaceInitialPage.js
Sorry for the delay. Last week i was really busy with other tasks and then i was on vacation for a few days. Now I'm back 100%. Looking into this. Hmm, the E2E test failure looks odd. As a first step, whenever there is an unusual GH Action test failure first re-run the test, and then update branch with main branch (you can do just the latter if you want since it will trigger travis test). Anyway i've re-run the job. Let's see if it fails at the same spot. I'll review the code in the meantime. Edit: Looks like rerunning GH actions for E2E tests didn't help. Can you try merging with main and see if that helps. |
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.
Tested the PR. I'm facing a few issues,
- The moment a new workspace is created the URL show the reportID i.e., http://localhost:8080/r/255 for me instead of the workspace policyID url i.e., http://localhost:8080/workspace/52E30B06BC2CE462 (the only way to get the correct URL is by closing the workspace menu and opening it again which is weird)
- Creating a new workspace ends up in a loop of tons of same network requests. Let me know if you notice the same as well.
@@ -0,0 +1,11 @@ | |||
import PropTypes from 'prop-types'; | |||
|
|||
|
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.
delete extra line break
onPress: PropTypes.func, | ||
})); | ||
|
||
|
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.
delete extra line break
onIconPress: () => {}, | ||
}; | ||
|
||
|
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.
a line break should just be 1 line break and not 2. Remove the extra line break.
</Pressable> | ||
|
||
{policy.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.
remove extra line break.
src/libs/actions/Policy.js
Outdated
* @param {Boolean} shouldAutomaticallyReroute | ||
* @returns {Promise} | ||
*/ | ||
function deletePolicy(policyID = '', shouldGrowl = true, shouldAutomaticallyReroute = true) { |
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.
Why is policyID optional? It shouldn't be since the backend needs a policyID to know what to 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.
I don't see shouldGrowl and shouldAutomaticallyReroute passed when we call this method. If that's the case let's not preoptimize here and remove these two params from the method call and just do the growl and reroute in the method. In future if there is a scenario to not show growl or reroute then we'll update as needed.
…rkspace-popup-menu # Conflicts: # src/pages/workspace/WorkspaceInitialPage.js # src/styles/styles.js
@chiragsalian: PR Updated with the changes. About the two issues:
|
@chiragsalian Any updates for me on this one? As I've mentioned earlier I'll resolve conflicts once all review is complete or when there are changes. I keep getting conflicts because I've updated the function component to class component. |
Sorry yes, I was out for Thanksgiving week. Checking this now. |
My guess is because earlier we use to show a large full screen modal and when we clicked new workspace there we wanted the modal to close. But we don't show that full-screen modal anymore so i'm pretty sure you are safe to remove it. Its usages are also only in two spots so it should be easy enough to confirm if everything runs fine.
Cool on investigation it looks like its not because of your PR and the issue lies elsewhere. |
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.
Changes LGTM. Feel free to address the conflicts and remove Navigation.dismissModal
(test it a bit too)
and then i can merge your PR 👍
…rkspace-popup-menu # Conflicts: # src/pages/workspace/WorkspaceInitialPage.js # src/styles/styles.js
@chiragsalian No problem. Thanks for the reviewing, PR 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.
LGTM and works well. Thank you for the changes.
✋ 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 @chiragsalian in version: 1.1.17-8 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.18-3 🚀
|
It was actually because when creating a new workspace via the
And the removal of the call to https://github.com/Expensify/Expensify/issues/188048 This was probably hard (maybe impossible) to see because the line from |
@marcaaron Then should I add a param to the function and add the |
No worries @mananjadhav we'll take care of it. |
Thanks, @marcaaron. Do let me know if any help is required. |
cc - @chiragsalian
Details
Fixed Issues
$ #5185
Tests
QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android