Skip to content
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

refactor(core): minor type usage improvement and using task plugin name #7453

Merged
merged 4 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ export function getReferenceInfo(
)

const value$ = combineLatest([draftPreview$, publishedPreview$]).pipe(
map(([draft, published]) => ({draft, published})),
map(([draft, published]) => ({
draft,
published,
})),
)

return value$.pipe(
Expand All @@ -144,7 +147,6 @@ export function getReferenceInfo(
pairAvailability.published.reason === 'PERMISSION_DENIED'
? PERMISSION_DENIED
: NOT_FOUND

return {
type: typeName,
id: publishedId,
Expand Down Expand Up @@ -201,7 +203,7 @@ export function referenceSearch(
})
return search(textTerm, {includeDrafts: true}).pipe(
map(({hits}) => hits.map(({hit}) => hit)),
map(collate),
map((docs) => collate(docs)),
// pick the 100 best matches
map((collated) => collated.slice(0, 100)),
mergeMap((collated) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function search(
isCrossDataset: true,
}).pipe(
map(({hits}) => hits.map(({hit}) => hit)),
map(collate),
map((docs) => collate(docs)),
map((collated) =>
collated.map((entry) => ({
id: entry.id,
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/tasks/plugin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const TASKS_NAME = 'sanity/tasks'
* @beta
*/
export const tasks = definePlugin({
name: 'sanity/tasks',
name: TASKS_NAME,
// eslint-disable-next-line camelcase
__internal_tasks: {
footerAction: <TasksFooterOpenTasks />,
Expand Down
Loading