mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
Generate relation attribute in right order and fix select on relation modal
This commit is contained in:
parent
bb2c62aa7e
commit
00c77824a9
@ -45,7 +45,7 @@ class RelationBox extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
{map(this.props.dropDownItems, (value, key) => {
|
{map(this.props.dropDownItems, (value, key) => {
|
||||||
const divStyle = get(this.props.header, 'name') === value.name ? { color: '#323740', fontWeight: 'bold'} : { color: 'rgba(50,55,64, 0.75)'};
|
const divStyle = get(this.props.header, 'name') === value.name ? { color: '#323740', fontWeight: 'bold'} : { color: 'rgba(50,55,64, 0.75)'};
|
||||||
return (
|
return (
|
||||||
<div style={{ height: '3.8rem'}} key={key}>
|
<div style={{ height: '3.6rem'}} key={key}>
|
||||||
<DropdownItem onClick={this.handleClick} id={value.name}>
|
<DropdownItem onClick={this.handleClick} id={value.name}>
|
||||||
<div style={divStyle} id={value.name}>
|
<div style={divStyle} id={value.name}>
|
||||||
<i className={`fa ${value.icon}`} style={divStyle} />
|
<i className={`fa ${value.icon}`} style={divStyle} />
|
||||||
|
@ -21,12 +21,12 @@
|
|||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
display: block;
|
display: block;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
overflow: visible;
|
||||||
|
|
||||||
> i {
|
> i {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
color: rgba(50, 55, 64, 0.75);
|
color: #323740;
|
||||||
font-size: 1.3rem;
|
font-size: 1.3rem;
|
||||||
font-weight: 100;
|
font-weight: 100;
|
||||||
}
|
}
|
||||||
@ -48,16 +48,17 @@
|
|||||||
.dropDown {
|
.dropDown {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
top: .5rem;
|
top: 0; left: 0;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
> button {
|
> button {
|
||||||
|
cursor: pointer;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
cursor: pointer;
|
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -82,28 +83,33 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropDownContent {
|
.dropDownContent {
|
||||||
top: 102%;
|
top: 100%;
|
||||||
// left: -18.2rem;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border: none;
|
border: none;
|
||||||
font-family: Lato;
|
font-family: Lato;
|
||||||
|
box-shadow: 0 2px 4px rgba(203, 211, 224, .5);
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
min-width: 21.5rem;
|
min-width: 21.5rem;
|
||||||
|
|
||||||
> button {
|
> button {
|
||||||
|
padding: 0 15px;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
border-bottom: 1px solid #F6F6F6;
|
|
||||||
font-family: Lato;
|
|
||||||
text-transform: capitalize;
|
|
||||||
font-size: 1.3rem;
|
|
||||||
color: rgba(50, 55, 64, 0.75);
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
border-bottom: 1px solid #F6F6F6;
|
||||||
|
font-size: 1.3rem;
|
||||||
|
font-family: Lato;
|
||||||
|
font-weight: 400;
|
||||||
|
text-transform: capitalize;
|
||||||
|
color: #323740;
|
||||||
|
|
||||||
> i {
|
> i {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
color: rgba(50, 55, 64, 0.75);
|
font-size: 1.2rem;
|
||||||
font-size: 1.3rem;
|
font-weight: 100 !important;
|
||||||
font-weight: 100;
|
color: #323740;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -136,8 +136,7 @@ module.exports = {
|
|||||||
const attr = {
|
const attr = {
|
||||||
required: relation.required,
|
required: relation.required,
|
||||||
columnName: relation.columnName,
|
columnName: relation.columnName,
|
||||||
unique: relation.unique,
|
unique: relation.unique
|
||||||
via: relation.key
|
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (relation.nature) {
|
switch (relation.nature) {
|
||||||
@ -152,6 +151,8 @@ module.exports = {
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attr.via = relation.key;
|
||||||
|
|
||||||
attrs[attribute.name] = attr;
|
attrs[attribute.name] = attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user