Display plugin source in ctb attributerow

This commit is contained in:
cyril lopez 2017-12-15 14:21:28 +01:00
parent b260ebd9d7
commit 8d74849d9c
2 changed files with 14 additions and 3 deletions

View File

@ -67,7 +67,18 @@ class AttributeRow extends React.Component { // eslint-disable-line react/prefer
render() {
const relationType = this.props.row.params.type ?
<FormattedMessage id={`content-type-builder.attribute.${this.props.row.params.type}`} />
: <div><FormattedMessage id="content-type-builder.modelPage.attribute.relationWith" /> <span style={{ fontStyle: 'italic' }}>{capitalize(this.props.row.params.target)}</span></div>;
: (
<div>
<FormattedMessage id="content-type-builder.modelPage.attribute.relationWith" />
&nbsp;
<span style={{ fontStyle: 'italic' }}>
{capitalize(this.props.row.params.target)}&nbsp;
{this.props.row.params.pluginValue ? (
`(Plugin: ${this.props.row.params.pluginValue})`
) : ''}
</span>
</div>
);
const relationStyle = !this.props.row.params.type ? styles.relation : '';
const icons = [{ icoType: 'pencil', onClick: this.handleEdit }, { icoType: 'trash', onClick: () => this.setState({ showWarning: !this.state.showWarning }) }];

View File

@ -21,7 +21,7 @@ module.exports = {
const pluginModels = Object.keys(strapi.plugins).reduce((acc, current) => {
_.forEach(strapi.plugins[current].models, (model, name) => {
acc.push({
icon: 'fa-diamond',
icon: 'fa-cube',
name: _.get(model, 'info.name', 'model.name.missing'),
description: _.get(model, 'info.description', 'model.description.missing'),
fields: _.keys(model.attributes).length,