Form improvements

This commit is contained in:
Oliver 2022-02-15 13:33:32 +11:00
parent 2b344f1f25
commit 35c9b6838e
2 changed files with 8 additions and 3 deletions

View File

@ -202,7 +202,9 @@ function createBuildOutput(build_id, options) {
required: options.trackable_parts || trackable,
},
batch_code: {},
auto_allocate: {},
auto_allocate: {
hidden: !trackable,
},
};
// Work out the next available serial numbers

View File

@ -2014,7 +2014,7 @@ function constructField(name, parameters, options) {
if (parameters.help_text && !options.hideLabels) {
// Boolean values are handled differently!
if (parameters.type != 'boolean') {
if (parameters.type != 'boolean' && !parameters.hidden) {
html += constructHelpText(name, parameters, options);
}
}
@ -2022,7 +2022,6 @@ function constructField(name, parameters, options) {
// Div for error messages
html += `<div id='errors-${field_name}'></div>`;
html += `</div>`; // controls
html += `</div>`; // form-group
@ -2212,6 +2211,10 @@ function constructInputOptions(name, classes, type, parameters, options={}) {
return `<textarea ${opts.join(' ')}></textarea>`;
} else if (parameters.type == 'boolean') {
if (parameters.hidden) {
return '';
}
var help_text = '';
if (!options.hideLabels && parameters.help_text) {