Add test customField

This commit is contained in:
Mark Kaylor 2022-07-22 13:59:05 +02:00
parent 85c1eb1e8e
commit cdab1407ea
2 changed files with 44 additions and 18 deletions

View File

@ -0,0 +1,7 @@
import React from 'react';
const ColorPickerInput = () => {
return <div>TODO: Map Input Component</div>;
};
export default ColorPickerInput;

View File

@ -4,26 +4,45 @@ import ColorPickerIcon from './components/ColorPicker/ColorPickerIcon';
export default {
register(app) {
app.customFields.register({
name: 'color',
pluginId: 'mycustomfields',
type: 'text',
icon: ColorPickerIcon,
intlLabel: {
id: 'mycustomfields.color.label',
defaultMessage: 'Color',
app.customFields.register([
{
name: 'map',
pluginId: 'mycustomfields',
type: 'json',
intlLabel: {
id: 'mycustomfields.map.label',
defaultMessage: 'Map',
},
intlDescription: {
id: 'mycustomfields.map.description',
defaultMessage: 'Select any location',
},
components: {
Input: async () =>
import(/* webpackChunkName: "input-component" */ './components/Map/MapInput'),
},
},
intlDescription: {
id: 'mycustomfields.color.description',
defaultMessage: 'Select any color',
{
name: 'color',
pluginId: 'mycustomfields',
type: 'text',
icon: ColorPickerIcon,
intlLabel: {
id: 'mycustomfields.color.label',
defaultMessage: 'Color',
},
intlDescription: {
id: 'mycustomfields.color.description',
defaultMessage: 'Select any color',
},
components: {
Input: async () =>
import(
/* webpackChunkName: "input-component" */ './components/ColorPicker/ColorPickerInput'
),
},
},
components: {
Input: async () =>
import(
/* webpackChunkName: "input-component" */ './components/ColorPicker/ColorPickerInput'
),
},
});
]);
},
bootstrap(app) {},
async registerTrads({ locales }) {