Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/e2e/mobile-viewport.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ROUTES = [
{ path: '/calendar', ready: '.calendar-surface', content: '.calendar-grid', contentReady: '.calendar-grid', mockCalendar: true },
{ path: '/processes', ready: '.ops-surface-docs', content: '.ops-docs-catalog, .ops-docs-state, .ops-docs-state-detail' },
{ path: '/operating-model', ready: '.operating-model-surface', content: '.operating-model-surface strong, .operating-model-surface table, .operating-model-surface .status-text' },
{ path: '/admin', ready: '.ops-surface-admin', content: '.ops-admin-card, .ops-admin-intake-recovery' },
{ path: '/admin', ready: '.ops-surface-admin', content: '.ops-admin-card' },
{ path: '/users', ready: '.ops-surface-users', content: '.ops-users-outcome, .ops-users-toolbar, .ops-users-table' },
];

Expand Down
3 changes: 1 addition & 2 deletions frontend/src/styles/overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -494,8 +494,7 @@ body[data-workspace-view] .task-modal-panel button,
.invoice-fields select { width: 100%; }
.invoice-destinations { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--dk-space-4); padding: 0; list-style: none; }
.invoice-destinations li { border: 1px solid var(--dk-border-default); padding: var(--dk-space-4); overflow-wrap: anywhere; }
[data-invoice-detail] details,
[data-invoice-process] { margin: var(--dk-space-4) 0; }
[data-invoice-detail] details { margin: var(--dk-space-4) 0; }
[data-invoice-detail] fieldset { margin-top: var(--dk-space-4); }
[data-invoice-detail] small { display: block; }
.invoice-ledger-summary { margin: 0 0 var(--dk-space-2); color: var(--dk-text-muted); font-size: var(--dk-text-sm); }
Expand Down
39 changes: 0 additions & 39 deletions frontend/src/surfaces/finance/invoices.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,45 +232,6 @@ export function invoiceDetailMarkup(record, escapeHtml) {
</details>`;
}

// Developer recovery for the email-intake pipeline. It lives on the Admin
// surface, not on the bookkeeping page: operators closing a month should not
// meet an intake-ID reprocessor above their ledger (#242).
export function mountIntakeRecovery(host, context) {
const { request, workApiUrl } = context;
host.innerHTML = `<details class="intake-recovery">
<summary>Process a received intake</summary>
<form data-invoice-process>
<label>Received intake ID <input name="intakeItemId" required />
</label>
<button type="submit">Process / reprocess received intake</button>
</form>
<p aria-live="polite" data-recovery-status></p>
</details>`;
const status = host.querySelector("[data-recovery-status]");
const api = (options) =>
request(workApiUrl("/api/bookkeeping/invoices/process"), {
...options,
headers: { "content-type": "application/json" },
});
host
.querySelector("[data-invoice-process]")
.addEventListener("submit", async (event) => {
event.preventDefault();
const intakeItemId = new FormData(event.target).get("intakeItemId");
try {
const result = await api({
method: "POST",
body: JSON.stringify({ intakeItemId }),
});
status.textContent =
(result.issues || []).join("; ") ||
`${result.items?.length || 0} invoice draft(s) available for review on the Bookkeeping page. Ingestion does not verify fields or publish.`;
} catch (error) {
status.textContent = `Needs attention: ${error.message}`;
}
});
}

export async function mountInvoiceReview(host, context) {
const { request, workApiUrl, escapeHtml } = context;
const e = (value) => escapeHtml(String(value ?? ""));
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/surfaces/operations/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
reportFieldValidation,
setControlPending,
} from "../operations-overview.js";
import { mountIntakeRecovery } from "../finance/invoices.js";
import { describeOpenWork, openUserLifecycleDialog } from "./user-lifecycle-dialog.js";
import { personAvatar } from "../../core/identity.js";

Expand Down Expand Up @@ -63,13 +62,6 @@ export function createAdminSurface(context) {
// uppercase kicker over the title is the admin-template tell.
wrap.append(renderSurfaceHeader("Admin", surfaceDescription("admin")));
wrap.append(renderAdminSurface());
// The received-intake reprocessor is developer recovery tooling; it lives
// here, off the bookkeeping page it used to open (#242).
const intakeRecovery = document.createElement("section");
intakeRecovery.className = "ops-admin-intake-recovery";
intakeRecovery.setAttribute("aria-label", "Intake recovery");
wrap.append(intakeRecovery);
mountIntakeRecovery(intakeRecovery, context);

documentList.replaceChildren(wrap);
}
Expand Down
8 changes: 8 additions & 0 deletions frontend/test/operations-surface.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ describe("Operations surface boundary", () => {
},
});
harness.api.renderAdminSurfaceView([]);
assert.equal(
harness.documentList.querySelector(".ops-admin-intake-recovery"),
null,
);
assert.equal(
harness.documentList.querySelector("[data-invoice-process]"),
null,
);
const pendingDiagnostics = harness.documentList.querySelector(
".ops-admin-diagnostics",
);
Expand Down
Loading