From cdf40a2bc120222c0a8e14665b62f424024ee7fd Mon Sep 17 00:00:00 2001 From: Virginie Ky Date: Mon, 29 Jul 2019 18:09:37 +0200 Subject: [PATCH] Groups type in attribute picker modal --- .../components/AttributeOption/styles.scss | 25 ++++++++++--------- .../AttributesPickerModal/attributes.json | 4 +++ .../admin/src/translations/en.json | 4 +++ .../admin/src/translations/fr.json | 4 +++ .../admin/src/utils/attributeIcons.js | 2 ++ 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeOption/styles.scss b/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeOption/styles.scss index 0b7f3a5dd4..a279c53b03 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeOption/styles.scss +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/AttributeOption/styles.scss @@ -3,22 +3,24 @@ width: 100% !important; height: 4rem; padding: 0 1rem 0 1rem; - margin-top: .6rem; - margin-bottom: .8rem; + margin-top: 0.6rem; + margin-bottom: 0.8rem; align-items: center; justify-content: space-between; border-radius: 0.25rem; - border: 1px solid #E3E9F3; - background: #FFFFFF; + border: 1px solid #e3e9f3; + background: #ffffff; line-height: 4rem; - box-shadow: 1px 1px 1px rgba(104, 118,145, 0.05); + box-shadow: 1px 1px 1px rgba(104, 118, 145, 0.05); cursor: pointer; - &:hover, &:active, &:focus { - background: #F7F7F7; + &:hover, + &:active, + &:focus { + background: #f7f7f7; outline: 0; > div:after { - color: #0097F6; + color: #0097f6; } } @@ -33,8 +35,6 @@ } } - - .card { font-size: 1.3rem; display: flex; @@ -46,7 +46,7 @@ position: absolute; top: 7px; right: 26px; - color: #E3E9F3; + color: #e3e9f3; font-size: 1.4rem; font-family: 'FontAwesome'; -webkit-font-smoothing: antialiased; @@ -66,7 +66,7 @@ > span { white-space: nowrap; - color: #9EA7B8; + color: #9ea7b8; font-size: 1.2rem; font-style: italic; font-weight: 400; @@ -75,6 +75,7 @@ &:last-child { text-overflow: ellipsis; overflow: hidden; + line-height: normal; } } } diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/attributes.json b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/attributes.json index 1e8428f085..97a38c5a05 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/attributes.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/AttributesPickerModal/attributes.json @@ -42,5 +42,9 @@ { "type": "enumeration", "description": "content-type-builder.popUpForm.attributes.enumeration.description" + }, + { + "type": "group", + "description": "content-type-builder.popUpForm.attributes.group.description" } ] 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 c7fc043dc3..4225d0ba9f 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json @@ -8,6 +8,7 @@ "attribute.email": "Email", "attribute.enumeration": "Enumeration", "attribute.float": "Float", + "attribute.group": "Group", "attribute.integer": "Integer", "attribute.biginteger": "Big Integer", "attribute.json": "JSON", @@ -16,6 +17,7 @@ "attribute.relation": "Relation", "attribute.string": "String", "attribute.text": "Text", + "attribute.wysiwyg": "Rich text", "button.attributes.add": "Add New Field", "button.contentType.add": "Add a Content Type", "button.group.add": "Add a Group", @@ -141,6 +143,8 @@ "popUpForm.attributes.email.name": "Email", "popUpForm.attributes.enumeration.description": "List of choices", "popUpForm.attributes.enumeration.name": "Enumeration", + "popUpForm.attributes.group.description": "Refers to a Group", + "popUpForm.attributes.group.name": "Group", "popUpForm.attributes.json.description": "Data in JSON format", "popUpForm.attributes.json.name": "JSON", "popUpForm.attributes.media.description": "Images, videos, PDFs and other files", 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 63c2a6a204..c262ed0476 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json @@ -8,6 +8,7 @@ "attribute.email": "Email", "attribute.enumeration": "Énumération", "attribute.float": "Décimal approximatif", + "attribute.group": "Groupe", "attribute.integer": "Entier", "attribute.json": "JSON", "attribute.media": "Média", @@ -15,6 +16,7 @@ "attribute.relation": "Relation", "attribute.string": "Chaîne de caractères", "attribute.text": "Texte", + "attribute.wysiwyg": "Texte enrichi", "button.attributes.add": "Ajouter un champ", "button.contentType.add": "Ajouter un Type de Contenu", "button.group.add": "Ajouter un Groupe", @@ -140,6 +142,8 @@ "popUpForm.attributes.enumeration": "Énumération", "popUpForm.attributes.enumeration.description": "Liste de choix", "popUpForm.attributes.enumeration.name": "Énumération", + "popUpForm.attributes.group.description": "Pointe vers un Groupe", + "popUpForm.attributes.group.name": "Groupe", "popUpForm.attributes.json.description": "Données au format JSON", "popUpForm.attributes.json.name": "JSON", "popUpForm.attributes.media.description": "Images, vidéos, PDFs et autres fichiers", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/utils/attributeIcons.js b/packages/strapi-plugin-content-type-builder/admin/src/utils/attributeIcons.js index dc0b4909ab..9f37fe85ef 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/utils/attributeIcons.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/utils/attributeIcons.js @@ -2,6 +2,7 @@ import boolean from '../assets/icons/attributes/icon_boolean.png'; import date from '../assets/icons/attributes/icon_date.png'; import email from '../assets/icons/attributes/icon_email.png'; import enumeration from '../assets/icons/attributes/icon_enumeration.png'; +import group from '../assets/icons/attributes/icon_group.png'; import media from '../assets/icons/attributes/icon_media.png'; import json from '../assets/icons/attributes/icon_json.png'; import number from '../assets/icons/attributes/icon_number.png'; @@ -15,6 +16,7 @@ const attributeIcons = { date, email, enumeration, + group, media, json, number,