fix(ui): stack audit content fields vertically and wrap long values
Test / test (push) Failing after 13m24s
Test / test (push) Failing after 13m24s
This commit is contained in:
1 parent
0c2e3561d6
commit
194dfc9644
3 files changed
+10
-9
No files matched your search
@@ -1089,7 +1089,10 @@ test.describe('core flow', () => {
|
||||
await expect(diff.getByRole('rowheader', { name: 'record_type', exact: true })).toHaveCount(0);
|
||||
const content = diff.locator('tr.diff-content-row');
|
||||
await expect(content.getByRole('rowheader', { name: 'content', exact: true })).toHaveCSS('white-space', 'nowrap');
|
||||
await expect(content.getByRole('group', { name: 'Before content' })).toHaveCSS('white-space', 'pre');
|
||||
const beforeContent = content.getByRole('group', { name: 'Before content' });
|
||||
await expect(beforeContent).toHaveCSS('white-space', 'pre-wrap');
|
||||
await expect(beforeContent).toHaveCSS('flex-direction', 'column');
|
||||
expect(await beforeContent.evaluate((el) => el.scrollWidth <= el.clientWidth)).toBe(true);
|
||||
await expect(content.locator('.diff-before').filter({ hasText: 'Refresh: 3600' })).toHaveText('− Refresh: 3600');
|
||||
await expect(content.locator('.diff-after').filter({ hasText: 'Refresh: 7200' })).toHaveText('+ Refresh: 7200');
|
||||
await expect(content.locator('.diff-after').filter({ hasText: 'Primary name server' })).toHaveCount(0);
|
||||
|
||||
+5
-7
@@ -527,21 +527,19 @@ input[type="radio"] {
|
||||
|
||||
.diff-content {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
overflow-x: auto;
|
||||
white-space: pre;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.25rem;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.diff-value {
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
overflow-wrap: anywhere;
|
||||
padding: 0 0.25rem;
|
||||
}
|
||||
|
||||
.diff-content .diff-value {
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.diff-before {
|
||||
background: var(--danger-bg);
|
||||
color: var(--danger);
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ function diffCell(row, side) {
|
||||
const labels = side === "before" ? row.beforeLabels : row.afterLabels;
|
||||
const parts = row.fields.filter((field) => field[side] !== undefined);
|
||||
return h("td", null,
|
||||
h("div", { class: "diff-content", tabindex: "0", role: "group", "aria-label": side === "before" ? "Before content" : "After content" },
|
||||
h("div", { class: "diff-content", role: "group", "aria-label": side === "before" ? "Before content" : "After content" },
|
||||
parts.length ? parts.map((field) => diffValue(field[side], field.kind, side, labels.get(field.path) ?? field.path)) : show(undefined)));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user