|
|
@ -1,6 +1,8 @@
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import MiddleTruncate from 'react-middle-truncate';
|
|
|
|
import Card from 'Components/Card';
|
|
|
|
import Card from 'Components/Card';
|
|
|
|
|
|
|
|
import Label from 'Components/Label';
|
|
|
|
import IconButton from 'Components/Link/IconButton';
|
|
|
|
import IconButton from 'Components/Link/IconButton';
|
|
|
|
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
|
|
|
import ConfirmModal from 'Components/Modal/ConfirmModal';
|
|
|
|
import { icons, kinds } from 'Helpers/Props';
|
|
|
|
import { icons, kinds } from 'Helpers/Props';
|
|
|
@ -64,6 +66,9 @@ class MetadataProfile extends Component {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
|
|
|
|
minPopularity,
|
|
|
|
|
|
|
|
minPages,
|
|
|
|
|
|
|
|
ignored,
|
|
|
|
isDeleting
|
|
|
|
isDeleting
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
@ -86,6 +91,48 @@ class MetadataProfile extends Component {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className={styles.enabled}>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
minPopularity ?
|
|
|
|
|
|
|
|
<Label kind={kinds.DEFAULT}>
|
|
|
|
|
|
|
|
{translate('MinimumPopularity')}: {minPopularity}
|
|
|
|
|
|
|
|
</Label> :
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
minPages ?
|
|
|
|
|
|
|
|
<Label kind={kinds.DEFAULT}>
|
|
|
|
|
|
|
|
{translate('MinimumPages')}: {minPages}
|
|
|
|
|
|
|
|
</Label> :
|
|
|
|
|
|
|
|
null
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ignored.map((item) => {
|
|
|
|
|
|
|
|
if (!item) {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Label
|
|
|
|
|
|
|
|
className={styles.label}
|
|
|
|
|
|
|
|
key={item}
|
|
|
|
|
|
|
|
kind={kinds.DANGER}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<MiddleTruncate
|
|
|
|
|
|
|
|
text={item}
|
|
|
|
|
|
|
|
start={10}
|
|
|
|
|
|
|
|
end={10}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Label>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<EditMetadataProfileModalConnector
|
|
|
|
<EditMetadataProfileModalConnector
|
|
|
|
id={id}
|
|
|
|
id={id}
|
|
|
|
isOpen={this.state.isEditMetadataProfileModalOpen}
|
|
|
|
isOpen={this.state.isEditMetadataProfileModalOpen}
|
|
|
@ -111,10 +158,19 @@ class MetadataProfile extends Component {
|
|
|
|
MetadataProfile.propTypes = {
|
|
|
|
MetadataProfile.propTypes = {
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
id: PropTypes.number.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
name: PropTypes.string.isRequired,
|
|
|
|
|
|
|
|
minPopularity: PropTypes.number.isRequired,
|
|
|
|
|
|
|
|
minPages: PropTypes.number.isRequired,
|
|
|
|
|
|
|
|
ignored: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
|
|
isDeleting: PropTypes.bool.isRequired,
|
|
|
|
isDeleting: PropTypes.bool.isRequired,
|
|
|
|
onConfirmDeleteMetadataProfile: PropTypes.func.isRequired,
|
|
|
|
onConfirmDeleteMetadataProfile: PropTypes.func.isRequired,
|
|
|
|
onCloneMetadataProfilePress: PropTypes.func.isRequired
|
|
|
|
onCloneMetadataProfilePress: PropTypes.func.isRequired
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MetadataProfile.defaultProps = {
|
|
|
|
|
|
|
|
minPopularity: 0,
|
|
|
|
|
|
|
|
minPages: 0,
|
|
|
|
|
|
|
|
ignored: []
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default MetadataProfile;
|
|
|
|
export default MetadataProfile;
|
|
|
|