DNS providers: show each provider's Description in the list #161
No files matched your search
@@ -25,6 +25,24 @@ describe('withExtraColumns', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('adds Description after the served columns on the DNS providers list', () => {
|
||||
const out = withExtraColumns(
|
||||
schema({
|
||||
'x:DnsServer': list([
|
||||
{ name: '@type', label: 'DNS server type' },
|
||||
{ name: 'ttl', label: 'TTL' },
|
||||
{ name: 'timeout', label: 'Timeout' },
|
||||
]),
|
||||
}),
|
||||
);
|
||||
expect(out.lists['x:DnsServer'].columns).toEqual([
|
||||
{ name: '@type', label: 'DNS server type' },
|
||||
{ name: 'ttl', label: 'TTL' },
|
||||
{ name: 'timeout', label: 'Timeout' },
|
||||
{ name: 'description', label: 'Description' },
|
||||
]);
|
||||
});
|
||||
|
||||
it('leaves a list that already has the column alone', () => {
|
||||
const served = schema({
|
||||
'x:Directory': list([
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
/**
|
||||
* inbuxa: columns a served list leaves out. The Directories list shows only
|
||||
* each directory's type, so two LDAP directories look the same until you
|
||||
* open them (admin #108).
|
||||
* open them (admin #108). DNS providers have the same problem.
|
||||
*/
|
||||
|
||||
import type { Column, Schema } from '@/types/schema';
|
||||
|
||||
const EXTRA_COLUMNS: Record<string, Column[]> = {
|
||||
'x:Directory': [{ name: 'description', label: 'Description' }],
|
||||
'x:DnsServer': [{ name: 'description', label: 'Description' }],
|
||||
};
|
||||
|
||||
/** The schema with the extra columns added after the served ones; applied once, when the schema loads. */
|
||||
|
||||
Reference in new issue
Block a user