3
0

Update record toolbar restore logic and add it to all records

This commit is contained in:
Jože Fortun 2023-02-20 16:23:43 +01:00
parent eb570463df
commit ff44788e05
5 changed files with 9 additions and 14 deletions

View File

@ -196,11 +196,6 @@ export default {
default: () => false,
},
isDeleted: {
type: Boolean,
default: true,
},
showRecordModal: {
type: Boolean,
required: false,
@ -212,6 +207,10 @@ export default {
return this.record && this.record.recordID !== NoID
},
isDeleted () {
return this.record && this.record.deletedAt
},
settings () {
return this.$Settings.get('compose.ui.record-toolbar', {})
},

View File

@ -36,13 +36,10 @@ export default {
/**
* Tells if given record is deleted; If record not provided, returns undefined
* @returns {Boolean|undefined}
* @returns {Boolean}
*/
isDeleted () {
if (!this.record) {
return
}
return !!this.record.deletedAt
return this.record && this.record.deletedAt
},
},

View File

@ -122,6 +122,7 @@ export default {
perPage: 14,
fullPageNavigation: true,
showTotalCount: true,
showDeletedRecordsOption: true,
presort: 'createdAt DESC',
// Set allrecords configuration
allRecords: true,

View File

@ -76,12 +76,13 @@
:processing="processing"
:processing-submit="processingSubmit"
:processing-delete="processingDelete"
:is-deleted="isDeleted"
:processing-undelete="processingUndelete"
:in-editing="inEditing"
@add="handleAdd()"
@clone="handleClone()"
@edit="handleEdit()"
@delete="handleDelete()"
@undelete="handleUndelete()"
@back="handleBack()"
@submit="handleFormSubmitSimple('admin.modules.record.view')"
/>

View File

@ -36,10 +36,7 @@
:processing-submit="processingSubmit"
:processing-delete="processingDelete"
:processing-undelete="processingUndelete"
:is-deleted="isDeleted"
:in-editing="inEditing"
:hide-clone="inCreating"
:hide-add="inCreating"
:show-record-modal="showRecordModal"
@add="handleAdd()"
@clone="handleClone()"