-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat(organizations): hide organization fields from settings for mmo organizations - TASK-978 #5280
base: main
Are you sure you want to change the base?
Conversation
@@ -21,6 +22,8 @@ import type { | |||
AccountFieldsErrors, | |||
} from './account.constants'; | |||
import {HELP_ARTICLE_ANON_SUBMISSIONS_URL} from 'js/constants'; | |||
import {keys} from 'mobx'; |
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.
Did this get added on accident? Looks unused.
'email' in currentAccount | ||
sessionStore.isPending || | ||
!sessionStore.isInitialLoadComplete || | ||
!('email' in currentAccount) || |
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.
Since we're touching this section, I have to ask: Do we need these session store readiness checks? My impression is we could just use 'email' in currentAccount
(which I suspect is our way of making sure the store has a real user and not an anonymous user stub).
@pauloamorimbr This isn't an issue with your code, but I am concerned about the way we are submitting the PATCH request in this form. It looks to me like we are basically just always sending the data for every form field. It's a PATCH request but we're essentially treating it like a PUT. This gets uglier as a result of the changes we are making here: Now we are submitting the org detail fields even though we aren't displaying them. At the very least, I believe we need to stop submitting org data this way. If it didn't take too long, I would say it would be better if we only submitted data for "dirty" form fields (ones that have been edited by the user). But if that second goal is going to take too long perhaps we can ignore that for the moment. Can you spend 20 minutes or so to determine what the best approach is here? |
634da71
to
aa22083
Compare
After the refactors in #5303 and #5290, I'm back here. Now this behaves the proper way, like you commented, sending only the edited fields to the PATCH call, thus not sending organization data when the organization is MMO since the fields are not visible for editing. |
🗒️ Checklist
<type>(<scope>)<!>: <title> TASK-1234
frontend
orbackend
unless it's global📣 Summary
Organization fields are not displayed anymore in setting screens for MMOs.
👀 Preview steps
Feature/no-change template:
/#/account/settings
?ff_mmoEnabled=true
?ff_mmoEnabled=false
💭 Notes
The 'organization', 'organization_type' and 'organization_website' are now being hidden when the current organization has the
is_mmo
flag.