JS linting

This commit is contained in:
Oliver 2021-10-05 11:02:57 +11:00
parent e7d78db87b
commit 7ecd4c70e7
2 changed files with 14 additions and 21 deletions

View File

@ -4,7 +4,6 @@
/* globals /* globals
buildStatusDisplay, buildStatusDisplay,
constructForm, constructForm,
getFieldByName,
global_settings, global_settings,
imageHoverIcon, imageHoverIcon,
inventreeGet, inventreeGet,
@ -397,7 +396,7 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
var row = $(table).bootstrapTable('getRowByUniqueId', pk); var row = $(table).bootstrapTable('getRowByUniqueId', pk);
if (!row) { if (!row) {
console.log("WARNING: getRowByUniqueId returned null"); console.log('WARNING: getRowByUniqueId returned null');
return; return;
} }
@ -834,12 +833,6 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) {
// ID of the associated "build output" (or null) // ID of the associated "build output" (or null)
var output_id = options.output || null; var output_id = options.output || null;
var query_params = {
part: part_id,
sub_part_detail: true,
sub_part_trackable: output_id != null
};
var source_location = options.source_location; var source_location = options.source_location;
function renderBomItemRow(bom_item, quantity) { function renderBomItemRow(bom_item, quantity) {
@ -915,7 +908,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) {
return html; return html;
} }
var table_entries = ""; var table_entries = '';
for (var idx = 0; idx < bom_items.length; idx++) { for (var idx = 0; idx < bom_items.length; idx++) {
var bom_item = bom_items[idx]; var bom_item = bom_items[idx];
@ -1045,7 +1038,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) {
// Add callback to "clear" button for take_from field // Add callback to "clear" button for take_from field
addClearCallback( addClearCallback(
"take_from", 'take_from',
take_from_field, take_from_field,
options, options,
); );
@ -1098,7 +1091,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) {
// Provide nested values // Provide nested values
opts.nested = { opts.nested = {
"items": item_pk_values 'items': item_pk_values
}; };
inventreePut( inventreePut(

View File

@ -905,7 +905,7 @@ function handleNestedErrors(errors, field_name, options) {
return; return;
} }
var nest_list = nest_list = options["nested"][field_name]; var nest_list = nest_list = options['nested'][field_name];
// Nest list must be provided! // Nest list must be provided!
if (!nest_list) { if (!nest_list) {
@ -996,7 +996,7 @@ function handleFormErrors(errors, fields, options) {
var field = fields[field_name]; var field = fields[field_name];
if ((field.type == "field") && ("child" in field)) { if ((field.type == 'field') && ('child' in field)) {
// This is a "nested" field // This is a "nested" field
handleNestedErrors(errors, field_name, options); handleNestedErrors(errors, field_name, options);
} else { } else {
@ -1348,7 +1348,7 @@ function initializeRelatedField(field, fields, options) {
query.limit = pageSize; query.limit = pageSize;
// Allow custom run-time filter augmentation // Allow custom run-time filter augmentation
if ("adjustFilters" in field) { if ('adjustFilters' in field) {
query = field.adjustFilters(query); query = field.adjustFilters(query);
} }