Fix design

This commit is contained in:
soupette 2018-08-10 12:45:56 +02:00
parent 3feae01952
commit edf81024c1
19 changed files with 101 additions and 41 deletions

View File

@ -125,6 +125,7 @@ class Edit extends React.PureComponent {
const appearance = get(layout, 'appearance');
const type = !isEmpty(appearance) ? appearance.toLowerCase() : get(layout, 'type', getInputType(details.type));
const inputDescription = get(details, 'description', null);
const inputStyle = type === 'textarea' ? { height: '196px' } : {};
let className = get(layout, 'className');
if (type === 'toggle' && !className) {
@ -140,6 +141,7 @@ class Edit extends React.PureComponent {
disabled={!get(details, 'editable', true)}
errors={this.getInputErrors(attr)}
inputDescription={inputDescription}
inputStyle={inputStyle}
key={attr}
label={get(layout, 'label') || details.label || ''}
multiple={this.fileRelationAllowMultipleUpload(attr)}

View File

@ -1,5 +1,5 @@
.selectMany { /* stylelint-disable */
padding-bottom: 19px;
padding-bottom: 20px;
margin-bottom: 0px;
label{
@ -45,6 +45,7 @@
.sortableList {
overflow: hidden;
max-height: 116px;
margin-bottom: -9px;
> ul {
margin: 4px -20px 0;

View File

@ -345,11 +345,9 @@ function appReducer(state = initialState, action) {
return removeColsLine(newManager, newList);
})
.update('shouldResetGrid', v => !v);
case ON_REMOVE_EDIT_VIEW_RELATION_ATTR: {
const relationName = state.getIn(['modifiedSchema', 'models', ...action.keys.split('.'), action.index]);
case ON_REMOVE_EDIT_VIEW_RELATION_ATTR:
return state
.updateIn(['modifiedSchema', 'models', action.keys.split('.')[0], 'relations', relationName], relation => {
.updateIn(['modifiedSchema', 'models', ...action.keys.split('.')], relation => {
return relation
.update('description', () => '')
.update('label', () => upperFirst(relation.get('alias')));
@ -357,7 +355,6 @@ function appReducer(state = initialState, action) {
.updateIn(['modifiedSchema', 'models'].concat(action.keys.split('.')), list => {
return list.delete(action.index);
});
}
case ON_RESET:
return state.update('modifiedSchema', () => state.get('schema'));
case SUBMIT_SUCCEEDED:

View File

@ -79,6 +79,7 @@
"didCheckErrors": false,
"errors": [],
"name": "sortable",
"style": { "marginTop": "18px" },
"type": "toggle",
"validations": {}
}
@ -142,7 +143,6 @@
"didCheckErrors": false,
"errors": [],
"name": "placeholder",
"placeholder": "content-manager.form.Input.placeholder.placeholder",
"type": "string",
"validations": {}
}

View File

@ -413,10 +413,18 @@ class SettingPage extends React.PureComponent {
return this.getRelations().length > 0;
}
// We need to remove the Over state on the DraggableAttr component
updateSiblingHoverState = () => {
this.setState(prevState => ({ isDraggingSibling: !prevState.isDraggingSibling }));
};
shouldDisplayCursorNotAllowed = (dropdownType) => {
switch (dropdownType) {
case 'list':
return this.getDropDownItems().length === 0;
case 'relations':
return this.getDropDownRelationsItems().length === 0;
case 'fields':
return this.getDropDownFieldItems().length === 0;
default:
return false;
}
}
toggle = () => this.setState(prevState => ({ showWarning: !prevState.showWarning }));
@ -440,6 +448,11 @@ class SettingPage extends React.PureComponent {
}
}
// We need to remove the Over state on the DraggableAttr component
updateSiblingHoverState = () => {
this.setState(prevState => ({ isDraggingSibling: !prevState.isDraggingSibling }));
};
renderDraggableAttrEditSettingsField = (attr, index) => {
return (
<VariableDraggableAttr
@ -675,7 +688,7 @@ class SettingPage extends React.PureComponent {
<Block
description="content-manager.containers.SettingPage.listSettings.description"
title="content-manager.containers.SettingPage.listSettings.title"
style={{ marginBottom: '25px' }}
style={{ marginBottom: '13px', paddingBottom: '30px' }}
>
<div className={styles.ctmForm}>
<div className="row">
@ -703,7 +716,15 @@ class SettingPage extends React.PureComponent {
<div className="col-md-5">
{this.getListDisplay().map(this.renderDraggableAttrListSettings)}
<div className={cn(styles.dropdownWrapper, isOpen && styles.dropdownWrapperOpen)}>
<div
className={
cn(
styles.dropdownWrapper,
isOpen && styles.dropdownWrapperOpen,
this.shouldDisplayCursorNotAllowed('list') && styles.dropDownNotAllowed,
)
}
>
<ButtonDropdown isOpen={isOpen} toggle={this.toggleDropdown}>
<DropdownToggle>
<FormattedMessage id="content-manager.containers.SettingPage.addField">
@ -734,6 +755,7 @@ class SettingPage extends React.PureComponent {
<Block
description="content-manager.containers.SettingPage.editSettings.description"
title="content-manager.containers.SettingPage.editSettings.title"
style={{ paddingBottom: '30px' }}
>
<div className="row">
<div className={cn('col-md-8', styles.draggedDescription, styles.edit_settings)}>
@ -743,7 +765,16 @@ class SettingPage extends React.PureComponent {
<div className={cn('row', styles.noPadding)}>
{this.getEditPageDisplayedFields().map(this.renderDraggableAttrEditSettingsField)}
<div className={cn('col-md-6')}>
<div className={cn(styles.dropdownRelations, styles.dropdownWrapper)}>
<div
className={
cn(
styles.dropdownRelations,
styles.dropdownWrapper,
isOpenField && styles.dropdownWrapperOpen,
this.shouldDisplayCursorNotAllowed('fields') && styles.dropDownNotAllowed,
)
}
>
<ButtonDropdown isOpen={isOpenField} toggle={this.toggleDropDownFields}>
<DropdownToggle>
<FormattedMessage id="content-manager.containers.SettingPage.addField">
@ -769,10 +800,19 @@ class SettingPage extends React.PureComponent {
{/* DRAGGABLE BLOCK */}
{this.getEditPageDisplayedRelations().map(this.renderDraggableAttrEditSettingsRelation)}
{/* DRAGGABLE BLOCK */}
<div className={cn(styles.dropdownRelations, styles.dropdownWrapper, isOpenRelation && styles.dropdownWrapperOpen)}>
<div
className={
cn(
styles.dropdownRelations,
styles.dropdownWrapper,
isOpenRelation && styles.dropdownWrapperOpen,
this.shouldDisplayCursorNotAllowed('relations') && styles.dropDownNotAllowed
)
}
>
<ButtonDropdown isOpen={isOpenRelation} toggle={this.toggleDropdownRelations}>
<DropdownToggle>
<FormattedMessage id="content-manager.containers.SettingPage.addField">
<FormattedMessage id="content-manager.containers.SettingPage.addRelationalField">
{this.renderDropDownP}
</FormattedMessage>
</DropdownToggle>

View File

@ -59,6 +59,14 @@
border-radius: 2px;
}
.dropDownNotAllowed {
> div {
> button {
cursor: not-allowed !important;
}
}
}
.dropdownWrapper {
margin-left: 29px;
> div {
@ -112,13 +120,21 @@
padding: 0;
border-top-left-radius: 0 !important;
border-top-right-radius: 0;
border-color: #AED4FB !important;
border-color: #E3E9F3 !important;
border-top-color: #AED4FB !important;
box-shadow: 0 2px 2px #E3E9F3;
overflow: scroll;
button {
height: 27px;
padding-left: 10px !important;
line-height: 18px;
cursor: pointer;
font-size: 13px !important;
&:hover {
background-color: #FAFAFB !important;
}
div {
margin: 0;
white-space: nowrap;
@ -145,6 +161,7 @@
margin-top: 7px;
margin-bottom: 10px;
padding-top: 10px;
padding-left: 15px !important;
border: 1px dashed #E3E9F3;
border-radius: 2px;
> div {
@ -160,9 +177,11 @@
.noPadding {
padding: 0 !important;
padding-right: 10px !important;
> div {
padding-left: 8px;
padding-left: 10px;
padding-right: 0px;
}
}

View File

@ -48,7 +48,7 @@
"form.Input.disabled": "Editable field",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"notification.error.relationship.fetch": "حدث خطأ أثناء جلب العلاقة.",

View File

@ -64,7 +64,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"EditRelations.title": "Relationale Daten",
@ -95,7 +95,7 @@
"form.Input.disabled": "Editable field",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"notification.error.relationship.fetch": "Beim Abruf von Beziehungen ist ein Fehler aufgetreten.",
"notification.info.SettingPage.disableSort": "Du musst ein Attribut mit aktivierter Sortierung haben.",

View File

@ -19,12 +19,13 @@
"containers.List.errorFetchRecords": "Error",
"containers.SettingPage.addField": "Add new field",
"containers.SettingPage.addRelationalField": "Add new relational field",
"containers.SettingPage.attributes": "Attributes fields",
"containers.SettingPage.attributes.description": "Define the order of the attributes",
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"containers.SettingPage.listSettings.title": "List — Settings",
"containers.SettingPage.listSettings.description": "Configure the options for this content type",
@ -99,7 +100,7 @@
"form.Input.description": "Description",
"form.Input.placeholder": "Placeholder",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.placeholder.placeholder": "My awesome value",
"form.Input.disabled": "Editable field",
"form.Input.label.inputDescription": "This value overrides the label displayed in the table's head",

View File

@ -19,6 +19,7 @@
"containers.List.errorFetchRecords": "Erreur",
"containers.SettingPage.addField": "Ajouter un nouveau champs",
"containers.SettingPage.addRelationalField": "Ajouter un nouveau champs relationnel",
"containers.SettingPage.attributes": "Attributs",
"containers.SettingPage.attributes.description": "Organiser les attributs du modèle",
"containers.SettingPage.relations": "Champs relationnels",
@ -26,7 +27,7 @@
"containers.SettingPage.pluginHeaderDescription": "Configurez les paramètres de ce modèle",
"containers.SettingPage.editSettings.description": "Glissez & déposez les champs pour construire le layout",
"containers.SettingPage.editSettings.title": "Edit - Paramètres",
"containers.SettingPage.editSettings.title": "Edit Paramètres",
"containers.SettingPage.listSettings.title": "Liste — Paramètres",
"containers.SettingPage.listSettings.description": "Configurez les options de ce modèle",
@ -98,7 +99,7 @@
"form.Input.description": "Description",
"form.Input.placeholder": "Placeholder",
"form.Input.description.placeholder": "N'oubliez pas de mettre l'URL complète!",
"form.Input.description.placeholder": "Afficher le nom dans le profile",
"form.Input.placeholder.placeholder": "Mon super placeholder",
"form.Input.disabled": "Champ editable",
"form.Input.label": "Label",

View File

@ -17,7 +17,7 @@
"containers.SettingPage.addField" : "Aggiungi un nuovo campo",
"containers.SettingPage.attributes" : "Attributi",
"containers.SettingPage.attributes.description" : "Definisci l'ordine degli attributi",
"containers.SettingPage.listSettings.title" : "Lista - Impostazioni",
"containers.SettingPage.listSettings.title" : "Lista Impostazioni",
"containers.SettingPage.listSettings.description" : "Configura le opzioni per questo Tipo di Contenuto",
"containers.SettingPage.pluginHeaderDescription" : "Configura le impostazioni specifiche per questo Tipo di Contenuto",
"containers.SettingsPage.pluginHeaderDescription" : "Configura le impostazioni di default per tutti i tuoi Tipi di Contenuto",
@ -82,7 +82,7 @@
"error.validation.minSupMax": "Non può essere superiore",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"form.Input.label.inputDescription" : "Questo valore sovrascrive l'etichetta mostrata nell'intestazione della tabella",

View File

@ -18,7 +18,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"components.AddFilterCTA.add": "필터",
"components.AddFilterCTA.hide": "필터",
@ -77,7 +77,7 @@
"error.validation.json": "JSON 형식이 아닙니다.",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "데이터 관계를 가져오는 도중 에러가 발생했습니다.",

View File

@ -18,7 +18,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"components.AddFilterCTA.add": "Filtry",
"components.AddFilterCTA.hide": "Filtry",
@ -76,7 +76,7 @@
"error.validation.minSupMax": "Nie może być większa",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "Wystąpił błąd podczas pobierania relacji.",

View File

@ -18,7 +18,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"containers.SettingPage.addField": "Adicionar campo",
"containers.SettingPage.attributes": "Atributos",

View File

@ -18,7 +18,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"components.AddFilterCTA.add": "Filtros",
"components.AddFilterCTA.hide": "Filtros",
@ -77,7 +77,7 @@
"error.validation.json": "Isto não corresponde com o formato JSON",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "Ocorreu um erro durante a busca da relação.",

View File

@ -17,7 +17,6 @@
"containers.SettingPage.addField": "Добавить новое поле",
"containers.SettingPage.attributes": "Поля атрибутов",
"containers.SettingPage.attributes.description": "Определить порядок атребутов",
"containers.SettingPage.listSettings.title": "Список — Настройки",
"containers.SettingPage.listSettings.description": "Указать порядок атрибутов",
"containers.SettingPage.listSettings.title": "Список — Настройки",
"containers.SettingPage.pluginHeaderDescription": "Отдельные настройки для этого Типа Данных",
@ -93,7 +92,7 @@
"error.validation.minSupMax": "Не может быть выше",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "Возникла ошибка при получении связей.",

View File

@ -98,7 +98,7 @@
"form.Input.defaultSort": "Varsayılan sıralama özelliği",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "İlişki getirme sırasında bir hata oluştu.",

View File

@ -18,7 +18,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"EditRelations.title": "关系数据",
@ -47,7 +47,7 @@
"error.validation.minSupMax": "最小值大于最大值。",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "获取关联数据时发生错误",

View File

@ -19,7 +19,7 @@
"containers.SettingPage.relations": "Relational fields",
"containers.SettingPage.editSettings.description": "Drag & drop the fields to build the layout",
"containers.SettingPage.editSettings.title": "Edit - Settings",
"containers.SettingPage.editSettings.title": "Edit Settings",
"EditRelations.title": "關聯式資料",
@ -48,7 +48,7 @@
"error.validation.minSupMax": "不能大於",
"form.Input.description": "Description",
"form.Input.description.placeholder": "Please don't forget to fill the full URL!",
"form.Input.description.placeholder": "Display name in the profile",
"form.Input.disabled": "Editable field",
"notification.error.relationship.fetch": "讀取關聯資料時發生錯誤",