diff --git a/packages/strapi-admin/admin/src/translations/de.json b/packages/strapi-admin/admin/src/translations/de.json index 42893def0c..dffa3c4271 100644 --- a/packages/strapi-admin/admin/src/translations/de.json +++ b/packages/strapi-admin/admin/src/translations/de.json @@ -1,4 +1,12 @@ { + "app.components.Button.save": "Speichern", + "app.components.Button.cancel": "Abbrechen", + + "app.components.BlockLink.documentation": "Lese die Dokumentation", + "app.components.BlockLink.documentation.content": "Entdecke die Konzepte, Referenzanleitungen und Tutorials.", + "app.components.BlockLink.code": "Code Beispiele", + "app.components.BlockLink.code.content": "Lerne durch das Testen realer Projekte, die die Community entwickelt haben.", + "app.components.ComingSoonPage.comingSoon": "Bald verfügbar", "app.components.ComingSoonPage.featuresNotAvailable": "Dieses Feature ist derzeit noch in aktiver Entwicklung.", @@ -6,13 +14,24 @@ "app.components.DownloadInfo.text": "Dies könnte kurz dauern. Danke für deine Geduld.", "app.components.HomePage.welcome": "Willkommen an Bord!", - "app.components.HomePage.create": "Erstelle deinen ersten Content-Typ", + "app.components.HomePage.welcome.again": "Willkommen", + "app.components.HomePage.create": "Erstelle deinen ersten Inhaltstyp", "app.components.HomePage.welcomeBlock.content": "Wir freuen uns, dich als Mitglied der Community zu haben. Wir sind offen für Feedback, senden uns einfach eine direkt Nachricht an\u0020", "app.components.HomePage.welcomeBlock.content.issues": "Fehler", "app.components.HomePage.welcomeBlock.content.raise": "\u0020oder erhöhen\u0020", "app.components.HomePage.createBlock.content.first": "Das\u0020", "app.components.HomePage.createBlock.content.second": "\u0020Plugin wird dir helfen, die Datenstruktur deiner Modelle zu definieren. Wenn du neu hier bist, empfehlen wir dir unsere\u0020", "app.components.HomePage.createBlock.content.tutorial": "\u0020Anleitung.", + "app.components.HomePage.welcomeBlock.content.again": "Wir hoffen, dass du Fortschritte bei deinem Projekt machst.... Lese das Neueste über Strapi. Wir geben unser Bestes, um das Produkt auf der Grundlage deines Feedbacks zu verbessern.", + "app.components.HomePage.cta": "BESTÄTIGEN", + "app.components.HomePage.community": "Finde die Community im Web", + "app.components.HomePage.community.content": "Diskutiere mit Teammitgliedern, Mitwirkenden und Entwicklern auf verschiedenen Kanälen.", + "app.components.HomePage.newsLetter": "Abonniere den Newsletter, um sich über Strapi zu informieren.", + "app.components.HomePage.button.quickStart" : "STARTE DAS QUICK-START-TUTORIAL", + "app.components.HomePage.button.blog": "MEHR DAZU IM BLOG", + "app.components.HomePage.support": "UNTERSTÜTZE UNS", + "app.components.HomePage.support.content": "Durch den Kauf des T-Shirts können wir unsere Arbeit am Projekt fortsetzen, um Ihnen das bestmögliche Erlebnis zu bieten!", + "app.components.HomePage.support.link": "HOLE DIR JETZT DEIN T-SHIRT", "app.components.InputFile.newFile": "Neue Datei hinzufügen", "app.components.InputFileDetails.open": "In einem neuen Tab öffnen", @@ -69,6 +88,8 @@ "app.utils.placeholder.defaultMessage": "\u0020", "app.utils.SelectOption.defaultMessage": "\u0020", + "app.utils.defaultMessage": "", + "components.AutoReloadBlocker.header": "Dieses Plugin benötigt das Neuladen-Feature.", "components.AutoReloadBlocker.description": "Öffne die folgende Datei und aktiviere das Feature.", @@ -78,6 +99,8 @@ "components.OverlayBlocker.title": "Auf Neustart warten...", "components.OverlayBlocker.description": "Du verwendest ein Feature, das einen Neustart des Servers erfordert. Bitte warte, bis der Server wieder gestartet wurde.", + "components.PageFooter.select": "Einträge pro Seite", + "components.ProductionBlocker.header": "Dieses Plugin ist nur in der Entwicklungsumgebung verfügbar.", "components.ProductionBlocker.description": "Aus Sicherheitsgründen müssen wir dieses Plugin in anderen Umgebungen deaktivieren.", @@ -93,6 +116,7 @@ "components.Input.error.validation.min": "Dieser Wert ist zu niedrig.", "components.Input.error.validation.maxLength": "Dieser Wert ist zu lang.", "components.Input.error.validation.minLength": "Dieser Wert ist zu kurz.", + "components.Input.error.validation.json": "Dies entspricht nicht dem JSON-Format.", "components.Input.error.contentTypeName.taken": "Dieser Name existiert bereits", "components.Input.error.attribute.taken": "Dieser Feldname ist bereits vergeben", "components.Input.error.attribute.key.taken": "Dieser Wert existiert bereits", @@ -117,18 +141,26 @@ "components.WysiwygBottomControls.uploadFiles.browse": "selecting them", "components.WysiwygBottomControls.fullscreen": "Expand", - "notification.error": "Ein Fehler ist aufgetreten", + "HomePage.notification.newsLetter.success": "Newsletter erfolgreich abonniert", + "notification.error": "Ein Fehler ist aufgetreten", + "notification.error.layout": "Das Layout konnte nicht abgerufen werden.", + + "Analytics": "Analytics", "Auth & Permissions": "Authentifizierung & Berechtigungen", "Content Manager": "Content-Manager", - "Content Type Builder": "Content-Typ-Manager", + "Content Type Builder": "Inhaltstyp-Manager", + "Files Upload": "Dateien hochladen", "Settings Manager": "Einstellungs-Manager", "Email": "E-Mail", "Password": "Passwort", + "Users": "Benutzer", "Username": "Benutzername", + "Users & Permissions": "Benutzer & Berechtigungen", "Provider": "Methode", "ResetPasswordToken": "Passwort-Token zurücksetzen", "Role": "Rolle", + "Roles & Permissions" : "Rollen & Berechtigungen", "New entry": "Neuer Eintrag", "request.error.model.unknown": "Dieses Schema existiert nicht" } diff --git a/packages/strapi-admin/admin/src/translations/es.json b/packages/strapi-admin/admin/src/translations/es.json index 2fe777f5a2..6da3497017 100644 --- a/packages/strapi-admin/admin/src/translations/es.json +++ b/packages/strapi-admin/admin/src/translations/es.json @@ -8,23 +8,23 @@ "app.components.DownloadInfo.download": "Descarga en curso...", "app.components.DownloadInfo.text": "Esto puede tardar un minuto. Gracias por su paciencia.", - "app.components.HomePage.welcome": "Bienvenidos a bordo!", + "app.components.HomePage.welcome": "¡Bienvenido a bordo!", "app.components.HomePage.welcome.again": "Bienvenido ", "app.components.HomePage.cta": "CONFIRMAR", "app.components.HomePage.community": "Encuentra la comunidad en la web", "app.components.HomePage.newsLetter": "Suscríbase al boletín de noticias para ponerse en contacto con Strapi", "app.components.HomePage.community.content": "Discutir con los miembros del equipo, colaboradores y desarrolladores en diferentes canales.", "app.components.HomePage.create": "Crea tu primer Tipo de Contenido", - "app.components.HomePage.welcomeBlock.content": "Estamos felices de tenerlo como miembro de la comunidad. Estamos constantemente en busca de comentarios así que no dude en enviarnos DM en\u0020", + "app.components.HomePage.welcomeBlock.content": "Estamos felices de tenerlo como miembro de la comunidad. Estamos constantemente en busca de comentarios así que no dude en enviarnos un DM en\u0020", "app.components.HomePage.welcomeBlock.content.again": "Esperamos que estés progresando en tu proyecto.... Siéntase libre de leer las últimas novedades sobre Strapi. Estamos dando lo mejor de nosotros mismos para mejorar el producto basándonos en sus comentarios.", - "app.components.HomePage.welcomeBlock.content.issues": "temas.", - "app.components.HomePage.welcomeBlock.content.raise": "\u0020o plantear\u0020", + "app.components.HomePage.welcomeBlock.content.issues": "problema.", + "app.components.HomePage.welcomeBlock.content.raise": "\u0020o reportar cualquier\u0020", "app.components.HomePage.createBlock.content.first": "El\u0020", - "app.components.HomePage.createBlock.content.second": "\u0020le ayudará a definir la estructura de datos de sus modelos. Si eres nuevo aquí, te recomendamos encarecidamente que sigas nuestros\u0020", - "app.components.HomePage.createBlock.content.tutorial": "\u0020tutorial.", + "app.components.HomePage.createBlock.content.second": "\u0020le ayudará a definir la estructura de datos de sus modelos. Si eres nuevo aquí, te recomendamos encarecidamente que sigas nuestro\u0020", + "app.components.HomePage.createBlock.content.tutorial": "\u0020", "app.components.HomePage.button.quickStart": "INICIAR EL TUTORIAL DE INICIO RÁPIDO", "app.components.HomePage.button.blog": "VER MÁS EN EL BLOG", - "app.components.HomePage.support": "APOYANOS", + "app.components.HomePage.support": "APÓYANOS", "app.components.HomePage.support.content": "¡Al comprar la camiseta, nos permitirá continuar nuestro trabajo en el proyecto para darle la mejor experiencia posible!", "app.components.HomePage.support.link": "CONSIGUE TU CAMISETA AHORA", @@ -43,8 +43,8 @@ "app.components.ImgPreview.hint": "Arrastre y suelte el archivo en esta área o {browse} para cargar un archivo.", "app.components.ImgPreview.hint.browse": "buscar", - "app.components.InstallPluginPage.helmet": "Mercado - Plugins", - "app.components.InstallPluginPage.title": "Mercado - Plugins", + "app.components.InstallPluginPage.helmet": "Tienda - Plugins", + "app.components.InstallPluginPage.title": "Tienda - Plugins", "app.components.InstallPluginPage.description": "Extienda su aplicación sin esfuerzo.", "app.components.InstallPluginPage.plugin.support-us.description": "¡Apóyanos comprando la camiseta Strapi. Eso nos permitirá seguir trabajando en el proyecto y tratar de darle la mejor experiencia posible!", "app.components.InstallPluginPage.InputSearch.label": " ", @@ -60,7 +60,7 @@ "app.components.LeftMenuFooter.poweredBy": "Potenciado por ", "app.components.LeftMenuLinkContainer.configuration": "Configuraciones", "app.components.LeftMenuLinkContainer.general": "General", - "app.components.LeftMenuLinkContainer.installNewPlugin": "Plaza de mercado", + "app.components.LeftMenuLinkContainer.installNewPlugin": "Tienda", "app.components.LeftMenuLinkContainer.listPlugins": "Plugins", "app.components.LeftMenuLinkContainer.noPluginsInstalled": "No hay plugins instalados todavía", "app.components.LeftMenuLinkContainer.plugins": "Plugins", @@ -149,6 +149,8 @@ "Users & Permissions": "Usuarios y permisos", "Content Manager": "Gestor de Contenidos", "Content Type Builder": "Constructor de Tipos de Contenido", + "Files Upload": "Carga de archivos", + "Roles & Permissions": "Roles y Permisos", "Settings Manager": "Gestor de ajustes", "Email": "Email", "Password": "Contraseña", diff --git a/packages/strapi-admin/admin/src/translations/it.json b/packages/strapi-admin/admin/src/translations/it.json index 0b5d31579e..b2fbabb75f 100644 --- a/packages/strapi-admin/admin/src/translations/it.json +++ b/packages/strapi-admin/admin/src/translations/it.json @@ -89,6 +89,7 @@ "components.popUpWarning.title": "Per favore conferma", "components.popUpWarning.message": "Sei sicuro di volerlo cancellare?", "components.Input.error.validation.email": "Non è un'email", + "components.Input.error.validation.json" : "Formato JSON non corrispondente", "components.Input.error.validation.required": "Valore obbligatorio.", "components.Input.error.validation.regex": "Questo valore non coincide con il regex.", "components.Input.error.validation.max": "Valore troppo alto.", @@ -119,18 +120,21 @@ "HomePage.notification.newsLetter.success": "Iscritto con successo alla newsletter", "notification.error": "Si è verificato un errore", "notification.error.layout": "Non è stato possibile recuperare il layout", + "request.error.model.unknown" : "Questo modello non esiste", "Users & Permissions": "Utenti & Permessi", "Content Manager": "Gestione Contenuti", "Content Type Builder": "Generatore di Tipo Contenuti", "Settings Manager": "Gestione Impostazioni", "Email": "Email", + "Files Upload" : "Caricamento Files", "Password": "Password", "Username": "Username", "Provider": "Provider", "ResetPasswordToken": "Reimposta Token Password", "Role": "Ruolo", + "Roles & Permissions" : "Ruoli e Permessi", "New entry": "Nuovo elemento", "request.error.model.unknow": "Questo modello non esiste", "Users": "Utenti", "Analytics": "Analytics" -} \ No newline at end of file +} diff --git a/packages/strapi-admin/admin/src/translations/pt-BR.json b/packages/strapi-admin/admin/src/translations/pt-BR.json index e441d3b2e8..641d549341 100644 --- a/packages/strapi-admin/admin/src/translations/pt-BR.json +++ b/packages/strapi-admin/admin/src/translations/pt-BR.json @@ -149,6 +149,8 @@ "Users & Permissions": "Usuários & Permissões", "Content Manager": "Gestão de conteúdo", "Content Type Builder": "Construtor de Conteúdo", + "Files Upload": "Enviar arquivos", + "Roles & Permissions": "Papéis e permissões", "Settings Manager": "Gerenciador de configurações", "Email": "E-mail", "Password": "Senha", diff --git a/packages/strapi-admin/admin/src/translations/ru.json b/packages/strapi-admin/admin/src/translations/ru.json index b479e2f0d1..6178832419 100644 --- a/packages/strapi-admin/admin/src/translations/ru.json +++ b/packages/strapi-admin/admin/src/translations/ru.json @@ -17,10 +17,13 @@ "app.components.HomePage.welcomeBlock.content": "Мы рады, что вы вступили в сообщество. Нам необходима обратная связь для развития проекта, поэтому не стесняйтесь писать нам\u0020", "app.components.HomePage.welcomeBlock.content.issues": "проблема.", "app.components.HomePage.welcomeBlock.content.raise": "\u0020или поднять\u0020", + "app.components.HomePage.welcome.again": "Добро пожаловать", + "app.components.HomePage.welcomeBlock.content.again": "Надеемся у вы делаете успехи в вашем проекте... Следите с последними новостями о Strapi. Мы стараемся изо всех сил, чтобы улучшить продукт основываясь на ваших пожеланиях.", "app.components.HomePage.createBlock.content.first": "\u0020", "app.components.HomePage.createBlock.content.second": "\u0020плагин поможет вам создать структуру ваших данных. Если вы новичок, мы настоятельно рекомендуем вам следить за нашими\u0020", "app.components.HomePage.createBlock.content.tutorial": "\u0020руководство.", "app.components.HomePage.button.quickStart": "ОЗНАКОМТЕСЬ С РУКОВОДСТВОМ ПО БЫСТРОМУ СТАРТУ", + "app.components.HomePage.button.blog": "СМОТРИТЕ БОЛЬШЕ В БЛОГЕ", "app.components.HomePage.support": "ПОДДЕРЖИТЕ НАС", "app.components.HomePage.support.content": "Купите футболку, это поможет нам продолжать работу над проектом, чтобы предоставить вам наилучшее из возможных решений!", "app.components.HomePage.support.link": "ЗАКАЗАТЬ НАШУ ФУТБОЛКУ СЕЙЧАС", @@ -113,6 +116,7 @@ "components.Input.error.validation.min": "Слишком маленькое.", "components.Input.error.validation.maxLength": "Слишком длинное.", "components.Input.error.validation.minLength": "Слишком короткое.", + "components.Input.error.validation.json": "Не соответствует JSON формату", "components.Input.error.contentTypeName.taken": "Это название уже существует", "components.Input.error.attribute.taken": "Поле с таким названием уже существует", "components.Input.error.attribute.key.taken": "Это значение уже существует", @@ -136,6 +140,8 @@ "components.WysiwygBottomControls.uploadFiles": "Перетащите файлы в эту область, добавляйте из буфер обмена или {browse}.", "components.WysiwygBottomControls.uploadFiles.browse": "выделите их", "components.WysiwygBottomControls.fullscreen": "Развернуть", + "Files Upload": "Загрузка файлов", + "HomePage.notification.newsLetter.success": "Успешная подписка на рассылку новостей", @@ -143,6 +149,7 @@ "notification.error.layout": "Не удалось получить макет", "Users & Permissions": "Пользователи & Доступы", + "Roles & Permissions": "Роли и доступы", "Content Manager": "Редактор контента", "Content Type Builder": "Конструктор Типов Контента", "Settings Manager": "Менеджер Настроек", diff --git a/packages/strapi-admin/admin/src/translations/tr.json b/packages/strapi-admin/admin/src/translations/tr.json index 6d54e48144..0bc2bd7af5 100755 --- a/packages/strapi-admin/admin/src/translations/tr.json +++ b/packages/strapi-admin/admin/src/translations/tr.json @@ -122,10 +122,11 @@ "components.Input.error.attribute.sameKeyAndName": "Eşit olamaz", "components.Input.error.validation.minSupMax": "Üstü olamaz", "components.Input.error.custom-error": "{errorMessage} ", + "components.Input.error.validation.json": "Bu JSON biçimi ile eşleşmiyor", "components.ListRow.empty": "Gösterilecek veri bulunmamaktadır.", - "components.Wysiwyg.collapse": "Collapse", + "components.Wysiwyg.collapse": "Daralt", "components.Wysiwyg.selectOptions.title": "Başlık ekle", "components.Wysiwyg.selectOptions.H1": "H1 başlık", "components.Wysiwyg.selectOptions.H2": "H2 başlık", @@ -143,11 +144,13 @@ "HomePage.notification.newsLetter.success": "Bültene başarıyla abone olundu", "notification.error": "Bir hata oluştu", - "notification.error.layout": "Couldn't retrieve the layout", + "notification.error.layout": "Düzen alınamadı", "Users & Permissions": "Kullanıcılar & İzinler", "Content Manager": "İçerik Yönetimi", "Content Type Builder": "İçerik Türü Oluşturucusu", + "Files Upload": "Dosya yükleme", + "Roles & Permissions": "Roller & İzinler", "Settings Manager": "Yönetici Ayarları", "Email": "E-posta", "Password": "Şifre", diff --git a/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_grab.svg b/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_grab.svg new file mode 100644 index 0000000000..da187b6f13 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_grab.svg @@ -0,0 +1,34 @@ + + + + Icon grab + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_remove.svg b/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_remove.svg new file mode 100644 index 0000000000..594f147935 --- /dev/null +++ b/packages/strapi-plugin-content-manager/admin/src/assets/images/icon_remove.svg @@ -0,0 +1,19 @@ + + + + Icon remove + Created with Sketch. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages/strapi-plugin-content-manager/admin/src/components/EditRelations/index.js b/packages/strapi-plugin-content-manager/admin/src/components/EditRelations/index.js index 69340215d0..711a995a90 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/EditRelations/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/EditRelations/index.js @@ -5,7 +5,6 @@ */ import React from 'react'; -import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import { get } from 'lodash'; @@ -18,22 +17,36 @@ import styles from './styles.scss'; function EditRelations(props) { return (
- - {(message) =>

{message}

} -
{props.displayedRelations.map(relationName => { const relation = get(props.schema, ['relations', relationName], {}); - const Select = ['oneWay', 'oneToOne', 'manyToOne', 'oneToManyMorph', 'oneToOneMorph'].includes(relation.nature) ? SelectOne : SelectMany; + if(['oneWay', 'oneToOne', 'manyToOne', 'oneToManyMorph', 'oneToOneMorph'].includes(relation.nature)) { + return ( + + ); + } + return ( - } + /> + { @@ -157,6 +197,10 @@ class SelectMany extends React.Component { } }) } + onSortEnd={this.handleSortEnd} + onRemove={this.handleRemove} + distance={1} + onClick={this.handleClick} /> {description}
@@ -166,9 +210,12 @@ class SelectMany extends React.Component { } SelectMany.propTypes = { + onAddRelationalItem: PropTypes.func.isRequired, + onRedirect: PropTypes.func.isRequired, + onRemoveRelationItem: PropTypes.func.isRequired, + onSort: PropTypes.func.isRequired, record: PropTypes.oneOfType([PropTypes.object, PropTypes.bool]).isRequired, relation: PropTypes.object.isRequired, - setRecordAttribute: PropTypes.func.isRequired, }; export default SelectMany; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/styles.scss b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/styles.scss index c752aabc81..c73d49d9d5 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/styles.scss +++ b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/styles.scss @@ -1,13 +1,21 @@ .selectMany { /* stylelint-disable */ + padding-bottom: 19px; + margin-bottom: 0px; + label{ font-size: 1.3rem; font-weight: 500; text-transform: capitalize; margin-top: 3px; + + > span { + font-weight: 400; + font-size: 1.2rem; + } } label + div{ - margin: 5px 0 26px; + margin: 3px 0 26px; &:focus{ outline: none; @@ -25,3 +33,150 @@ } } } + +.selectManyUpdate{ + padding-bottom: 15px !important; +} + +.select{ + margin-bottom: 0px !important; +} + +.sortableList { + overflow: hidden; + max-height: 116px; + + > ul { + margin: 4px -20px 0; + padding: 0 20px !important; + list-style: none !important; + overflow: scroll; + max-height: 110px; + } + +} + +.sortableListLong { + position: relative; + display: inline-block; + width: 100%; + height: 0px; + + &:after { + position: absolute; + top: -15px; + left: -5px; + content: ''; + display: inline-block; + width: calc(100% + 10px); + height: 1px; + margin-bottom: -25px; + box-shadow: 0px -2px 4px 0px rgba(227, 233, 243, .5); + } +} + +.sortableListItem { + display: flex; + flex-wrap: nowrap; + align-content: center; + justify-content: space-between; + height: 27px; + + + &:hover{ + cursor: pointer; + + } + + &:active{ + .dragHandle{ + cursor: pointer; + + > span { + background: #AED4FB; + } + } + } + + .dragHandle{ + outline: none; + text-decoration: none; + margin-top: -1px; + + > span { + vertical-align: middle; + position: relative; + display: inline-block; + width: 6px; + height: 1px; + padding: 0px !important; + background: #B3B5B9; + overflow: visible !important; + transition: background .25s ease-out; + + &:before, &:after{ + content: ''; + display: inline-block; + width: 6px; + height: 1px; + background: inherit; + } + + &:before{ + position: absolute; + top: -2px; + left: 0; + } + + &:after{ + position: absolute; + bottom: -2px; + left: 0; + } + } + + } + + > div { + span { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + + &:first-of-type{ + display: flex; + align-items: center; + transition: color .25s ease-out; + + &:hover{ + .dragHandle{ + > span { + background: #007EFF; + } + } + + color: #007EFF; + } + + span { + &:last-of-type{ + padding-left: 10px; + } + } + } + + &:last-of-type{ + display: inline-block; + height: 100%; + line-height: 27px; + text-align: right; + padding-right: 0px; + + img{ + display: inline-block; + height: 14px; + } + } + } +} \ No newline at end of file diff --git a/packages/strapi-plugin-content-manager/admin/src/components/SelectOne/index.js b/packages/strapi-plugin-content-manager/admin/src/components/SelectOne/index.js index 34689803b9..f9ef174cd3 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/SelectOne/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/SelectOne/index.js @@ -6,6 +6,7 @@ import React from 'react'; import Select from 'react-select'; +import { FormattedMessage } from 'react-intl'; import PropTypes from 'prop-types'; import 'react-select/dist/react-select.css'; import { cloneDeep, map, includes, isArray, isNull, isUndefined, isFunction, get, findIndex } from 'lodash'; @@ -106,6 +107,15 @@ class SelectOne extends React.Component { // eslint-disable-line react/prefer-st }); } + // Redirect to the edit page + handleClick = (item = {}) => { + this.props.onRedirect({ + model: this.props.relation.collection || this.props.relation.model, + id: item.value.id || item.value._id, + source: this.props.relation.plugin, + }); + } + handleInputChange = (value) => { const clonedOptions = this.state.options; const filteredValues = clonedOptions.filter(data => includes(data.label, value)); @@ -121,11 +131,25 @@ class SelectOne extends React.Component { // eslint-disable-line react/prefer-st : ''; const value = get(this.props.record, this.props.relation.alias); + const excludeModel = ['role', 'permission', 'file'].includes(this.props.relation.model || this.props.relation.collection); // Temporary. + const entryLink = (isNull(value) || isUndefined(value) || excludeModel ? + '' : + ( + + {title => ( + this.handleClick({value})} title={title}> + )} + + ) + ); /* eslint-disable jsx-a11y/label-has-for */ return (
- + {description}