diff --git a/packages/sanity/src/core/bundles/components/dialog/BundleForm.tsx b/packages/sanity/src/core/bundles/components/dialog/BundleForm.tsx index fd73e49ce115..ec37c2874f73 100644 --- a/packages/sanity/src/core/bundles/components/dialog/BundleForm.tsx +++ b/packages/sanity/src/core/bundles/components/dialog/BundleForm.tsx @@ -10,7 +10,7 @@ import {DatePicker} from '../../../form/inputs/DateInputs/base/DatePicker' import {getCalendarLabels} from '../../../form/inputs/DateInputs/utils' import {type BundleDocument} from '../../../store/bundles/types' import {isDraftOrPublished} from '../../util/dummyGetters' -import {BundleIconEditorPicker} from './BundleIconEditorPicker' +import {BundleIconEditorPicker, type BundleIconEditorPickerValue} from './BundleIconEditorPicker' export function BundleForm(props: { onChange: (params: Partial) => void @@ -34,7 +34,7 @@ export function BundleForm(props: { const {t: coreT} = useTranslation() const calendarLabels: CalendarLabels = useMemo(() => getCalendarLabels(coreT), [coreT]) - const iconValue: Partial = useMemo( + const iconValue: BundleIconEditorPickerValue = useMemo( () => ({ icon: icon ?? 'cube', hue: hue ?? 'gray', @@ -98,7 +98,7 @@ export function BundleForm(props: { ) const handleIconValueChange = useCallback( - (pickedIcon: Partial) => { + (pickedIcon: BundleIconEditorPickerValue) => { onChange({...value, icon: pickedIcon.icon, hue: pickedIcon.hue}) }, [onChange, value], diff --git a/packages/sanity/src/core/bundles/components/dialog/BundleIconEditorPicker.tsx b/packages/sanity/src/core/bundles/components/dialog/BundleIconEditorPicker.tsx index 503b9276b693..9c44beb66a05 100644 --- a/packages/sanity/src/core/bundles/components/dialog/BundleIconEditorPicker.tsx +++ b/packages/sanity/src/core/bundles/components/dialog/BundleIconEditorPicker.tsx @@ -15,12 +15,14 @@ const IconPickerFlex = styled(Flex)` max-width: 269px; ` +export interface BundleIconEditorPickerValue { + hue: BundleDocument['hue'] + icon: BundleDocument['icon'] +} + export function BundleIconEditorPicker(props: { - onChange: (value: {hue: BundleDocument['hue']; icon: BundleDocument['icon']}) => void - value: { - hue: BundleDocument['hue'] - icon: BundleDocument['icon'] - } + onChange: (value: BundleIconEditorPickerValue) => void + value: BundleIconEditorPickerValue }): JSX.Element { const {onChange, value} = props diff --git a/packages/sanity/src/core/releases/tool/detail/ReleaseDetail.tsx b/packages/sanity/src/core/releases/tool/detail/ReleaseDetail.tsx index 8fdfe89569b6..2dc9c98531b0 100644 --- a/packages/sanity/src/core/releases/tool/detail/ReleaseDetail.tsx +++ b/packages/sanity/src/core/releases/tool/detail/ReleaseDetail.tsx @@ -17,7 +17,7 @@ type Screen = 'overview' | 'review' const useFetchBundleDocuments = (bundleName: string) => { const client = useClient({apiVersion: API_VERSION}) - const query = `*[defined(_version) && _id match "${bundleName}*"]` + const query = `*[defined(_version) && _id in path("${bundleName}.*")]` return useListener({query, client}) } diff --git a/packages/sanity/src/core/releases/tool/detail/ReleaseOverview.tsx b/packages/sanity/src/core/releases/tool/detail/ReleaseOverview.tsx index 785c9f3d57cc..f8b2c14fba85 100644 --- a/packages/sanity/src/core/releases/tool/detail/ReleaseOverview.tsx +++ b/packages/sanity/src/core/releases/tool/detail/ReleaseOverview.tsx @@ -3,7 +3,10 @@ import {type SanityDocument} from '@sanity/types' import {AvatarStack, Card, Flex, Heading, Stack, Text, useToast} from '@sanity/ui' import {useCallback, useState} from 'react' -import {BundleIconEditorPicker} from '../../../bundles/components/dialog/BundleIconEditorPicker' +import { + BundleIconEditorPicker, + type BundleIconEditorPickerValue, +} from '../../../bundles/components/dialog/BundleIconEditorPicker' import {RelativeTime} from '../../../components/RelativeTime' import {UserAvatar} from '../../../components/userAvatar/UserAvatar' import {type BundleDocument} from '../../../store/bundles/types' @@ -18,10 +21,7 @@ export function ReleaseOverview(props: {documents: SanityDocument[]; release: Bu * This state is created here but will be updated by the DocumentRow component when fetching the history */ const [collaborators, setCollaborators] = useState([]) - const [iconValue, setIconValue] = useState<{ - hue: BundleDocument['hue'] - icon: BundleDocument['icon'] - }>({ + const [iconValue, setIconValue] = useState({ hue: release.hue ?? 'gray', icon: release.icon ?? 'documents', })