2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Move "attachments" and "notes" to "Part Detail" page

(cherry picked from commit daf0a082dc04c04cfd68cab70148a7d7cf28460f)
This commit is contained in:
Oliver
2021-07-12 23:27:11 +10:00
parent 6af05b2b83
commit 77d80f5c0f
3 changed files with 152 additions and 17 deletions

View File

@ -353,12 +353,16 @@ function constructFormBody(fields, options) {
// Override existing query filters (if provided!)
fields[field].filters = Object.assign(fields[field].filters || {}, field_options.filters);
// TODO: Refactor the following code with Object.assign (see above)
// Secondary modal options
fields[field].secondary = field_options.secondary;
// Edit callback
fields[field].onEdit = field_options.onEdit;
fields[field].multiline = field_options.multiline;
// Custom help_text
if (field_options.help_text) {
fields[field].help_text = field_options.help_text;
@ -1483,7 +1487,11 @@ function constructInputOptions(name, classes, type, parameters) {
opts.push(`placeholder='${parameters.placeholder}'`);
}
return `<input ${opts.join(' ')}>`;
if (parameters.multiline) {
return `<textarea ${opts.join(' ')}></textarea>`;
} else {
return `<input ${opts.join(' ')}>`;
}
}