diff --git a/src/Campaigns/Routes/RegisterCampaignRoutes.php b/src/Campaigns/Routes/RegisterCampaignRoutes.php index 9d7d9b71ec..1628e902db 100644 --- a/src/Campaigns/Routes/RegisterCampaignRoutes.php +++ b/src/Campaigns/Routes/RegisterCampaignRoutes.php @@ -260,7 +260,6 @@ public function getSchema(): array ], 'goalProgress' => [ 'type' => 'number', - 'readonly' => true, 'description' => esc_html__('Campaign goal progress', 'give'), ], 'goalType' => [ @@ -298,6 +297,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -319,6 +319,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -340,6 +341,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -361,6 +363,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -382,6 +385,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -403,6 +407,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ diff --git a/src/Campaigns/resources/admin/components/CampaignDetailsPage/index.tsx b/src/Campaigns/resources/admin/components/CampaignDetailsPage/index.tsx index e5ee45c5c9..7878f57b1b 100644 --- a/src/Campaigns/resources/admin/components/CampaignDetailsPage/index.tsx +++ b/src/Campaigns/resources/admin/components/CampaignDetailsPage/index.tsx @@ -1,6 +1,5 @@ import {__} from '@wordpress/i18n'; import {useEffect, useState} from '@wordpress/element'; -import {useEntityRecord} from '@wordpress/core-data'; import {useDispatch} from '@wordpress/data'; import apiFetch from '@wordpress/api-fetch'; import {JSONSchemaType} from 'ajv'; @@ -12,7 +11,7 @@ import {Spinner as GiveSpinner} from '@givewp/components'; import {Spinner} from '@wordpress/components'; import Tabs from './Tabs'; import ArchiveCampaignDialog from './Components/ArchiveCampaignDialog'; -import {ArrowReverse, BreadcrumbSeparatorIcon, DotsIcons, TrashIcon, TriangleIcon, ViewIcon} from '../Icons'; +import {ArrowReverse, BreadcrumbSeparatorIcon, DotsIcons, TrashIcon, ViewIcon} from '../Icons'; import ArchivedCampaignNotice from './Components/Notices/ArchivedCampaignNotice'; import NotificationPlaceholder from '../Notifications'; import cx from 'classnames'; @@ -83,7 +82,7 @@ export default function CampaignsDetailsPage({campaignId}) { } = useCampaignEntityRecord(); const methods = useForm({ - mode: 'onChange', + mode: 'onBlur', ...resolver, }); @@ -257,7 +256,10 @@ export default function CampaignsDetailsPage({campaignId}) { updateStatus('draft')} + onClick={() => { + updateStatus('draft'); + dispatch.dismissNotification('update-archive-notice'); + }} > {__('Move to draft', 'give')}