UAT/BA-Daily-Checklist.html

599 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BA Daily Checklist</title>
<style>
:root {
--bg: #f6f7fb;
--card: #ffffff;
--accent: #4a6cf7;
--accent-soft: #e8edff;
--text: #1f2430;
--muted: #7a8195;
--done: #2ecc71;
--border: #e3e6ef;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text);
display: flex;
justify-content: center;
padding: 40px 16px;
}
.container { width: 100%; max-width: 680px; }
header {
display: flex;
align-items: flex-end;
justify-content: space-between;
margin-bottom: 8px;
}
h1 { font-size: 24px; font-weight: 700; }
.date { color: var(--muted); font-size: 14px; margin-top: 4px; }
.progress-wrap {
height: 8px;
background: var(--border);
border-radius: 999px;
overflow: hidden;
margin: 16px 0 8px;
}
.progress-bar {
height: 100%;
width: 0%;
background: linear-gradient(90deg, var(--accent), #7c9bff);
border-radius: 999px;
transition: width .3s ease;
}
.progress-label { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.section {
background: var(--card);
border: 1px solid var(--border);
border-radius: 14px;
padding: 18px 20px;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(20, 30, 60, .05);
}
.section h2 {
font-size: 13px;
text-transform: uppercase;
letter-spacing: .08em;
color: var(--accent);
margin-bottom: 4px;
}
.section .hint {
font-size: 12.5px;
color: var(--muted);
margin-bottom: 10px;
}
label.item {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 9px 6px;
border-radius: 8px;
cursor: pointer;
font-size: 15px;
line-height: 1.4;
transition: background .15s;
}
label.item:hover { background: var(--accent-soft); }
label.item input {
appearance: none;
width: 20px; height: 20px;
min-width: 20px;
border: 2px solid #c4c9d9;
border-radius: 6px;
margin-top: 1px;
cursor: pointer;
display: grid;
place-content: center;
transition: all .15s;
}
label.item input:checked {
background: var(--done);
border-color: var(--done);
}
label.item input:checked::after {
content: "✓";
color: #fff;
font-size: 13px;
font-weight: 700;
}
label.item.checked span {
text-decoration: line-through;
color: var(--muted);
}
.free-item {
display: flex;
gap: 8px;
margin-top: 4px;
}
.free-item input {
flex: 1;
padding: 10px 12px;
border: 1px dashed #c4c9d9;
border-radius: 8px;
font-size: 14px;
font-family: inherit;
}
.free-item button {
padding: 10px 16px;
background: var(--accent);
color: #fff;
border: none;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
}
.free-item button:hover { background: #3a5be0; }
.free-list { margin-top: 10px; }
.free-item-row {
display: flex;
align-items: center;
gap: 8px;
}
.free-item-row .del {
background: none;
border: none;
color: #c4c9d9;
cursor: pointer;
font-size: 16px;
padding: 4px;
}
.free-item-row .del:hover { color: #e74c3c; }
footer {
text-align: center;
color: var(--muted);
font-size: 12px;
margin-top: 24px;
}
.reset-all {
background: none;
border: 1px solid var(--border);
color: var(--muted);
padding: 6px 14px;
border-radius: 8px;
font-size: 13px;
cursor: pointer;
}
.reset-all:hover { border-color: #e74c3c; color: #e74c3c; }
.celebrate {
text-align: center;
padding: 14px;
font-size: 15px;
color: var(--done);
font-weight: 600;
display: none;
}
.celebrate.show { display: block; }
.monday-badge {
display: inline-block;
background: #fff4e5;
color: #b0721f;
border: 1px solid #f0dcb8;
font-size: 11px;
font-weight: 600;
padding: 1px 8px;
border-radius: 999px;
margin-left: 6px;
vertical-align: 2px;
text-transform: none;
letter-spacing: 0;
}
.gantt-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.gantt-tools button {
padding: 7px 14px;
background: var(--accent);
color: #fff;
border: none;
border-radius: 8px;
font-size: 13px;
cursor: pointer;
}
.gantt-tools button:hover { background: #3a5be0; }
.gantt-tools button.secondary { background: none; color: var(--muted); border: 1px solid var(--border); }
.gantt-tools button.secondary:hover { color: #e74c3c; border-color: #e74c3c; background: none; }
.gantt-wrap { overflow-x: auto; }
table.gantt { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
table.gantt th, table.gantt td { border: 1px solid var(--border); padding: 0; height: 30px; }
table.gantt th.day { font-weight: 500; color: var(--muted); font-size: 11px; text-align: center; }
table.gantt th.weekend { background: #fafbff; }
table.gantt th.weekend-today { background: #ffe9a8; }
table.gantt td.task-name {
padding: 6px 10px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: 13px;
}
table.gantt td.cell { position: relative; background: #fff; }
table.gantt td.cell.weekend { background: #fafbff; }
.bar {
position: absolute;
top: 7px; bottom: 7px;
border-radius: 5px;
min-width: 4px;
}
.bar.planned { background: #4a6cf7; }
.bar.inprogress, .bar.in_progress, .bar.active, .bar.wip { background: #f5a623; }
.bar.done, .bar.completed, .bar.complete, .bar.closed { background: #2ecc71; }
.bar.blocked, .bar.at_risk, .bar.at-risk { background: #e74c3c; }
.bar.other { background: #9aa3c7; }
.today-col { box-shadow: inset 0 0 0 2px #f5a623 !important; }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.gantt-empty { color: var(--muted); font-size: 13.5px; padding: 14px 6px; line-height: 1.6; }
</style>
</head>
<body>
<div class="container">
<header>
<div>
<h1>📋 BA Daily Checklist</h1>
<div class="date" id="today"></div>
</div>
<button class="reset-all" onclick="resetDay()">Reset today</button>
</header>
<div class="progress-wrap"><div class="progress-bar" id="bar"></div></div>
<div class="progress-label" id="label">0 of 0 done</div>
<div class="celebrate" id="celebrate">🎉 All done — great work today!</div>
<div class="section">
<h2>☀️ Morning</h2>
<div class="hint">Start-of-day check. Monday tasks appear automatically.</div>
<div id="morning"></div>
</div>
<div class="section">
<h2>🌤️ Midday check</h2>
<div class="hint">Re-run the same checks. Already done in the morning and nothing new? Just check it off to skip.</div>
<div id="midday"></div>
</div>
<div class="section">
<h2>🌇 Afternoon check</h2>
<div class="hint">Final pass before end of day. Anything not needed today — check it off.</div>
<div id="afternoon"></div>
</div>
<div class="section">
<h2>🗺️ Roadmap / Gantt</h2>
<div class="gantt-tools">
<button onclick="document.getElementById('csvFile').click()">📁 Load / replace CSV</button>
<button class="secondary" onclick="clearRoadmap()">Remove roadmap</button>
<span id="ganttSource" style="font-size:12px;color:var(--muted)"></span>
<input type="file" id="csvFile" accept=".csv,.txt" style="display:none" onchange="loadCsvFile(this)">
</div>
<div id="ganttBody" class="gantt-empty">
No roadmap loaded yet.<br>
Click <b>📁 Load / replace CSV</b> and pick a CSV file. Expected columns (in this order, or with headers):
<b>task, start, end</b> and optionally <b>status</b> (planned / in progress / done / blocked) and <b>notes</b>.
Dates can be like <b>2025-03-10</b>, <b>3/10/2025</b>, or <b>Mar 10, 2025</b>.
</div>
<div class="legend" id="ganttLegend" style="display:none">
<span><i style="background:#4a6cf7"></i>Planned</span>
<span><i style="background:#f5a623"></i>In progress</span>
<span><i style="background:#2ecc71"></i>Done</span>
<span><i style="background:#e74c3c"></i>Blocked / at risk</span>
<span><i style="background:#9aa3c7"></i>Other</span>
<span style="margin-left:auto">▌ amber outline = today</span>
</div>
</div>
<div class="section">
<h2>Additional items</h2>
<div class="free-item">
<input type="text" id="freeInput" placeholder="Add your own item for today…"
onkeydown="if(event.key==='Enter') addFree()">
<button onclick="addFree()">Add</button>
</div>
<div class="free-list" id="freeList"></div>
</div>
<footer>Progress is saved locally in your browser and resets automatically each day.</footer>
</div>
<script>
const isMonday = new Date().getDay() === 1;
// Same core checks repeated each period. Each is its own checkbox,
// so you can tick "already done / not needed" at any later point.
const CORE = [
"Check approvals",
"Check defects",
"Check emails",
"Check what tickets I could prep for UAT"
];
const MORNING_EXTRA = [
"Add release notes export to SharePoint (Mon)",
"Update / submit the change request form (Mon)",
"Prep the change request for approval (Mon)"
];
const SECTIONS = {
morning: isMonday ? CORE.concat(MORNING_EXTRA) : CORE.slice(),
midday: CORE.slice(),
afternoon: CORE.slice()
};
const SECTIONS_IN_ORDER = ["morning", "midday", "afternoon"];
const todayKey = new Date().toISOString().slice(0, 10);
const storeKey = "ba-checklist-v3-" + todayKey;
const freeKey = "ba-free-v3-" + todayKey;
let state = JSON.parse(localStorage.getItem(storeKey) || "{}");
let free = JSON.parse(localStorage.getItem(freeKey) || "[]");
// ensure all items exist (supports new items added later)
for (const s of SECTIONS_IN_ORDER) {
state[s] = state[s] || [];
for (const item of SECTIONS[s]) {
if (!state[s].includes(item)) state[s].push(item);
}
// drop items that are no longer on the checklist (e.g. moved to Monday-only)
state[s] = state[s].filter(item => SECTIONS[s].includes(item));
if (state[s + "Done"]) {
state[s + "Done"] = Object.fromEntries(
Object.entries(state[s + "Done"]).filter(([k]) => SECTIONS[s].includes(k)));
}
}
function save() {
localStorage.setItem(storeKey, JSON.stringify(state));
localStorage.setItem(freeKey, JSON.stringify(free));
}
function render() {
for (const s of SECTIONS_IN_ORDER) {
const el = document.getElementById(s);
el.innerHTML = "";
for (const item of state[s]) {
const checked = !!(state[s + "Done"] && state[s + "Done"][item]);
const label = document.createElement("label");
label.className = "item" + (checked ? " checked" : "");
const cb = document.createElement("input");
cb.type = "checkbox";
cb.checked = checked;
cb.onchange = () => {
state[s + "Done"] = state[s + "Done"] || {};
state[s + "Done"][item] = cb.checked;
save(); render();
};
const span = document.createElement("span");
span.textContent = item;
if (isMonday && item.includes("(Mon)")) {
const b = document.createElement("span");
b.className = "monday-badge";
b.textContent = "Monday";
span.append(" ", b);
}
label.append(cb, span);
el.appendChild(label);
}
}
const fl = document.getElementById("freeList");
fl.innerHTML = "";
free.forEach((f, i) => {
const row = document.createElement("label");
row.className = "free-item-row item" + (f.done ? " checked" : "");
const cb = document.createElement("input");
cb.type = "checkbox";
cb.checked = f.done;
cb.onchange = () => { f.done = cb.checked; save(); render(); };
const span = document.createElement("span");
span.textContent = f.text;
const del = document.createElement("button");
del.className = "del";
del.textContent = "✕";
del.onclick = (e) => { e.preventDefault(); free.splice(i, 1); save(); render(); };
row.append(cb, span, del);
fl.appendChild(row);
});
const items = SECTIONS_IN_ORDER.flatMap(s => state[s])
.concat(free.map(f => f.text));
const total = items.length;
const done = SECTIONS_IN_ORDER.reduce(
(n, s) => n + state[s].filter(i => state[s+"Done"] && state[s+"Done"][i]).length, 0)
+ free.filter(f => f.done).length;
document.getElementById("bar").style.width = total ? (done/total*100) + "%" : "0%";
document.getElementById("label").textContent = done + " of " + total + " done";
document.getElementById("celebrate").classList.toggle("show", total > 0 && done === total);
}
const ROAD_KEY = "ba-roadmap";
let roadmap = JSON.parse(localStorage.getItem(ROAD_KEY) || "null");
function parseDate(s) {
s = String(s).trim();
if (!s) return null;
let m = s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
if (m) return new Date(+m[1], +m[2]-1, +m[3]);
m = s.match(/^(\d{1,2})[\/\-.](\d{1,2})[\/\-.](\d{2,4})/);
if (m) {
let y = +m[3]; if (y < 100) y += 2000;
return new Date(y, +m[1]-1, +m[2]);
}
const d = new Date(s);
return isNaN(d) ? null : d;
}
function parseCsv(text) {
const lines = text.split(/\r?\n/).filter(l => l.trim());
if (!lines.length) return null;
function splitLine(line) {
const out = []; let cur = ""; let q = false;
for (let i = 0; i < line.length; i++) {
const c = line[i];
if (q) {
if (c === '"' && line[i+1] === '"') { cur += '"'; i++; }
else if (c === '"') q = false;
else cur += c;
} else if (c === '"') q = true;
else if (c === ',') { out.push(cur.trim()); cur = ""; }
else cur += c;
}
out.push(cur.trim());
return out;
}
let rows = lines.map(splitLine);
let header = rows[0].map(h => h.toLowerCase());
const hasHeader = header.some(h => /task|name|project|start|end|status/i.test(h));
let cols = { task: 0, start: 1, end: 2, status: 3, notes: 4 };
if (hasHeader) {
cols.task = header.findIndex(h => /task|name|project|item|feature/.test(h));
cols.start = header.findIndex(h => /start|begin|from/.test(h));
cols.end = header.findIndex(h => /end|finish|due|target/.test(h));
cols.status = header.findIndex(h => /status|state|phase/.test(h));
cols.notes = header.findIndex(h => /note|comment|desc|owner/.test(h));
rows = rows.slice(1);
}
const items = [];
for (const r of rows) {
const name = r[cols.task]; if (!name) continue;
const start = parseDate(r[cols.start] || r[1]);
const end = parseDate(r[cols.end] || r[2]);
if (!start) continue;
items.push({
name,
start,
end: end || start,
status: cols.status >= 0 && r[cols.status] ? r[cols.status].toLowerCase() : "planned",
notes: cols.notes >= 0 && r[cols.notes] ? r[cols.notes] : ""
});
}
return items.length ? items : null;
}
function statusClass(s) {
if (/done|complet|closed|shipped|live/.test(s)) return "done";
if (/in.?progress|active|wip|started/.test(s)) return "inprogress";
if (/block|at.?risk|delay|paused/.test(s)) return "blocked";
if (/plan|scheduled|upcoming|new|backlog/.test(s)) return "planned";
return "other";
}
function renderGantt() {
const body = document.getElementById("ganttBody");
const legend = document.getElementById("ganttLegend");
const src = document.getElementById("ganttSource");
if (!roadmap) {
body.classList.add("gantt-empty");
body.innerHTML = "No roadmap loaded yet.<br>Click <b>📁 Load / replace CSV</b> and pick a CSV file.";
legend.style.display = "none";
src.textContent = "";
return;
}
body.classList.remove("gantt-empty");
legend.style.display = "flex";
src.textContent = roadmap.source || "";
const today = new Date(); today.setHours(0,0,0,0);
let min = roadmap.items.reduce((m, i) => i.start < m ? i.start : m, roadmap.items[0].start);
let max = roadmap.items.reduce((m, i) => i.end > m ? i.end : m, roadmap.items[0].end);
const start = new Date(min); start.setDate(start.getDate() - ((start.getDay()+6)%7));
const end = new Date(max); end.setDate(end.getDate() + 7);
const days = [];
for (let d = new Date(start); d <= end; d.setDate(d.getDate()+1)) days.push(new Date(d));
const fmt = d => d.toLocaleDateString(undefined, { month: "short", day: "numeric" });
let html = "<table class='gantt'><colgroup><col style='width:220px'>" +
days.map(() => "<col>").join("") + "</colgroup><tr><th></th>";
for (const d of days) {
const wk = d.getDay() === 0 || d.getDay() === 6;
const isToday = d.getTime() === today.getTime();
html += "<th class='day" + (wk ? " weekend" : "") + (isToday ? " weekend-today" : "") + "'>" +
(d.getDate() % 7 === 1 || isToday ? d.getDate() : "") + "</th>";
}
html += "</tr>";
for (const item of roadmap.items) {
const a = Math.max(0, Math.min(days.length-1, Math.round((item.start - start)/86400000)));
const b = Math.max(0, Math.min(days.length-1, Math.round((item.end - start)/86400000)));
html += "<tr><td class='task-name' title='" + item.name + (item.notes ? " — " + item.notes : "") + "'>" +
item.name + "</td>";
for (let i = 0; i < days.length; i++) {
const wk = days[i].getDay() === 0 || days[i].getDay() === 6;
const isToday = days[i].getTime() === today.getTime();
if (i >= a && i <= b) {
html += "<td class='cell" + (isToday ? " today-col" : "") + "'><div class='bar " + statusClass(item.status) + "' title='" +
item.name + " — " + item.status + " (" + fmt(item.start) + " → " + fmt(item.end) + "')"></div></td>";
} else {
html += "<td class='cell" + (wk ? " weekend" : "") + (isToday ? " today-col" : "") + "'></td>";
}
}
html += "</tr>";
}
html += "</table>";
body.innerHTML = "<div class='gantt-wrap'>" + html + "</div>";
}
function loadCsvFile(input) {
const file = input.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = () => {
const items = parseCsv(reader.result);
if (!items) { alert("Couldn't parse that CSV. Expected columns: task, start, end (and optionally status, notes)."); return; }
roadmap = { items, source: file.name };
localStorage.setItem(ROAD_KEY, JSON.stringify(roadmap));
renderGantt();
};
reader.readAsText(file);
input.value = "";
}
function clearRoadmap() {
if (!confirm("Remove the roadmap from the checklist?")) return;
roadmap = null;
localStorage.removeItem(ROAD_KEY);
renderGantt();
}
if (roadmap) {
for (const i of roadmap.items) {
i.start = new Date(i.start); i.end = new Date(i.end);
}
}
renderGantt();
function addFree() {
const input = document.getElementById("freeInput");
const text = input.value.trim();
if (!text) return;
free.push({ text, done: false });
input.value = "";
save(); render();
input.focus();
}
function resetDay() {
if (!confirm("Uncheck all items for today?")) return;
for (const s of SECTIONS_IN_ORDER) state[s + "Done"] = {};
free.forEach(f => f.done = false);
save(); render();
}
document.getElementById("today").textContent =
new Date().toLocaleDateString(undefined, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
// cleanup old days
for (const k of Object.keys(localStorage)) {
if (/^ba-(checklist|free)-v\d+-\d{4}-\d{2}-\d{2}$/.test(k) && !k.endsWith(todayKey)) {
localStorage.removeItem(k);
}
}
render();
</script>
</body>
</html>