m3 Security Fixes

This commit is contained in:
Mark Gregory
2026-09-16 17:14:26 +01:00
parent 1602bdd72e
commit d68687f062
78 changed files with 1297 additions and 1228 deletions
@@ -214,7 +214,7 @@
if (isDisabled) {
$('#TOREPORTDATEDIV').hide();
// toMonthPicker.input.style.backgroundColor = '#e9ecef';
// toMonthPicker.input.style.backgroundColor = '#e9ecef';
// toMonthPicker.input.style.cursor = 'not-allowed';
// Set fromMonthPicker to today
@@ -374,14 +374,14 @@
// Calculate hue variations based on period type
let salesHue = HUE_BLUE;
let weightHue = HUE_GREEN;
// Adjust hue for quarters only
if (period.startsWith("Q")) {
const quarterNum = parseInt(period.substring(1));
salesHue = HUE_BLUE + (quarterNum - 1) * 15;
weightHue = HUE_GREEN + (quarterNum - 1) * 15;
}
// For monthly periods (odd/even), use slight variations
if (period === "odd") {
salesHue = HUE_BLUE + 5;
@@ -390,19 +390,19 @@
salesHue = HUE_BLUE + 20;
weightHue = HUE_GREEN + 20;
}
// Create color maps for each WHS within this period
salesColorMap[period] = {};
weightColorMap[period] = {};
linesColorMap[period] = {};
// Generate different shades for each WHS - darker to lighter
whsArray.forEach((whs, whsIndex) => {
// Vary lightness by WHS - start darker (25%) and get lighter
// Reverse the WHS index calculation to go from dark to light
const reversedIndex = whsArray.length - 1 - whsIndex;
const lightness = 45 + (reversedIndex % 8) * 6;
// Assign colors for each metric
salesColorMap[period][whs] = `hsl(${salesHue}, 85%, ${lightness}%)`;
weightColorMap[period][whs] = `hsl(${weightHue}, 85%, ${lightness}%)`;
@@ -413,7 +413,7 @@
// Function to get the appropriate color based on time period, metric, and WHS
function getDatasetColor(yearLabel, metric, whs) {
const period = getTimePeriod(yearLabel);
if (metric === "Sales") {
return salesColorMap[period]?.[whs] || `hsl(${HUE_BLUE}, 85%, 50%)`;
} else if (metric === "Weight") {
@@ -421,7 +421,7 @@
} else if (metric === "Lines") {
return linesColorMap[period]?.[whs] || `hsl(${HUE_GREY}, 0%, 50%)`;
}
return "rgba(200, 200, 200, 0.6)"; // Default fallback
}
@@ -510,7 +510,7 @@
});
//// Trigger Click on init
//// Trigger Click on init
$("#updateCharts").trigger("click");
});