-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance: repeat field enhancement #1389
base: develop
Are you sure you want to change the base?
Changes from all commits
424c535
220a52f
defb922
664ade7
feb7a3d
fc236ee
b4e6974
c2c080f
696eb91
87ec5f5
dccd63b
52c6aed
4152b57
f2eff98
c29da15
9e7fe7e
a48eda2
2627f56
d27d16b
d5492d9
d7678ac
3680861
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,15 +129,21 @@ | |
|
||
} | ||
|
||
// check if the editing field belong to a column field | ||
if (state.form_fields[i].template === 'column_field') { | ||
// check if the editing field belong to a column field or repeat field | ||
if (state.form_fields[i].template.match(/^(column|repeat)_field$/)) { | ||
var innerColumnFields = state.form_fields[i].inner_fields; | ||
|
||
for (const columnFields in innerColumnFields) { | ||
if (innerColumnFields.hasOwnProperty(columnFields)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use It's recommended to use Apply this diff to replace - if (innerColumnFields.hasOwnProperty(columnFields)) {
+ if (Object.hasOwn(innerColumnFields, columnFields)) { - if (payload.field_name === 'name' && ! innerColumnFields[columnFields][columnFieldIndex].hasOwnProperty('is_new') ) {
+ if (payload.field_name === 'name' && ! Object.hasOwn(innerColumnFields[columnFields][columnFieldIndex], 'is_new') ) { Also applies to: 142-142 ToolsBiome
|
||
var columnFieldIndex = 0; | ||
|
||
while (columnFieldIndex < innerColumnFields[columnFields].length) { | ||
// don't modify existing meta key | ||
if (payload.field_name === 'name' && ! innerColumnFields[columnFields][columnFieldIndex].hasOwnProperty('is_new') ) { | ||
columnFieldIndex++; | ||
continue; | ||
} | ||
|
||
if (innerColumnFields[columnFields][columnFieldIndex].id === parseInt(payload.editing_field_id)) { | ||
innerColumnFields[columnFields][columnFieldIndex][payload.field_name] = payload.value; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
Object.hasOwn()
instead ofhasOwnProperty
.It's recommended to use
Object.hasOwn()
for better reliability. See MDN web docs for more details.Apply this diff to replace
hasOwnProperty
withObject.hasOwn()
:Also applies to: 142-142
Tools
Biome