Refinements & Preview Defaults (#167)
* No need for set width for base Card anymore * entries are not required * Redirect from Dashboard to first collection if publish mode is simple * collection inference: Add more synonyms to description * Implemented a better default preview for editing entries * Add label field in default preview for small text values * Added margin for default preview
This commit is contained in:
45
src/constants/fieldInference.js
Normal file
45
src/constants/fieldInference.js
Normal file
@ -0,0 +1,45 @@
|
||||
import React from 'react';
|
||||
|
||||
/* eslint-disable */
|
||||
export const INFERABLE_FIELDS = {
|
||||
title: {
|
||||
type: 'string',
|
||||
secondaryTypes: [],
|
||||
synonyms: ['title', 'name', 'label', 'headline'],
|
||||
defaultPreview: value => <h1>{ value }</h1>,
|
||||
fallbackToFirstField: true,
|
||||
showError: true,
|
||||
},
|
||||
shortTitle: {
|
||||
type: 'string',
|
||||
secondaryTypes: [],
|
||||
synonyms: ['short_title', 'shortTitle'],
|
||||
defaultPreview: value => <h2>{ value }</h2>,
|
||||
fallbackToFirstField: false,
|
||||
showError: false,
|
||||
},
|
||||
author: {
|
||||
type: 'string',
|
||||
secondaryTypes: [],
|
||||
synonyms: ['author', 'name', 'by'],
|
||||
defaultPreview: value => <strong>{ value }</strong>,
|
||||
fallbackToFirstField: false,
|
||||
showError: false,
|
||||
},
|
||||
description: {
|
||||
type: 'string',
|
||||
secondaryTypes: ['text', 'markdown'],
|
||||
synonyms: ['shortDescription', 'short_description', 'shortdescription', 'description', 'intro', 'introduction', 'brief', 'body', 'content', 'biography', 'bio'],
|
||||
defaultPreview: value => value,
|
||||
fallbackToFirstField: false,
|
||||
showError: false,
|
||||
},
|
||||
image: {
|
||||
type: 'image',
|
||||
secondaryTypes: [],
|
||||
synonyms: ['image', 'thumbnail', 'thumb', 'picture', 'avatar'],
|
||||
defaultPreview: value => value,
|
||||
fallbackToFirstField: false,
|
||||
showError: false,
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user