Watch
0
0
Fork
You've already forked hyperhive
0

dashboard: drop the approvals queue

Y3R C4LL is the operator inbox alone: no P3NDING APPR0VALS section, no
approval cards or history, no approval_resolved subscription, no
approval browser notifications, and the tab count and title prefix count
unread operator messages only. The H0M3 tile text drops "approvals".

The deny form was the only data-prompt form, so bindAsyncForms' prompt
branch, themedPrompt and its dialog styles go too, along with the
approval-only CSS (.approval*, .approvals-history, .btn-deny, the
status/glyph colours and .history-note).
This commit is contained in:
atlas 2026-10-04 23:55:14 +02:00
commit ac1caef972
13 changed files with 32 additions and 584 deletions

View file

@ -47,11 +47,10 @@ export function asyncBtn(btn, fn) {
// successful submit unless the form opts out with `data-no-refresh` (forms
// whose mutation arrives faster via an SSE event).
//
// Confirmation (`data-confirm`) and free-text prompts (`data-prompt` /
// `data-prompt-field`) are surfaced via the themed dialogs in `modal.js`
// rather than native `confirm()`/`prompt()`, and errors via `themedToast`
// Confirmation (`data-confirm`) is surfaced via the themed dialog in
// `modal.js` rather than native `confirm()`, and errors via `themedToast`
// rather than `alert()`, so every page gets the same in-theme experience.
import { themedConfirm, themedPrompt, themedToast } from "./modal.js";
import { themedConfirm, themedToast } from "./modal.js";
export function bindAsyncForms(onSuccess) {
document.addEventListener("submit", async (e) => {
@ -64,21 +63,6 @@ export function bindAsyncForms(onSuccess) {
!(await themedConfirm({ message: f.dataset.confirm }))
)
return;
if (f.dataset.prompt) {
const ans = await themedPrompt({ message: f.dataset.prompt });
if (ans === null) return; // operator hit Cancel
// Drop into a hidden input named after `data-prompt-field` (or
// 'note' by default) so the value rides along on the POST.
const field = f.dataset.promptField || "note";
let input = f.querySelector(`input[name="${field}"]`);
if (!input) {
input = document.createElement("input");
input.type = "hidden";
input.name = field;
f.append(input);
}
input.value = ans;
}
const btn = f.querySelector(
'button[type="submit"], button:not([type]), .btn-inline',
);