* feat: autolabel fields when omitted * feat: handle autolabel in graphql mutation build * feat: autolabel blocks * test: add required slug field to blocks * feat: handle graphql names when label is false * feat: adds relationship field to test searchable input * feat: handle block cell type labeling pluralization * docs: remove all explicit labeling, no longer needed * fix: falsey column labels, allows false array labels * fix: client tests * fix: auto-labels globals * docs: globals auto-labeling and hooks clarification * fix; proper object type naming Co-authored-by: James <james@trbl.design>
62 lines
1.1 KiB
TypeScript
62 lines
1.1 KiB
TypeScript
import { PayloadCollectionConfig } from '../../src/collections/config/types';
|
|
|
|
const AutoLabel: PayloadCollectionConfig = {
|
|
slug: 'auto-label',
|
|
fields: [
|
|
{
|
|
name: 'autoLabelField',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'noLabel',
|
|
type: 'text',
|
|
label: false,
|
|
},
|
|
{
|
|
name: 'labelOverride',
|
|
type: 'text',
|
|
label: 'Custom Label',
|
|
},
|
|
{
|
|
name: 'specialBlock',
|
|
type: 'blocks',
|
|
minRows: 1,
|
|
maxRows: 20,
|
|
// Will auto-label
|
|
// labels: {
|
|
// singular: 'Special Block',
|
|
// plural: 'Special Blocks',
|
|
// },
|
|
blocks: [
|
|
{
|
|
slug: 'number',
|
|
// Will auto-label
|
|
// labels: {
|
|
// singular: 'Number',
|
|
// plural: 'Numbers',
|
|
// },
|
|
fields: [
|
|
{
|
|
name: 'testNumber',
|
|
type: 'number',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'noLabelArray',
|
|
type: 'array',
|
|
label: false,
|
|
fields: [
|
|
{
|
|
type: 'text',
|
|
name: 'textField',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
};
|
|
|
|
export default AutoLabel;
|