Added a "Hide all visible" button
It hides the opportunities the filters show that aren't hidden already, after asking for confirmation with their count. Those the filters leave out keep their marks, so clearing the filters shows them as before. The backend has no bulk route, so each opportunity is hidden with its own request. The rows go at once; every mark change is now saved at most six at a time (lib/concurrency.ts), so hundreds of requests aren't sent together. Any that fail are shown again, with one toast for them all.
This commit is contained in:
1 parent
b1cc9745ba
commit
b8244da2e5
7 files changed
+205
-10
No files matched your search
@@ -14,6 +14,8 @@ const moneyFormat = new Intl.NumberFormat('en-GB', {
|
||||
maximumFractionDigits: 0,
|
||||
});
|
||||
|
||||
const countFormat = new Intl.NumberFormat('en-GB');
|
||||
|
||||
/** Treats null and Go's zero time.Time as "no date". */
|
||||
export function parseDate(value: DateTimeString | null | undefined): Date | null {
|
||||
if (!value || value.startsWith(ZERO_TIME_PREFIX)) return null;
|
||||
@@ -31,3 +33,8 @@ export function formatDate(value: DateTimeString | null | undefined): string {
|
||||
export function formatMoney(value: number): string {
|
||||
return value > 0 ? moneyFormat.format(value) : '—';
|
||||
}
|
||||
|
||||
/** A count for display, e.g. "4,854". */
|
||||
export function formatCount(value: number): string {
|
||||
return countFormat.format(value);
|
||||
}
|
||||
Reference in new issue
Block a user