-
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
Add a modal screen for creating a new workspace #3547
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
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.
Looks really great, I don't have too many critiques (only NABs). Nice job! :)
/> | ||
</> | ||
)} | ||
</AttachmentPicker> |
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.
NAB, this might be a case where we can convert this pattern into a slightly more complex component. But we can perhaps wait until it is used a third time? Just something I thought about since we have mostly the same UI pattern used in the ProfilePage.js
} | ||
|
||
NewWorkspacePage.propTypes = propTypes; | ||
NewWorkspacePage.displayName = 'NewWorkspacePage'; |
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.
NAB, class components do not require this displayName
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.
True!
* @param {Function} openPicker | ||
* @returns {Array} | ||
*/ | ||
createMenuItems(openPicker) { |
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.
NAB, these options really only need to be updated if the translation theme changes, but I don't think it's worth optimizing for so this function 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.
I left the function because we'll need it when we connect this with the backend, and we need to decide whether to show the Delete Image
item or not based on the state.
} | ||
|
||
render() { | ||
const {translate} = this.props; |
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.
NAB, IIRC we have some kind of specific advice on when to destructure something in the style guide. but generally prefer explicit use of this.props
when there is a mix of props and state to avoid confusion about which things come from where. That said, t's quite easy to see what's happening here so I won't block.
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.
Done!
Oh yes just remembered something. Technically this should be behind a beta... so we'll need to block access for now. Here's a strategy I used to achieve this that you can copy. |
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.
Great update! Works well in my browser. i will not merge it now as Marc has mentioned the beta access.
@marcaaron That works! However, I found this error caused by the It's definitely related to that call being a side effect, and side effects inside the render function are illegal. We can solve that error by creating a utility component to dismiss modals in a declarative way, like this: if (!Permissions.canUseFreePlan(this.props.betas)) {
console.debug('Not showing new bank account page because user is not on free plan beta');
return <Navigation.DismissModal />;
} I went ahead and added the change to this PR in a separate commit. Let me know what you think. |
if (!Permissions.canUseFreePlan(this.props.betas)) { | ||
console.debug('Not showing new workspace page because user is not on free plan beta'); | ||
return <Navigation.DismissModal />; | ||
} |
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.
Good call! Let's then not forget to refactor the rest of the app to use this.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
onSelected: () => { | ||
openPicker({ | ||
onPicked: () => { | ||
// TODO: connect with setWorkspaceAvatar function |
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.
@HorusGoul are you up for creating a follow up issue to track the changes we need to make to "complete" this?
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.
Sure!
🚀 Deployed to staging in version: 1.0.68-5🚀
|
@HorusGoul I'm unable to access the link https://staging.expensify.cash/workspace/new (even with a expensifail account) is there any permissions needed to be able to see the page? |
I can't access the page in staging either. @marcaaron, do we have enabled the free plan beta in staging/prod for our accounts? |
Hmm I don't think there is any difference between betas on staging vs. production. Something else might be happening here. I checked my However, pn both production and staging I was able to see that the Here's where that list is pulled from |
🚀 Deployed to production in version: 1.0.73-3🚀
|
Details
Adds a new modal screen for creating workspaces (UI only this is not connected to the backend yet). Only accessible through the web with the path
/workspace/new
for now.Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/166035
Tests
QA Steps
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android