fix: renders presentational table columns
This commit is contained in:
@@ -9,6 +9,8 @@ import BeforeLogin from './components/BeforeLogin';
|
||||
import AfterNavLinks from './components/AfterNavLinks';
|
||||
import { slug, globalSlug } from './shared';
|
||||
import Logout from './components/Logout';
|
||||
import DemoUIFieldField from './components/DemoUIField/Field';
|
||||
import DemoUIFieldCell from './components/DemoUIField/Cell';
|
||||
|
||||
export interface Post {
|
||||
id: string;
|
||||
@@ -83,7 +85,7 @@ export default buildConfig({
|
||||
listSearchableFields: ['title', 'description', 'number'],
|
||||
group: { en: 'One', es: 'Una' },
|
||||
useAsTitle: 'title',
|
||||
defaultColumns: ['id', 'number', 'title', 'description'],
|
||||
defaultColumns: ['id', 'number', 'title', 'description', 'demoUIField'],
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -111,6 +113,17 @@ export default buildConfig({
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'ui',
|
||||
name: 'demoUIField',
|
||||
label: 'Demo UI Field',
|
||||
admin: {
|
||||
components: {
|
||||
Field: DemoUIFieldField,
|
||||
Cell: DemoUIFieldCell,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -409,6 +409,12 @@ describe('admin', () => {
|
||||
// ensure that the "number" column is still deselected
|
||||
await expect(await page.locator('[id^=list-drawer_1_] .list-controls .column-selector .column-selector__column').first()).not.toHaveClass('column-selector__column--active');
|
||||
});
|
||||
|
||||
test('should render custom table cell component', async () => {
|
||||
await createPost();
|
||||
await page.goto(url.list);
|
||||
await expect(await page.locator('table >> thead >> tr >> th >> text=Demo UI Field')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
describe('pagination', () => {
|
||||
|
||||
Reference in New Issue
Block a user