Object.hasOwn & hasOwnProperty replace with lodash has (#367)

* Object.hasOwn & hasOwnProperty replace with lodash has

* fix _has
This commit is contained in:
Chirag Chhatrala
2024-04-03 15:19:33 +05:30
committed by GitHub
parent 615ac88f89
commit a7517252c1
13 changed files with 37 additions and 22 deletions

View File

@@ -70,6 +70,7 @@
import ConditionEditor from './ConditionEditor.client.vue'
import Modal from '../../../../global/Modal.vue'
import clonedeep from 'clone-deep'
import { default as _has } from 'lodash/has'
export default {
name: 'FormBlockLogicEditor',
@@ -100,7 +101,7 @@ export default {
computed: {
copyFromOptions () {
return this.form.properties.filter((field) => {
return field.id !== this.field.id && field.hasOwnProperty('logic') && field.logic !== null && field.logic !== {}
return field.id !== this.field.id && _has(field, 'logic') && field.logic !== null && field.logic !== {}
}).map((field) => {
return { name: field.name, value: field.id }
})
@@ -166,7 +167,7 @@ export default {
},
mounted () {
if (!this.field.hasOwnProperty('logic')) {
if (!_has(this.field, 'logic')) {
this.field.logic = this.logic
}
},