Skip to content

feat(issue-views): Add save functionality#88985

Merged
malwilley merged 2 commits into
masterfrom
malwilley/feat/issue-view-save-data
Apr 8, 2025
Merged

feat(issue-views): Add save functionality#88985
malwilley merged 2 commits into
masterfrom
malwilley/feat/issue-view-save-data

Conversation

@malwilley

Copy link
Copy Markdown
Member

Depends on #88974

Adds save functionality to the save button.

@malwilley malwilley requested a review from a team as a code owner April 7, 2025 23:16
@malwilley malwilley requested a review from MichaelSun48 April 7, 2025 23:17
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 7, 2025
Comment on lines +43 to +63
setApiQueryData<GroupSearchView>(
queryClient,
makeFetchGroupSearchViewKey({orgSlug: organization.slug, id: parameters.id}),
data
);

// Update any matching starred views in cache
setApiQueryData<GroupSearchView[]>(
queryClient,
makeFetchGroupSearchViewsKey({orgSlug: organization.slug}),
oldGroupSearchViews => {
return (
oldGroupSearchViews?.map(view => {
if (view.id === parameters.id) {
return {...view, ...parameters};
}
return view;
}) ?? []
);
}
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it common to maintain two separate query caches for a multi-resource and single-resource endpoints? Is it possible to combine these two?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's quite common! React query conceptually has a cache for each endpoint, so there isn't a way to really combine them except by adding some sort of abstraction

Comment thread static/app/views/issueList/mutations/useUpdateGroupSearchView.tsx Outdated
@malwilley malwilley force-pushed the malwilley/feat/issue-view-save-data branch from 95fe8ae to d16d0dc Compare April 8, 2025 18:47
@malwilley malwilley changed the title feat(issue-views): Allow saving and discarding of unsaved changes feat(issue-views): Add save functionality Apr 8, 2025
@malwilley malwilley merged commit c26fb87 into master Apr 8, 2025
@malwilley malwilley deleted the malwilley/feat/issue-view-save-data branch April 8, 2025 20:55
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants