diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeRow/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeRow/index.js
index e8bde872be..d957d4335f 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeRow/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeRow/index.js
@@ -24,7 +24,7 @@ class AttributeRow extends React.Component { // eslint-disable-line react/prefer
this.asset = {
'boolean': IcoBoolean,
'date': IcoDate,
- 'image': IcoImage,
+ 'media': IcoImage,
'json': IcoJson,
'relation': IcoRelation,
'string': IcoString,
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 b48307e5a5..b5ea150e56 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
@@ -220,20 +220,148 @@
}
},
"date": {
- "baseSettings": {},
- "advancedSettings": {}
+ "baseSettings": {
+ "items": [
+ {
+ "name": "form.attribute.item.date.name",
+ "target": "name",
+ "type": "string",
+ "value": "",
+ "validations": {
+ "required": true
+ }
+ }
+ ]
+ },
+ "advancedSettings": {
+ "items": [
+ {
+ "title": "form.attribute.item.settings.name",
+ "name": "form.attribute.item.requiredField",
+ "target": "params.required",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.requiredField.description"
+ },
+ {
+ "name": "form.attribute.item.uniqueField",
+ "target": "params.unique",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.uniqueField.description"
+ }
+ ]
+ }
},
"boolean": {
- "baseSettings": {},
- "advancedSettings": {}
+ "baseSettings": {
+ "items": [
+ {
+ "name": "form.attribute.item.boolean.name",
+ "target": "name",
+ "type": "string",
+ "value": "",
+ "validations": {
+ "required": true
+ }
+ }
+ ]
+ },
+ "advancedSettings": {
+ "items": [
+ {
+ "title": "form.attribute.item.settings.name",
+ "name": "form.attribute.item.requiredField",
+ "target": "params.required",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.requiredField.description"
+ },
+ {
+ "name": "form.attribute.item.uniqueField",
+ "target": "params.unique",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.uniqueField.description"
+ }
+ ]
+ }
},
"json": {
- "baseSettings": {},
- "advancedSettings": {}
+ "baseSettings": {
+ "items": [
+ {
+ "name": "form.attribute.item.json.name",
+ "target": "name",
+ "type": "string",
+ "value": "",
+ "validations": {
+ "required": true
+ }
+ }
+ ]
+ },
+ "advancedSettings": {
+ "items": [
+ {
+ "title": "form.attribute.item.settings.name",
+ "name": "form.attribute.item.requiredField",
+ "target": "params.required",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.requiredField.description"
+ },
+ {
+ "name": "form.attribute.item.uniqueField",
+ "target": "params.unique",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.uniqueField.description"
+ }
+ ]
+ }
},
"media": {
- "baseSettings": {},
- "advancedSettings": {}
+ "baseSettings": {
+ "items": [
+ {
+ "name": "form.attribute.item.media.name",
+ "target": "name",
+ "type": "string",
+ "value": "",
+ "validations": {
+ "required": true
+ }
+ }
+ ]
+ },
+ "advancedSettings": {
+ "items": [
+ {
+ "title": "form.attribute.item.settings.name",
+ "name": "form.attribute.item.requiredField",
+ "target": "params.required",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.requiredField.description"
+ },
+ {
+ "name": "form.attribute.item.uniqueField",
+ "target": "params.unique",
+ "type": "checkbox",
+ "value": false,
+ "validations": {},
+ "inputDescription": "form.attribute.item.uniqueField.description"
+ }
+ ]
+ }
}
}
}
diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js
index 56917aa4f6..de4e7cc1d0 100644
--- a/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js
+++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/Form/index.js
@@ -63,6 +63,7 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
super(props);
this.state = {
showModal: false,
+ popUpTitleEdit: '',
};
}
@@ -297,6 +298,8 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
}
if (get(props.contentTypeData, 'name') && includes(props.hash, '#edit') && includes(props.hash, 'attribute')) {
+
+ this.setState({ popUpTitleEdit: get(props.contentTypeData, ['attributes', split(props.hash, '::')[3], 'name']) });
this.props.setAttributeFormEdit(props.hash, props.contentTypeData);
}
} else {
@@ -348,12 +351,17 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
)
renderCustomPopUpHeader = (startTitle) => {
- const italicText = replace(split(this.props.hash, ('::'))[1], 'attribute', '');
+ const italicText = !includes(this.props.hash, '#edit') ?
+