@@ -8,6 +8,7 @@ import { selectFields } from 'Reducers/collections';
8
8
import { status , EDITORIAL_WORKFLOW } from 'Constants/publishModes' ;
9
9
import { EditorialWorkflowError } from "ValueObjects/errors" ;
10
10
import { loadEntry } from './entries' ;
11
+ import ValidationErrorTypes from 'Constants/validationErrorTypes' ;
11
12
12
13
const { notifSend } = notifActions ;
13
14
@@ -261,9 +262,22 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) {
261
262
return async ( dispatch , getState ) => {
262
263
const state = getState ( ) ;
263
264
const entryDraft = state . entryDraft ;
265
+ const fieldsErrors = entryDraft . get ( 'fieldsErrors' ) ;
264
266
265
267
// Early return if draft contains validation errors
266
- if ( ! entryDraft . get ( 'fieldsErrors' ) . isEmpty ( ) ) return Promise . reject ( ) ;
268
+ if ( ! fieldsErrors . isEmpty ( ) ) {
269
+ const hasPresenceErrors = fieldsErrors
270
+ . some ( errors => errors . some ( error => error . type && error . type === ValidationErrorTypes . PRESENCE ) ) ;
271
+
272
+ if ( hasPresenceErrors ) {
273
+ dispatch ( notifSend ( {
274
+ message : 'Oops, you\'ve missed a required field. Please complete before saving.' ,
275
+ kind : 'danger' ,
276
+ dismissAfter : 8000 ,
277
+ } ) ) ;
278
+ }
279
+ return Promise . reject ( )
280
+ }
267
281
268
282
const backend = currentBackend ( state . config ) ;
269
283
const transactionID = uuid ( ) ;
@@ -289,7 +303,6 @@ export function persistUnpublishedEntry(collection, existingUnpublishedEntry) {
289
303
assetProxies . toJS ( ) ,
290
304
state . integrations ,
291
305
] ;
292
-
293
306
try {
294
307
const newSlug = await persistAction . call ( ...persistCallArgs ) ;
295
308
dispatch ( notifSend ( {
0 commit comments