diff --git a/src/Campaigns/Routes/RegisterCampaignRoutes.php b/src/Campaigns/Routes/RegisterCampaignRoutes.php index d6b5e0ad25..044e8a160a 100644 --- a/src/Campaigns/Routes/RegisterCampaignRoutes.php +++ b/src/Campaigns/Routes/RegisterCampaignRoutes.php @@ -221,7 +221,6 @@ public function getSchema(): array ], 'goalProgress' => [ 'type' => 'number', - 'readonly' => true, 'description' => esc_html__('Campaign goal progress', 'give'), ], 'goalType' => [ @@ -259,6 +258,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -280,6 +280,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -301,6 +302,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -322,6 +324,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -343,6 +346,7 @@ public function getSchema(): array 'properties' => [ 'goal' => [ 'minimum' => 1, + 'type' => 'number' ], ], 'errorMessage' => [ @@ -364,6 +368,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')}