Apply desgin feedback

This commit is contained in:
soupette 2019-03-23 08:15:06 +01:00
parent 8e672abc78
commit c1464f73be
6 changed files with 51 additions and 31 deletions

View File

@ -49,6 +49,7 @@
.modalPosition {
max-width: 37.5rem !important;
margin: 16rem auto !important;
> div {
width: 37.5rem;
padding: 0 !important;

View File

@ -1,8 +1,8 @@
/**
*
* CustomCheckbox
*
*/
*
* CustomCheckbox
*
*/
import React from 'react';
import PropTypes from 'prop-types';
@ -12,7 +12,8 @@ import InputNumber from 'components/InputNumberWithErrors';
// import styles from './styles.scss';
class CustomCheckbox extends React.Component { // eslint-disable-line react/prefer-stateless-function
class CustomCheckbox extends React.Component {
// eslint-disable-line react/prefer-stateless-function
state = { isChecked: this.props.value !== null && this.props.value !== undefined };
handleChange = ({ target: { checked } }) => {
@ -23,7 +24,7 @@ class CustomCheckbox extends React.Component { // eslint-disable-line react/pref
const target = { name, value };
onChange({ target });
}
};
handleInputNumberChange = ({ target: { value } }) => {
const { name, onChange } = this.props;
@ -34,17 +35,17 @@ class CustomCheckbox extends React.Component { // eslint-disable-line react/pref
};
onChange({ target });
}
};
render() {
const { isChecked } = this.state;
const { didCheckErrors, errors, label, name, value} = this.props;
const { didCheckErrors, errors, label, name, value } = this.props;
return (
<div className="col-md-12" style={{ marginTop: -4, marginBottom: 9 }}>
<FormattedMessage id={label.id}>
{msg => (
<label htmlFor={name} style={{ fontWeight: '500', cursor: 'pointer' }}>
<label htmlFor={name} style={{ fontWeight: '500', fontSize: 12, cursor: 'pointer' }}>
<input
style={{ marginLeft: 0, marginRight: 13 }}
checked={isChecked}
@ -90,10 +91,7 @@ CustomCheckbox.propTypes = {
}),
name: PropTypes.string,
onChange: PropTypes.func.isRequired,
value: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string,
]),
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
};
export default CustomCheckbox;

View File

@ -5,6 +5,7 @@
padding-top: .6rem;
color: #9EA7B8;
font-size: 1.2rem;
font-weight: 500;
letter-spacing: 0.7px;
text-transform: uppercase;
>div:last-child {

View File

@ -16,7 +16,11 @@ import styles from './styles.scss';
/* istanbul ignore next */
function HeaderNavLink({ custom, id, isActive, onClick }) {
return (
<div className={cn(isActive && styles.headerNavLink)} onClick={() => onClick(id)}>
<div
className={cn(isActive && styles.headerNavLink)}
style={{ cursor: 'pointer' }}
onClick={() => onClick(id)}
>
<FormattedMessage id={`${pluginId}.popUpForm.navContainer.${custom || id}`} />
</div>
);

View File

@ -17,6 +17,7 @@ import pluginId from '../../pluginId';
import styles from '../TableList/styles.scss';
/* eslint-disable jsx-a11y/no-static-element-interactions */
/* eslint-disable react/jsx-curly-brace-presence */
/* eslint-disable indent */
class TableListRow extends React.Component {
// eslint-disable-line react/prefer-stateless-function
@ -46,6 +47,18 @@ class TableListRow extends React.Component {
this.setState({ showWarning: false });
};
handleEdit = () => {
const {
push,
rowItem: { name, source },
} = this.props;
push({
pathname: `/plugins/content-type-builder/models/${name}${source ? `&source=${source}` : ''}`,
search: `modalType=model&settingType=base&actionType=edit&modelName=${name}`,
});
};
handleGoTo = () => {
const { push } = this.props;
@ -88,7 +101,10 @@ class TableListRow extends React.Component {
const spanStyle = this.props.rowItem.isTemporary ? '60%' : '100%';
const icons = this.props.rowItem.source
? []
: [{ icoType: 'trash', onClick: this.handleShowModalWarning, id: `delete${name}` }];
: [
{ icoType: 'pencil', onClick: this.handleEdit },
{ icoType: 'trash', onClick: this.handleShowModalWarning, id: `delete${name}` },
];
return (
<ListRow onClick={this.handleGoTo} style={{ height: '5.4rem' }}>

View File

@ -1,4 +1,16 @@
[
{
"type": "string",
"description": "content-type-builder.popUpForm.attributes.string.description"
},
{
"type": "text",
"description": "content-type-builder.popUpForm.attributes.text.description"
},
{
"type": "number",
"description": "content-type-builder.popUpForm.attributes.number.description"
},
{
"type": "boolean",
"description": "content-type-builder.popUpForm.attributes.boolean.description"
@ -12,8 +24,8 @@
"description": "content-type-builder.popUpForm.attributes.email.description"
},
{
"type": "enumeration",
"description": "content-type-builder.popUpForm.attributes.enumeration.description"
"type": "password",
"description": "content-type-builder.popUpForm.attributes.password.description"
},
{
"type": "json",
@ -23,24 +35,12 @@
"type": "media",
"description": "content-type-builder.popUpForm.attributes.media.description"
},
{
"type": "number",
"description": "content-type-builder.popUpForm.attributes.number.description"
},
{
"type": "password",
"description": "content-type-builder.popUpForm.attributes.password.description"
},
{
"type": "relation",
"description": "content-type-builder.popUpForm.attributes.relation.description"
},
{
"type": "string",
"description": "content-type-builder.popUpForm.attributes.string.description"
},
{
"type": "text",
"description": "content-type-builder.popUpForm.attributes.text.description"
"type": "enumeration",
"description": "content-type-builder.popUpForm.attributes.enumeration.description"
}
]