-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Org settings partial updates improvements #20626
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
Org settings partial updates improvements #20626
Conversation
Tool: gitpod/catfood.gitpod.cloud fix for getting settings (also resolve avatar) Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
The hack was introduced in #20620 - Update welcome message configuration to handle optional enabled field - Simplify welcome message update logic in various components - Modify protobuf definitions to make enabled field optional - Remove redundant checks and simplify type handling in converters and components Tool: gitpod/catfood.gitpod.cloud
3334f6d
to
8b563ec
Compare
@@ -27,13 +28,12 @@ export type SuggestedOrgRepository = PlainMessage<SuggestedRepository> & { | |||
|
|||
export function useOrgSuggestedRepos() { | |||
const organizationId = useCurrentOrg().data?.id; | |||
const orgSettings = useOrgSettingsQuery(); |
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.
🧡
Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
invalidateWorkspaceClasses(); | ||
invalidateOrgRepoSuggestions(); | ||
|
||
if (settings) { | ||
queryClient.setQueryData(getQueryKey(organizationId), settings); |
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.
this set's the query's data to not have to re-fetch data we have available to us. We do the same with updating Configurations
@@ -26,7 +26,7 @@ export const OrgMemberAvatarInput = ({ settings, setFeaturedMemberId }: Props) = | |||
const handleSelectionChange = useCallback( | |||
(selectedId: string) => { | |||
const member = members?.find((m) => m.userId === selectedId); | |||
setFeaturedMemberId(selectedId || undefined); | |||
setFeaturedMemberId(selectedId); |
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.
This change was necessary to force the default value and not just make an empty 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.
Code LGTM! 🙏
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.
✔️ again
f36f3a1
into
gpl/org-settings-refresh
Tool: gitpod/catfood.gitpod.cloud
Tool: gitpod/catfood.gitpod.cloud
* [api, server, dashboard] Cleanup UpdateOrganizationSettings API Tool: gitpod/catfood.gitpod.cloud * Org settings partial updates improvements (#20626) Tool: gitpod/catfood.gitpod.cloud * review comment Tool: gitpod/catfood.gitpod.cloud
Description
This PR contains the following fixes on top of #20603:
resolveWelcomeMessage
fnThe existing caveat that this doesn't tackle (and that I realized just now) is that when you delete your user account, the featured member won't be un-set. This is fine for now though, since nothing breaks, just the avatar shows an empty image.
How to test
https://ft-gpl-org7e7f3fc03d.preview.gitpod-dev.com/settings/onboarding
/hold