|
|
@ -9,10 +9,6 @@ import ConfirmModal from 'Components/Modal/ConfirmModal';
|
|
|
|
import EditReleaseProfileModalConnector from './EditReleaseProfileModalConnector';
|
|
|
|
import EditReleaseProfileModalConnector from './EditReleaseProfileModalConnector';
|
|
|
|
import styles from './ReleaseProfile.css';
|
|
|
|
import styles from './ReleaseProfile.css';
|
|
|
|
|
|
|
|
|
|
|
|
function sortPreferred(preferred) {
|
|
|
|
|
|
|
|
return preferred.slice().sort((a, b) => b.value - a.value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ReleaseProfile extends Component {
|
|
|
|
class ReleaseProfile extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -22,20 +18,11 @@ class ReleaseProfile extends Component {
|
|
|
|
super(props, context);
|
|
|
|
super(props, context);
|
|
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
sortedPreferred: sortPreferred(props.preferred),
|
|
|
|
|
|
|
|
isEditReleaseProfileModalOpen: false,
|
|
|
|
isEditReleaseProfileModalOpen: false,
|
|
|
|
isDeleteReleaseProfileModalOpen: false
|
|
|
|
isDeleteReleaseProfileModalOpen: false
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
|
|
|
const { preferred } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (prevProps.preferred !== preferred) {
|
|
|
|
|
|
|
|
this.setState({ sortedPreferred: sortPreferred(preferred) });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Listeners
|
|
|
|
// Listeners
|
|
|
|
|
|
|
|
|
|
|
@ -70,12 +57,12 @@ class ReleaseProfile extends Component {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
|
required,
|
|
|
|
required,
|
|
|
|
ignored,
|
|
|
|
ignored,
|
|
|
|
|
|
|
|
preferred,
|
|
|
|
tags,
|
|
|
|
tags,
|
|
|
|
tagList
|
|
|
|
tagList
|
|
|
|
} = this.props;
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
sortedPreferred,
|
|
|
|
|
|
|
|
isEditReleaseProfileModalOpen,
|
|
|
|
isEditReleaseProfileModalOpen,
|
|
|
|
isDeleteReleaseProfileModalOpen
|
|
|
|
isDeleteReleaseProfileModalOpen
|
|
|
|
} = this.state;
|
|
|
|
} = this.state;
|
|
|
@ -126,7 +113,7 @@ class ReleaseProfile extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sortedPreferred.map((item) => {
|
|
|
|
preferred.map((item) => {
|
|
|
|
const isPreferred = item.value >= 0;
|
|
|
|
const isPreferred = item.value >= 0;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|