mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Prevent from editing or deleting models from a plugin
This commit is contained in:
parent
a4638c26ad
commit
5148987589
@ -47,7 +47,7 @@ class TableListRow extends React.Component { // eslint-disable-line react/prefer
|
||||
const temporary = this.props.rowItem.isTemporary ? <FormattedMessage id="content-type-builder.contentType.temporaryDisplay" /> : '';
|
||||
const description = isEmpty(this.props.rowItem.description) ? '-' : this.props.rowItem.description;
|
||||
const spanStyle = this.props.rowItem.isTemporary ? '60%' : '100%';
|
||||
const icons = [{ icoType: 'pencil', onClick: this.handleEdit }, { icoType: 'trash', onClick: this.handleShowModalWarning }];
|
||||
const icons = this.props.rowItem.source ? [] : [{ icoType: 'pencil', onClick: this.handleEdit }, { icoType: 'trash', onClick: this.handleShowModalWarning }];
|
||||
|
||||
return (
|
||||
<ListRow onClick={this.handleGoTo}>
|
||||
|
@ -8,7 +8,7 @@ import React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createStructuredSelector } from 'reselect';
|
||||
import { bindActionCreators, compose } from 'redux';
|
||||
import { get, has, isEmpty, size, replace, startCase, findIndex } from 'lodash';
|
||||
import { get, has, includes, isEmpty, size, replace, startCase, findIndex } from 'lodash';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
@ -290,7 +290,7 @@ export class ModelPage extends React.Component { // eslint-disable-line react/pr
|
||||
renderCustomLi={this.renderCustomLi}
|
||||
onButtonClick={this.handleClickAddAttribute}
|
||||
/>;
|
||||
|
||||
const icoType = includes(this.props.match.params.modelName, '&source=') ? '' : 'pencil';
|
||||
return (
|
||||
<div className={styles.modelPage}>
|
||||
<div className="container-fluid">
|
||||
@ -306,7 +306,7 @@ export class ModelPage extends React.Component { // eslint-disable-line react/pr
|
||||
<ContentHeader
|
||||
name={this.props.modelPage.model.name}
|
||||
description={contentHeaderDescription}
|
||||
icoType="pencil"
|
||||
icoType={icoType}
|
||||
editIcon
|
||||
editPath={`${redirectRoute}/${this.props.match.params.modelName}#edit${this.props.match.params.modelName}::contentType::baseSettings`}
|
||||
addButtons={addButtons}
|
||||
|
Loading…
x
Reference in New Issue
Block a user