Saving, Saved or Failed
Series · Entities front-endEvery form in the app shows saving, saved or failed the same way, instead of each one re-inventing it. One small object carries the state, and one panel shows it.
Patterns, gotchas and small wins from fifteen-odd years of .NET and web work — the Regira packages and modules, entity pipelines, editorial front-ends and everything between.
Every form in the app shows saving, saved or failed the same way, instead of each one re-inventing it. One small object carries the state, and one panel shows it.
Keep an update from blanking a field the form never showed, such as a reference code, a close date or a total. What causes it, why every line involved passes review, and the one-line declaration that prevents it.
One place for each rule a save must obey, so it holds whether a user, an import or a nightly job did the saving. Required fields, timestamps and a code that never changes stop being scattered across controllers.
Show the flat list an API returns as a tree users can expand, select and drag to a new parent. No recursive component, and illegal drops are refused in the browser before they reach the server.
A quick look at turning a flat collection with parent references into a navigable hierarchy, without writing recursion yourself.
Answer who reported to whom on any past date from the data you already store, with no history tables and no migrations. One dated relationship table and a single filter do it; Westeros supplies three centuries of test data.
Edit forms where Cancel always works, a save shows what the server stored, a refused delete says so, and a deleted record can be brought back. Four decisions, in Vue.
A small tool that copies files between local disks, network shares and cloud storage, where a new copy job is a config entry, not new code. Built on one storage abstraction, so adding a backend is one small class.
One customer must never see another's rows, in any list, count or endpoint, including the one added next year. Seven requirements that make that a property of the system, and which of them no library can meet for you.
Let users ask for this or that, one brand or anything overdue, in a list that still pages and sorts like every other. How to offer 'or' without a flag nobody trusts.
Rules that must hold for every record, such as hiding deleted data or showing each customer only their own, set up once and applied everywhere. They also cover the endpoint added next year, and nobody skips them by accident.
A search box that finds 'Café' when someone types 'Cafe', and 'Mercedes-Benz' for 'mercedes', without extra work on every search. The trick: tidy the text once when it is saved, not each time someone searches.