Skip to content

Commit 7872562

Browse files
authored
fix(web-frontend): Show unnamed row label in row history instead of (baserow#5467)
empty boxes
1 parent cd0b5f8 commit 7872562

3 files changed

Lines changed: 79 additions & 2 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Show unnamed row label in row history instead of empty boxes",
4+
"issue_origin": "github",
5+
"issue_number": 3674,
6+
"domain": "database",
7+
"bullet_points": [],
8+
"created_at": "2026-06-04"
9+
}

web-frontend/modules/database/components/row/RowHistoryFieldLinkRow.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ export default {
5959
},
6060
methods: {
6161
rowName(id) {
62-
return this.entry.fields_metadata[this.fieldIdentifier].linked_rows[id]
63-
?.value
62+
const value =
63+
this.entry.fields_metadata[this.fieldIdentifier].linked_rows[id]?.value
64+
return (
65+
value ||
66+
this.$t('functionnalGridViewFieldLinkRow.unnamed', { value: id })
67+
)
6468
},
6569
},
6670
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { TestApp } from '@baserow/test/helpers/testApp'
2+
import RowHistoryFieldLinkRow from '@baserow/modules/database/components/row/RowHistoryFieldLinkRow'
3+
4+
describe('RowHistoryFieldLinkRow', () => {
5+
let testApp = null
6+
7+
beforeEach(() => {
8+
testApp = new TestApp()
9+
})
10+
11+
afterEach(() => {
12+
testApp.afterEach()
13+
})
14+
15+
const mountComponent = (entry) => {
16+
return testApp.mount(RowHistoryFieldLinkRow, {
17+
propsData: {
18+
entry,
19+
fieldIdentifier: 'field_1',
20+
},
21+
})
22+
}
23+
24+
const buildEntry = (linkedRows) => ({
25+
before: { field_1: [] },
26+
after: { field_1: Object.keys(linkedRows).map((id) => Number(id)) },
27+
fields_metadata: {
28+
field_1: {
29+
linked_rows: linkedRows,
30+
},
31+
},
32+
})
33+
34+
test('renders the primary value when present', async () => {
35+
const wrapper = await mountComponent(
36+
buildEntry({
37+
42: { value: 'Hello world' },
38+
})
39+
)
40+
expect(wrapper.text()).toContain('Hello world')
41+
})
42+
43+
test('falls back to the unnamed-row label when value is empty', async () => {
44+
const wrapper = await mountComponent(
45+
buildEntry({
46+
42: { value: '' },
47+
})
48+
)
49+
// The repo-wide i18n mock returns the key unchanged, so we assert on the
50+
// key path rather than on the rendered English string.
51+
expect(wrapper.text()).toContain('functionnalGridViewFieldLinkRow.unnamed')
52+
})
53+
54+
test('falls back when the linked row metadata is missing entirely', async () => {
55+
// The diff references row 42 but the metadata dict has no entry for it.
56+
const entry = {
57+
before: { field_1: [] },
58+
after: { field_1: [42] },
59+
fields_metadata: { field_1: { linked_rows: {} } },
60+
}
61+
const wrapper = await mountComponent(entry)
62+
expect(wrapper.text()).toContain('functionnalGridViewFieldLinkRow.unnamed')
63+
})
64+
})

0 commit comments

Comments
 (0)