Adds routeLeave check on ItemEditionPage to warn leaving when is 'auto-draft'. Removes console.log on tainacan-form-item.
This commit is contained in:
parent
3c805a5494
commit
3c27e36d9d
|
@ -603,10 +603,22 @@ export default {
|
|||
// Fetch current existing attachments
|
||||
this.fetchAttachments(this.itemId);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
beforeRouteLeave ( to, from, next ) {
|
||||
if (this.item.status == 'auto-draft') {
|
||||
this.$dialog.confirm({
|
||||
message: this.$i18n.get('info_warning_item_not_saved'),
|
||||
onConfirm: () => {
|
||||
next();
|
||||
},
|
||||
cancelText: this.$i18n.get('cancel'),
|
||||
confirmText: this.$i18n.get('continue'),
|
||||
type: 'is-secondary'
|
||||
});
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -223,6 +223,7 @@ return [
|
|||
'info_by' => __( 'By: ', 'tainacan' ),
|
||||
'info_date' => __( 'Date: ', 'tainacan' ),
|
||||
'info_not_saved' => __( 'Not saved ', 'tainacan' ),
|
||||
'info_warning_item_not_saved' => __( 'Are you sure? The item is not saved, changes will be lost.', 'tainacan' ),
|
||||
'info_warning_fields_not_saved' => __( 'Are you sure? There are fields not saved, changes will be lost.', 'tainacan' ),
|
||||
'info_warning_filters_not_saved' => __( 'Are you sure? There are filters not saved, changes will be lost.', 'tainacan' ),
|
||||
'info_no_description_provided' => __( 'No description provided.', 'tainacan' ),
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
this.setFieldTypeMessage('is-danger');
|
||||
for (let error of errors) {
|
||||
for (let index of Object.keys(error)) {
|
||||
this.$console.log(index);
|
||||
//this.$console.log(index);
|
||||
msg += error[index] + '\n';
|
||||
}
|
||||
}
|
||||
|
@ -133,6 +133,8 @@
|
|||
},
|
||||
setFieldTypeMessage( message ){
|
||||
this.fieldTypeMessage = message;
|
||||
//if (message != '')
|
||||
//this.isCollapsed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue