From 1688e01be99e898e4d326b65c443d166acb9b10c Mon Sep 17 00:00:00 2001 From: cyril lopez Date: Fri, 9 Mar 2018 12:10:58 +0100 Subject: [PATCH] Display WYSIWYG in ctb --- .../admin/src/components/PopUpForm/index.js | 1 + .../admin/src/containers/Form/forms.json | 16 ++++++++++++++++ .../admin/src/translations/en.json | 3 +++ .../admin/src/translations/fr.json | 3 +++ 4 files changed, 23 insertions(+) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpForm/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpForm/index.js index 11974c4dd6..8a8b67bb89 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpForm/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/PopUpForm/index.js @@ -93,6 +93,7 @@ class PopUpForm extends React.Component { // eslint-disable-line react/prefer-st errors={errors} didCheckErrors={this.props.didCheckErrors} autoFocus={key === 0} + inputStyle={item.inputStyle || {}} /> ); } diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/forms.json b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/forms.json index 8ecf385475..612af16d08 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/forms.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/forms.json @@ -137,6 +137,22 @@ }, "advancedSettings": { "items": [ + { + "title": { + "id": "content-type-builder.form.attribute.item.appearance.name" + }, + "label": { + "id": "content-type-builder.form.attribute.item.appearance.label" + }, + "name": "params.WYSIWYG", + "type": "checkbox", + "value": false, + "validations": {}, + "inputDescription": { + "id": "content-type-builder.form.attribute.item.appearance.description" + }, + "inputStyle": { "fontWeight": "500" } + }, { "title": { "id": "content-type-builder.form.attribute.item.settings.name" diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json index 730451e48e..1756674d2b 100755 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json @@ -49,6 +49,9 @@ "form.attribute.item.json.name": "Name", "form.attribute.item.boolean.name": "Name", "form.attribute.item.string.name": "Name", + "form.attribute.item.appearance.name": "Appearance", + "form.attribute.item.appearance.label": "Display as a WYSIWYG", + "form.attribute.item.appearance.description": "Otherwise, the value will be editable through a basic textarea field", "form.attribute.item.settings.name": "Settings", "form.attribute.item.requiredField": "Required field", "form.attribute.item.uniqueField": "Unique field", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json index be1a15755b..91eefb153c 100755 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json @@ -51,6 +51,9 @@ "form.attribute.item.media.name": "Nom", "form.attribute.item.media.multiple": "Peut être relié à plusieurs fichiers", "form.attribute.item.string.name": "Nom", + "form.attribute.item.appearance.name": "Apparence", + "form.attribute.item.appearance.label": "Editable avec un WYSIWYG", + "form.attribute.item.appearance.description": "Sinon, il sera editable à partir d'une simple textarea", "form.attribute.item.settings.name": "Paramètres", "form.attribute.item.requiredField": "Champ obligatoire", "form.attribute.item.uniqueField": "Champ unique",