Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/components/renderer/file-upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ export default {
(loop, removed) => this.listenRemovedLoop(loop, removed));

this.removeDefaultClasses();

this.checkIfInRecordList();

this.setPrefix();
if (this.$refs['uploader']) {
Expand Down Expand Up @@ -288,15 +286,6 @@ export default {
this.prefix = parent.loopContext + '.';
}
},
setFileUploadNameForChildren(children, prefix) {
children.forEach(child => {
if (_.get(child, '$options.name') === 'FileUpload') {
child.prefix = prefix;
} else if (_.get(child, '$children', []).length > 0) {
this.setFileUploadNameForChildren(child.$children, prefix);
}
});
},
addFile(file) {
if (this.disabled) {
file.ignored = true;
Expand Down Expand Up @@ -420,14 +409,6 @@ export default {
: null;
}
},
checkIfInRecordList() {
const parent = this.parentRecordList(this);
if (parent !== null) {
const recordList = parent;
const prefix = recordList.name + '.';
this.setFileUploadNameForChildren(recordList.$children, prefix);
}
},
},
};
</script>
Expand Down
10 changes: 10 additions & 0 deletions src/components/renderer/form-record-list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
debug-context="Record List Add"
:key="Array.isArray(value) ? value.length : 0"
:_parent="validationData"
@update="updateRowDataNamePrefix"
/>
</b-modal>
<b-modal
Expand All @@ -112,6 +113,7 @@
debug-context="Record List Edit"
:_parent="validationData"
:key="editFormVersion"
@update="updateRowDataNamePrefix"
/>
</b-modal>
<b-modal
Expand Down Expand Up @@ -164,6 +166,7 @@ export default {
props: ['name', 'label', 'fields', 'value', 'editable', '_config', 'form', 'validationData', 'formConfig', 'formComputed', 'formWatchers'],
data() {
return {
currentRowIndex: null,
editFormVersion: 0,
single: '',
plural: '',
Expand Down Expand Up @@ -259,6 +262,9 @@ export default {
},
},
methods: {
updateRowDataNamePrefix() {
this.setUploadDataNamePrefix(this.currentRowIndex);
},
emitShownEvent() {
window.ProcessMaker.EventBus.$emit('modal-shown');
},
Expand All @@ -270,6 +276,7 @@ export default {
return field.key === '__filedownload';
},
setUploadDataNamePrefix(index = null) {
this.currentRowIndex = index;
let rowId = null;
if (index !== null && this.editItem) {
rowId = this.editItem.row_id;
Expand Down Expand Up @@ -451,6 +458,9 @@ export default {
this.$root.$emit('removed-record', this, recordData);
},
},
mounted() {
this.updateRowDataNamePrefix = _.debounce(this.updateRowDataNamePrefix, 100);
},
};
</script>

Expand Down
Loading