mirror of
https://github.com/strapi/strapi.git
synced 2025-08-09 01:07:27 +00:00
Merge branch 'plugin/content-type-builder-dev' of github.com:strapi/strapi into plugin/content-type-builder-dev
This commit is contained in:
commit
2e534cd64d
@ -101,11 +101,11 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
handleChangeCheckbox = (e) => {
|
handleChangeCheckbox = () => {
|
||||||
const target = {
|
const target = {
|
||||||
type: e.target.type,
|
type: 'checkbox',
|
||||||
value: !this.props.value,
|
value: !this.props.value,
|
||||||
name: e.target.name,
|
name: this.props.name,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.props.handleChange({ target });
|
this.props.handleChange({ target });
|
||||||
@ -137,8 +137,8 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
|
|||||||
{title}
|
{title}
|
||||||
<FormattedMessage id={this.props.label}>
|
<FormattedMessage id={this.props.label}>
|
||||||
{(message) => (
|
{(message) => (
|
||||||
<label className={`${styles.checkboxLabel} form-check-label`} htmlFor={this.props.label}>
|
<label className={`${styles.checkboxLabel} form-check-label`} htmlFor={this.props.label} onClick={this.handleChangeCheckbox} style={{ cursor: 'pointer' }}>
|
||||||
<input className="form-check-input" type="checkbox" defaultChecked={this.props.value} onChange={this.handleChangeCheckbox} name={this.props.name} />
|
<input className="form-check-input" type="checkbox" checked={this.props.value} name={this.props.name} />
|
||||||
{message}
|
{message}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
|
@ -97,6 +97,7 @@
|
|||||||
color: #9EA7B8;
|
color: #9EA7B8;
|
||||||
font-family: Lato;
|
font-family: Lato;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,6 +110,7 @@
|
|||||||
color: #9EA7B8;
|
color: #9EA7B8;
|
||||||
font-family: Lato;
|
font-family: Lato;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,6 +121,7 @@
|
|||||||
color: #9EA7B8;
|
color: #9EA7B8;
|
||||||
font-family: Lato;
|
font-family: Lato;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,11 +12,11 @@ import Input from 'components/Input';
|
|||||||
import styles from './styles.scss';
|
import styles from './styles.scss';
|
||||||
|
|
||||||
class InputCheckboxWithNestedInputs extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
class InputCheckboxWithNestedInputs extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
||||||
handleChange = (e) => {
|
handleChange = () => {
|
||||||
const target = {
|
const target = {
|
||||||
type: e.target.type,
|
type: 'checkbox',
|
||||||
value: !this.props.value[this.props.data.name.split('.')[1]],
|
value: !this.props.value[this.props.data.name.split('.')[1]],
|
||||||
name: e.target.name,
|
name: this.props.data.name,
|
||||||
};
|
};
|
||||||
this.props.handleChange({ target });
|
this.props.handleChange({ target });
|
||||||
}
|
}
|
||||||
@ -61,8 +61,8 @@ class InputCheckboxWithNestedInputs extends React.Component { // eslint-disable-
|
|||||||
{title}
|
{title}
|
||||||
<FormattedMessage id={this.props.data.label}>
|
<FormattedMessage id={this.props.data.label}>
|
||||||
{(message) => (
|
{(message) => (
|
||||||
<label className={`${styles.checkboxLabel} form-check-label`} htmlFor={this.props.data.label}>
|
<label className={`${styles.checkboxLabel} form-check-label`} htmlFor={this.props.data.label} onClick={this.handleChange} style={{ cursor: 'pointer' }}>
|
||||||
<input className="form-check-input" type="checkbox" defaultChecked={this.props.value[this.props.data.name.split('.')[1]]} onChange={this.handleChange} name={this.props.data.name} />
|
<input className="form-check-input" type="checkbox" checked={this.props.value[this.props.data.name.split('.')[1]]} name={this.props.data.name} />
|
||||||
{message}
|
{message}
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
|
@ -42,7 +42,7 @@ li:not(:first-child) {
|
|||||||
color: #2D3138 !important;
|
color: #2D3138 !important;
|
||||||
> div {
|
> div {
|
||||||
> i {
|
> i {
|
||||||
color: #2D3138;
|
color: #2D3138 !important
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ class PopUpHeaderNavLink extends React.Component { // eslint-disable-line react/
|
|||||||
const activeClass = includes(this.props.routePath, this.props.name) ? styles.popUpHeaderNavLink : '';
|
const activeClass = includes(this.props.routePath, this.props.name) ? styles.popUpHeaderNavLink : '';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={activeClass} onClick={this.goTo}>
|
<div className={activeClass} onClick={this.goTo} style={{ cursor: 'pointer' }}>
|
||||||
<FormattedMessage id={this.props.message} />
|
<FormattedMessage id={this.props.message} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
.input {
|
.input {
|
||||||
> div {
|
> div {
|
||||||
> label {
|
> label {
|
||||||
font-weight: 600;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import { modelsFetchSucceeded } from './actions';
|
|||||||
export function* deleteContentType(action) {
|
export function* deleteContentType(action) {
|
||||||
try {
|
try {
|
||||||
if (action.sendRequest) {
|
if (action.sendRequest) {
|
||||||
const requestUrl = `content-type-builder/models/${action.itemToDelete}`;
|
const requestUrl = `/content-type-builder/models/${action.itemToDelete}`;
|
||||||
|
|
||||||
yield call(request, requestUrl, { method: 'DELETE' });
|
yield call(request, requestUrl, { method: 'DELETE' });
|
||||||
}
|
}
|
||||||
|
@ -151,6 +151,7 @@ export function setAttributeForm(hash) {
|
|||||||
nature: 'oneToOne',
|
nature: 'oneToOne',
|
||||||
required: false,
|
required: false,
|
||||||
unique: false,
|
unique: false,
|
||||||
|
dominant: false,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
const attribute = includes(hash, 'attributerelation') ? attributeRelation : data.attribute;
|
const attribute = includes(hash, 'attributerelation') ? attributeRelation : data.attribute;
|
||||||
@ -248,6 +249,7 @@ function setAttributeFormData(hash) {
|
|||||||
params: Map({
|
params: Map({
|
||||||
type,
|
type,
|
||||||
required: false,
|
required: false,
|
||||||
|
unique: false,
|
||||||
maxLength: false,
|
maxLength: false,
|
||||||
minLength: false,
|
minLength: false,
|
||||||
min: false,
|
min: false,
|
||||||
|
@ -498,7 +498,7 @@
|
|||||||
"type": "checkbox",
|
"type": "checkbox",
|
||||||
"value": false,
|
"value": false,
|
||||||
"validations": {},
|
"validations": {},
|
||||||
"inputDescription": "content-type-builder.orm.attribute.item.uniqueField.description"
|
"inputDescription": "content-type-builder.form.attribute.item.uniqueField.description"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "content-type-builder.form.attribute.item.customColumnName",
|
"label": "content-type-builder.form.attribute.item.customColumnName",
|
||||||
|
@ -381,6 +381,11 @@ export class Form extends React.Component { // eslint-disable-line react/prefer-
|
|||||||
|
|
||||||
if (includes(this.props.hash.split('::')[1], 'attribute')) {
|
if (includes(this.props.hash.split('::')[1], 'attribute')) {
|
||||||
this.props.changeInputAttribute(target.name, value);
|
this.props.changeInputAttribute(target.name, value);
|
||||||
|
|
||||||
|
if (target.name === 'params.nature' && target.value === "manyToMany") {
|
||||||
|
this.props.changeInputAttribute('params.dominant', true);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.props.changeInput(target.name, value, includes(this.props.hash, 'edit'));
|
this.props.changeInput(target.name, value, includes(this.props.hash, 'edit'));
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ export default function setParallelAttribute(newAttribute) {
|
|||||||
parallelAttribute.params.key = newAttribute.name;
|
parallelAttribute.params.key = newAttribute.name;
|
||||||
parallelAttribute.params.columnName = newAttribute.params.targetColumnName;
|
parallelAttribute.params.columnName = newAttribute.params.targetColumnName;
|
||||||
parallelAttribute.params.targetColumnName = newAttribute.params.columnName;
|
parallelAttribute.params.targetColumnName = newAttribute.params.columnName;
|
||||||
|
parallelAttribute.params.dominant = false;
|
||||||
return parallelAttribute;
|
return parallelAttribute;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -174,6 +174,7 @@ function setParallelAttribute(data) {
|
|||||||
parallelAttribute.name = data.params.key;
|
parallelAttribute.name = data.params.key;
|
||||||
parallelAttribute.params.columnName = data.params.targetColumnName;
|
parallelAttribute.params.columnName = data.params.targetColumnName;
|
||||||
parallelAttribute.params.targetColumnName = data.params.columnName;
|
parallelAttribute.params.targetColumnName = data.params.columnName;
|
||||||
|
parallelAttribute.params.dominant = false;
|
||||||
|
|
||||||
return parallelAttribute;
|
return parallelAttribute;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user