lint: fix linter warnings (log exceptions, disable attribute-string-redundant, suppress C901 where necessary)

This commit is contained in:
snt 2026-05-20 12:58:21 +02:00 committed by GitHub Copilot
parent f8ef927a9e
commit a997331c2d
11 changed files with 595 additions and 20 deletions

View file

@ -180,9 +180,44 @@
}
}
// If backend provided a human-readable pickup slot label,
// display it to the user or update a dedicated element if present.
if (data.pickup_slot_label) {
var slotLabel = data.pickup_slot_label;
var slotElement = document.getElementById("pickup-slot-label");
if (slotElement) {
slotElement.textContent = slotLabel;
console.log(
"Auto-loaded pickup_slot_label into element:",
slotLabel
);
} else {
// Gentle info notification so user sees the pickup info
self._showNotification("Pickup: " + slotLabel, "info", 3000);
}
}
// Update display
self._updateCartDisplay();
// Show pickup slot label if provided by backend
if (data.pickup_slot_label) {
var slotEl = document.getElementById("pickup-slot-label");
if (slotEl) {
slotEl.textContent = data.pickup_slot_label;
console.log(
"Restored pickup_slot_label into element:",
data.pickup_slot_label
);
} else {
self._showNotification(
"Pickup: " + data.pickup_slot_label,
"info",
3000
);
}
}
console.log("Auto-loaded " + items.length + " items from draft");
// Show a subtle notification
var labels = self._getLabels();
@ -222,6 +257,7 @@
var pickupDayKey = "load_from_history_pickup_day_" + this.orderId;
var pickupDateKey = "load_from_history_pickup_date_" + this.orderId;
var homeDeliveryKey = "load_from_history_home_delivery_" + this.orderId;
var pickupSlotLabelKey = "load_from_history_pickup_slot_label_" + this.orderId;
var warningKey = "load_from_history_warning_" + this.orderId;
var itemsJson = sessionStorage.getItem(storageKey);
@ -229,6 +265,7 @@
var pickupDay = sessionStorage.getItem(pickupDayKey);
var pickupDate = sessionStorage.getItem(pickupDateKey);
var homeDelivery = sessionStorage.getItem(homeDeliveryKey) === "true";
var pickupSlotLabel = sessionStorage.getItem(pickupSlotLabelKey);
var warningMessage = sessionStorage.getItem(warningKey);
console.log("DEBUG: _loadFromHistory called for orderId:", this.orderId);
@ -352,6 +389,14 @@
if (orderName) {
message += " - " + orderName;
}
if (pickupSlotLabel) {
message +=
" — " +
(self.labels && self.labels.pickup_label
? self.labels.pickup_label + ": "
: "Pickup: ") +
pickupSlotLabel;
}
this._showNotification(message, "success", 3000);
// Show warning if some products were unavailable
@ -366,6 +411,7 @@
sessionStorage.removeItem(pickupDayKey);
sessionStorage.removeItem(pickupDateKey);
sessionStorage.removeItem(homeDeliveryKey);
sessionStorage.removeItem(pickupSlotLabelKey);
sessionStorage.removeItem(warningKey);
} catch (e) {
console.error("Error loading from history:", e);