Added a dialog with each opportunity's details and releases

Every row has a details icon under the Find a Tender link. It opens a
dialog with the opportunity's details from the list, and fetches the
opportunity with its releases, shown as tabs, newest first. Each tab
summarises the release's tender, awards and contracts, links to its
Find a Tender notice where it is one, and has the release's JSON,
pretty-printed and highlighted, in a section laid out only when it's
opened.

The JSON is highlighted by splitting it into tokens shown as text, not
HTML, as releases come from outside sources. The README's saved
preferences now include the filters.
This commit is contained in:
bwilliams committed 2026-10-19 10:37:27 +01:00
1 parent 6fbf7e56b2
commit f8648d765a
12 files changed
+847 -10

No files matched your search

+21 -1
View File
@@ -1,6 +1,13 @@
import { expect, test } from 'vitest';
import { formatCount, formatDate, formatMoney, parseDate } from './format';
import {
formatCount,
formatDate,
formatDateTime,
formatMoney,
formatValue,
parseDate,
} from './format';
test.each([
{ name: 'null', value: null },
@@ -31,3 +38,16 @@ test('formatCount groups thousands', () => {
expect(formatCount(4854)).toBe('4,854');
expect(formatCount(7)).toBe('7');
});
test('formatValue shows the amount in its currency', () => {
expect(formatValue(1200.5, 'EUR')).toBe('€1,201');
expect(formatValue(250000, 'GBP')).toBe('£250,000');
expect(formatValue(250000, '')).toBe('£250,000');
expect(formatValue(1500, 'not a code')).toBe('1,500 not a code');
expect(formatValue(0, 'EUR')).toBe('—');
});
test('formatDateTime shows the UK time', () => {
expect(formatDateTime('2026-10-15T09:05:26Z')).toBe('15 Oct 2026, 10:05');
expect(formatDateTime(null)).toBe('—');
});