diff --git a/packages/sanity/src/core/releases/components/dialog/ReleaseDetailsDialog.tsx b/packages/sanity/src/core/releases/components/dialog/CreateReleaseDialog.tsx similarity index 95% rename from packages/sanity/src/core/releases/components/dialog/ReleaseDetailsDialog.tsx rename to packages/sanity/src/core/releases/components/dialog/CreateReleaseDialog.tsx index 00de1ff895b..b4e384692ce 100644 --- a/packages/sanity/src/core/releases/components/dialog/ReleaseDetailsDialog.tsx +++ b/packages/sanity/src/core/releases/components/dialog/CreateReleaseDialog.tsx @@ -13,13 +13,13 @@ import {createReleaseId} from '../../util/createReleaseId' import {getBundleIdFromReleaseDocumentId} from '../../util/getBundleIdFromReleaseDocumentId' import {ReleaseForm} from './ReleaseForm' -interface ReleaseDetailsDialogProps { +interface CreateReleaseDialogProps { onCancel: () => void onSubmit: (createdReleaseId: string) => void origin?: OriginInfo['origin'] } -export function ReleaseDetailsDialog(props: ReleaseDetailsDialogProps): JSX.Element { +export function CreateReleaseDialog(props: CreateReleaseDialogProps): JSX.Element { const {onCancel, onSubmit, origin} = props const toast = useToast() const {createRelease} = useReleaseOperations() diff --git a/packages/sanity/src/core/releases/components/dialog/ReleaseForm.tsx b/packages/sanity/src/core/releases/components/dialog/ReleaseForm.tsx index abca6f5cde0..7f51e679760 100644 --- a/packages/sanity/src/core/releases/components/dialog/ReleaseForm.tsx +++ b/packages/sanity/src/core/releases/components/dialog/ReleaseForm.tsx @@ -10,7 +10,7 @@ import {DateTimeInput} from '../../../../ui-components/inputs/DateInputs/DateTim import {getCalendarLabels} from '../../../form/inputs/DateInputs/utils' import {useTranslation} from '../../../i18n' import {type EditableReleaseDocument, type ReleaseType} from '../../store/types' -import {ReleaseInputsForm} from './ReleaseInputsForm' +import {TitleDescriptionForm} from './TitleDescriptionForm' const RELEASE_TYPES: ReleaseType[] = ['asap', 'scheduled', 'undecided'] @@ -144,7 +144,7 @@ export function ReleaseForm(props: { )} - + ) } diff --git a/packages/sanity/src/core/releases/components/dialog/ReleaseInputsForm.tsx b/packages/sanity/src/core/releases/components/dialog/TitleDescriptionForm.tsx similarity index 99% rename from packages/sanity/src/core/releases/components/dialog/ReleaseInputsForm.tsx rename to packages/sanity/src/core/releases/components/dialog/TitleDescriptionForm.tsx index cbcd771ee84..470cbe2328a 100644 --- a/packages/sanity/src/core/releases/components/dialog/ReleaseInputsForm.tsx +++ b/packages/sanity/src/core/releases/components/dialog/TitleDescriptionForm.tsx @@ -82,7 +82,7 @@ const DescriptionTextArea = styled.textarea((props) => { ` }) -export function ReleaseInputsForm({ +export function TitleDescriptionForm({ release, onChange, }: { diff --git a/packages/sanity/src/core/releases/components/dialog/__tests__/ReleaseDetailsDialog.test.tsx b/packages/sanity/src/core/releases/components/dialog/__tests__/CreateReleaseDialog.test.tsx similarity index 90% rename from packages/sanity/src/core/releases/components/dialog/__tests__/ReleaseDetailsDialog.test.tsx rename to packages/sanity/src/core/releases/components/dialog/__tests__/CreateReleaseDialog.test.tsx index 628523d3564..f75f62209fb 100644 --- a/packages/sanity/src/core/releases/components/dialog/__tests__/ReleaseDetailsDialog.test.tsx +++ b/packages/sanity/src/core/releases/components/dialog/__tests__/CreateReleaseDialog.test.tsx @@ -5,7 +5,7 @@ import {createTestProvider} from '../../../../../../test/testUtils/TestProvider' import {type ReleaseDocument} from '../../../index' import {useReleaseOperations} from '../../../store/useReleaseOperations' import {useReleases} from '../../../store/useReleases' -import {ReleaseDetailsDialog} from '../ReleaseDetailsDialog' +import {CreateReleaseDialog} from '../CreateReleaseDialog' vi.mock('../../../store/useReleases', () => ({ useReleases: vi.fn(), @@ -27,7 +27,7 @@ vi.mock('../../../i18n/hooks/useTranslation', () => ({ const mockUseBundleStore = useReleases as Mock //const mockUseDateTimeFormat = useDateTimeFormat as Mock -describe('ReleaseDetailsDialog', () => { +describe('CreateReleaseDialog', () => { beforeEach(() => { vi.clearAllMocks() }) @@ -55,7 +55,7 @@ describe('ReleaseDetailsDialog', () => { //mockUseDateTimeFormat.mockReturnValue({format: vi.fn().mockReturnValue('Mocked date')}) const wrapper = await createTestProvider() - render(, {wrapper}) + render(, {wrapper}) }) afterEach(() => { vitest.resetAllMocks() @@ -74,7 +74,7 @@ describe('ReleaseDetailsDialog', () => { // TODO: Fix this test it.skip('should call createRelease and onCreate when form is submitted', async () => { // const wrapper = await createTestProvider() - // render(, {wrapper}) + // render(, {wrapper}) const value: Partial = { metadata: { diff --git a/packages/sanity/src/core/releases/components/documentHeader/VersionChip.tsx b/packages/sanity/src/core/releases/components/documentHeader/VersionChip.tsx index 0b104b3a97d..774f561bb85 100644 --- a/packages/sanity/src/core/releases/components/documentHeader/VersionChip.tsx +++ b/packages/sanity/src/core/releases/components/documentHeader/VersionChip.tsx @@ -19,7 +19,7 @@ import {getBundleIdFromReleaseDocumentId} from '../../util/getBundleIdFromReleas import {DiscardVersionDialog} from '../dialog/DiscardVersionDialog' import {ReleaseAvatar} from '../ReleaseAvatar' import {VersionContextMenu} from './contextMenu/VersionContextMenu' -import {CreateReleaseDialog} from './dialog/CreateReleaseDialog' +import {CopyToNewReleaseDialog} from './dialog/CopyToNewReleaseDialog' const Chip = styled(Button)` border-radius: 9999px !important; @@ -214,7 +214,7 @@ export const VersionChip = memo(function VersionChip(props: { )} {isCreateReleaseDialogOpen && ( - setIsCreateReleaseDialogOpen(false)} onCreateVersion={handleAddVersion} documentId={ diff --git a/packages/sanity/src/core/releases/components/documentHeader/dialog/CreateReleaseDialog.tsx b/packages/sanity/src/core/releases/components/documentHeader/dialog/CopyToNewReleaseDialog.tsx similarity index 98% rename from packages/sanity/src/core/releases/components/documentHeader/dialog/CreateReleaseDialog.tsx rename to packages/sanity/src/core/releases/components/documentHeader/dialog/CopyToNewReleaseDialog.tsx index 73e979aa60e..2798299014d 100644 --- a/packages/sanity/src/core/releases/components/documentHeader/dialog/CreateReleaseDialog.tsx +++ b/packages/sanity/src/core/releases/components/documentHeader/dialog/CopyToNewReleaseDialog.tsx @@ -15,7 +15,7 @@ import {createReleaseId} from '../../../util/createReleaseId' import {ReleaseForm} from '../../dialog/ReleaseForm' import {ReleaseAvatar} from '../../ReleaseAvatar' -export function CreateReleaseDialog(props: { +export function CopyToNewReleaseDialog(props: { onClose: () => void documentId: string documentType: string diff --git a/packages/sanity/src/core/releases/navbar/GlobalPerspectiveMenu.tsx b/packages/sanity/src/core/releases/navbar/GlobalPerspectiveMenu.tsx index 45dd93c7802..2e26abd8cc5 100644 --- a/packages/sanity/src/core/releases/navbar/GlobalPerspectiveMenu.tsx +++ b/packages/sanity/src/core/releases/navbar/GlobalPerspectiveMenu.tsx @@ -6,7 +6,7 @@ import {css, styled} from 'styled-components' import {MenuButton} from '../../../ui-components' import {useTranslation} from '../../i18n' -import {ReleaseDetailsDialog} from '../components/dialog/ReleaseDetailsDialog' +import {CreateReleaseDialog} from '../components/dialog/CreateReleaseDialog' import {usePerspective} from '../hooks' import {type ReleaseDocument, type ReleaseType} from '../store/types' import {useReleases} from '../store/useReleases' @@ -205,7 +205,7 @@ export function GlobalPerspectiveMenu(): JSX.Element { }} /> {createBundleDialogOpen && ( - + )} ) diff --git a/packages/sanity/src/core/releases/tool/detail/ReleaseDetailsEditor.tsx b/packages/sanity/src/core/releases/tool/detail/ReleaseDetailsEditor.tsx index d645b50f0e9..8b9760b77ad 100644 --- a/packages/sanity/src/core/releases/tool/detail/ReleaseDetailsEditor.tsx +++ b/packages/sanity/src/core/releases/tool/detail/ReleaseDetailsEditor.tsx @@ -1,6 +1,6 @@ import {useCallback, useState} from 'react' -import {ReleaseInputsForm} from '../../components/dialog/ReleaseInputsForm' +import {TitleDescriptionForm} from '../../components/dialog/TitleDescriptionForm' import {type EditableReleaseDocument, type ReleaseDocument, useReleaseOperations} from '../../index' export function ReleaseDetailsEditor({release}: {release: ReleaseDocument}): JSX.Element { @@ -21,5 +21,5 @@ export function ReleaseDetailsEditor({release}: {release: ReleaseDocument}): JSX [timer, updateRelease], ) - return + return } diff --git a/packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx b/packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx index 81f5a096654..0f95b50cf04 100644 --- a/packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx +++ b/packages/sanity/src/core/releases/tool/overview/ReleasesOverview.tsx @@ -14,7 +14,7 @@ import { } from '../../../../ui-components/inputs/DateFilters/calendar/CalendarFilter' import {useTranslation} from '../../../i18n' import useTimeZone from '../../../scheduledPublishing/hooks/useTimeZone' -import {ReleaseDetailsDialog} from '../../components/dialog/ReleaseDetailsDialog' +import {CreateReleaseDialog} from '../../components/dialog/CreateReleaseDialog' import {usePerspective} from '../../hooks/usePerspective' import {releasesLocaleNamespace} from '../../i18n' import {type ReleaseDocument, useReleases} from '../../index' @@ -280,7 +280,7 @@ export function ReleasesOverview() { if (!isCreateReleaseDialogOpen) return null return ( - setIsCreateReleaseDialogOpen(false)} onSubmit={handleOnCreateRelease} origin="release-plugin"