mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +00:00
model page clean
This commit is contained in:
parent
d0d2198ad2
commit
8b9eeee3a3
@ -27,11 +27,6 @@ import {
|
|||||||
|
|
||||||
import pluginId from '../../pluginId';
|
import pluginId from '../../pluginId';
|
||||||
|
|
||||||
import AttributeLi from '../../components/AttributeLi';
|
|
||||||
import Block from '../../components/Block';
|
|
||||||
import Flex from '../../components/Flex';
|
|
||||||
import ListTitle from '../../components/ListTitle';
|
|
||||||
import Ul from '../../components/Ul';
|
|
||||||
import ListRow from '../../components/ListRow';
|
import ListRow from '../../components/ListRow';
|
||||||
|
|
||||||
import AttributeForm from '../AttributeForm';
|
import AttributeForm from '../AttributeForm';
|
||||||
@ -497,20 +492,6 @@ export class ModelPage extends React.Component {
|
|||||||
`${pluginId}.notification.info.contentType.creating.notSaved`
|
`${pluginId}.notification.info.contentType.creating.notSaved`
|
||||||
);
|
);
|
||||||
|
|
||||||
renderLi = attribute => {
|
|
||||||
const attributeInfos = get(this.getModelAttributes(), attribute, {});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<AttributeLi
|
|
||||||
key={attribute}
|
|
||||||
name={attribute}
|
|
||||||
attributeInfos={attributeInfos}
|
|
||||||
onClick={this.handleClickEditAttribute}
|
|
||||||
onClickOnTrashIcon={this.handleClickOnTrashIcon}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
renderListRow = attribute => {
|
renderListRow = attribute => {
|
||||||
const { canOpenModal } = this.props;
|
const { canOpenModal } = this.props;
|
||||||
const attributeInfos = get(this.getModelAttributes(), attribute, {});
|
const attributeInfos = get(this.getModelAttributes(), attribute, {});
|
||||||
@ -631,52 +612,6 @@ export class ModelPage extends React.Component {
|
|||||||
<div className="list-button">
|
<div className="list-button">
|
||||||
<Button {...buttonProps} />
|
<Button {...buttonProps} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Block>
|
|
||||||
<Flex>
|
|
||||||
<ListTitle>
|
|
||||||
{this.getModelAttributesLength()}
|
|
||||||
|
|
||||||
<FormattedMessage
|
|
||||||
id={`${listTitleMessageIdBasePrefix}.${
|
|
||||||
this.getModelAttributesLength() > 1
|
|
||||||
? 'plural'
|
|
||||||
: 'singular'
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
{this.getModelRelationShipsLength() > 0 && (
|
|
||||||
<React.Fragment>
|
|
||||||
|
|
||||||
<FormattedMessage
|
|
||||||
id={`${listTitleMessageIdBasePrefix}.including`}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{this.getModelRelationShipsLength()}
|
|
||||||
|
|
||||||
<FormattedMessage
|
|
||||||
id={`${pluginId}.modelPage.contentType.list.relationShipTitle.${
|
|
||||||
this.getModelRelationShipsLength() > 1
|
|
||||||
? 'plural'
|
|
||||||
: 'singular'
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
</React.Fragment>
|
|
||||||
)}
|
|
||||||
</ListTitle>
|
|
||||||
<div>
|
|
||||||
<Button
|
|
||||||
label={`${pluginId}.button.attributes.add`}
|
|
||||||
onClick={this.handleClickOpenModalChooseAttributes}
|
|
||||||
secondaryHotlineAdd
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</Flex>
|
|
||||||
<div>
|
|
||||||
<Ul id="attributesList">
|
|
||||||
{Object.keys(this.getModelAttributes()).map(this.renderLi)}
|
|
||||||
</Ul>
|
|
||||||
</div>
|
|
||||||
</Block>
|
|
||||||
</ListWrapper>
|
</ListWrapper>
|
||||||
)}
|
)}
|
||||||
</ViewContainer>
|
</ViewContainer>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user