mirror of
https://github.com/strapi/strapi.git
synced 2025-12-04 02:51:26 +00:00
Merge pull request #14162 from strapi/custom-fields/remove-map-cf
[Custom fields] remove map cf
This commit is contained in:
commit
d84d954e43
@ -5,131 +5,112 @@ import ColorPickerIcon from './components/ColorPicker/ColorPickerIcon';
|
||||
|
||||
export default {
|
||||
register(app) {
|
||||
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'),
|
||||
},
|
||||
app.customFields.register({
|
||||
name: 'color',
|
||||
pluginId: 'mycustomfields',
|
||||
type: 'string',
|
||||
icon: ColorPickerIcon,
|
||||
intlLabel: {
|
||||
id: 'mycustomfields.color.label',
|
||||
defaultMessage: 'Color',
|
||||
},
|
||||
{
|
||||
name: 'color',
|
||||
pluginId: 'mycustomfields',
|
||||
type: 'string',
|
||||
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'
|
||||
),
|
||||
},
|
||||
options: {
|
||||
base: [
|
||||
{
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.label',
|
||||
defaultMessage: 'Color format',
|
||||
},
|
||||
name: 'options.format',
|
||||
type: 'select',
|
||||
value: 'hex',
|
||||
options: [
|
||||
{
|
||||
key: '__null_reset_value__',
|
||||
value: '',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.placeholder',
|
||||
defaultMessage: 'Select a format',
|
||||
},
|
||||
hidden: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'hex',
|
||||
value: 'hex',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.hex',
|
||||
defaultMessage: 'Hexadecimal',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'rgba',
|
||||
value: 'rgba',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.rgba',
|
||||
defaultMessage: 'RGBA',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
intlDescription: {
|
||||
id: 'mycustomfields.color.description',
|
||||
defaultMessage: 'Select any color',
|
||||
},
|
||||
components: {
|
||||
Input: async () =>
|
||||
import(
|
||||
/* webpackChunkName: "input-component" */ './components/ColorPicker/ColorPickerInput'
|
||||
),
|
||||
},
|
||||
options: {
|
||||
base: [
|
||||
{
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.label',
|
||||
defaultMessage: 'Color format',
|
||||
},
|
||||
],
|
||||
advanced: [
|
||||
{
|
||||
sectionTitle: {
|
||||
id: 'global.settings',
|
||||
defaultMessage: 'Settings',
|
||||
name: 'options.format',
|
||||
type: 'select',
|
||||
value: 'hex',
|
||||
options: [
|
||||
{
|
||||
key: '__null_reset_value__',
|
||||
value: '',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'color-picker.color.format.placeholder',
|
||||
defaultMessage: 'Select a format',
|
||||
},
|
||||
hidden: true,
|
||||
},
|
||||
},
|
||||
items: [
|
||||
{
|
||||
name: 'required',
|
||||
type: 'checkbox',
|
||||
{
|
||||
key: 'hex',
|
||||
value: 'hex',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'form.attribute.item.requiredField',
|
||||
defaultMessage: 'Required field',
|
||||
},
|
||||
description: {
|
||||
id: 'form.attribute.item.requiredField.description',
|
||||
defaultMessage: "You won't be able to create an entry if this field is empty",
|
||||
id: 'color-picker.color.format.hex',
|
||||
defaultMessage: 'Hexadecimal',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'private',
|
||||
type: 'checkbox',
|
||||
},
|
||||
{
|
||||
key: 'rgba',
|
||||
value: 'rgba',
|
||||
metadatas: {
|
||||
intlLabel: {
|
||||
id: 'form.attribute.item.privateField',
|
||||
defaultMessage: 'Private field',
|
||||
},
|
||||
description: {
|
||||
id: 'form.attribute.item.privateField.description',
|
||||
defaultMessage: 'This field will not show up in the API response',
|
||||
id: 'color-picker.color.format.rgba',
|
||||
defaultMessage: 'RGBA',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
advanced: [
|
||||
{
|
||||
sectionTitle: {
|
||||
id: 'global.settings',
|
||||
defaultMessage: 'Settings',
|
||||
},
|
||||
],
|
||||
validator: (args) => ({
|
||||
format: yup.string().required({
|
||||
id: 'options.color-picker.format.error',
|
||||
defaultMessage: 'The color format is required',
|
||||
}),
|
||||
items: [
|
||||
{
|
||||
name: 'required',
|
||||
type: 'checkbox',
|
||||
intlLabel: {
|
||||
id: 'form.attribute.item.requiredField',
|
||||
defaultMessage: 'Required field',
|
||||
},
|
||||
description: {
|
||||
id: 'form.attribute.item.requiredField.description',
|
||||
defaultMessage: "You won't be able to create an entry if this field is empty",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'private',
|
||||
type: 'checkbox',
|
||||
intlLabel: {
|
||||
id: 'form.attribute.item.privateField',
|
||||
defaultMessage: 'Private field',
|
||||
},
|
||||
description: {
|
||||
id: 'form.attribute.item.privateField.description',
|
||||
defaultMessage: 'This field will not show up in the API response',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
validator: (args) => ({
|
||||
format: yup.string().required({
|
||||
id: 'options.color-picker.format.error',
|
||||
defaultMessage: 'The color format is required',
|
||||
}),
|
||||
},
|
||||
}),
|
||||
},
|
||||
]);
|
||||
});
|
||||
},
|
||||
bootstrap(app) {},
|
||||
async registerTrads({ locales }) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user