mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-21 13:47:39 +02:00
fix: minor strategy configure update
This commit is contained in:
parent
6715ee8af0
commit
111b2353bf
@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
The latest version of this document is always available in
|
The latest version of this document is always available in
|
||||||
[releases][releases-url].
|
[releases][releases-url].
|
||||||
|
|
||||||
|
# 3.8.1
|
||||||
|
- fix: minor CSS improvement for strategy configs
|
||||||
|
- fix: minor strategy configure update
|
||||||
|
|
||||||
# 3.8.0
|
# 3.8.0
|
||||||
- feat: Should update activation strategies immediately (#229)
|
- feat: Should update activation strategies immediately (#229)
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ export default class StrategyConfigureComponent extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super();
|
super();
|
||||||
this.state = {
|
this.state = {
|
||||||
|
constraints: props.strategy.constraints ? [...props.strategy.constraints] : [],
|
||||||
parameters: { ...props.strategy.parameters },
|
parameters: { ...props.strategy.parameters },
|
||||||
edit: false,
|
edit: false,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
@ -39,12 +40,18 @@ export default class StrategyConfigureComponent extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateParameters = parameters => {
|
updateParameters = parameters => {
|
||||||
|
const { constraints } = this.state;
|
||||||
const updatedStrategy = Object.assign({}, this.props.strategy, {
|
const updatedStrategy = Object.assign({}, this.props.strategy, {
|
||||||
parameters,
|
parameters,
|
||||||
|
constraints,
|
||||||
});
|
});
|
||||||
this.props.updateStrategy(updatedStrategy);
|
this.props.updateStrategy(updatedStrategy);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
updateConstraints = constraints => {
|
||||||
|
this.setState({ constraints, dirty: true });
|
||||||
|
};
|
||||||
|
|
||||||
updateParameter = async (field, value, forceUp = false) => {
|
updateParameter = async (field, value, forceUp = false) => {
|
||||||
const { parameters } = this.state;
|
const { parameters } = this.state;
|
||||||
parameters[field] = value;
|
parameters[field] = value;
|
||||||
@ -106,7 +113,7 @@ export default class StrategyConfigureComponent extends React.Component {
|
|||||||
|
|
||||||
const cardClasses = [styles.card];
|
const cardClasses = [styles.card];
|
||||||
if (dirty) {
|
if (dirty) {
|
||||||
cardClasses.push('mdl-color--pink-50');
|
cardClasses.push('mdl-color--purple-50');
|
||||||
}
|
}
|
||||||
if (isDragging) {
|
if (isDragging) {
|
||||||
cardClasses.push(styles.isDragging);
|
cardClasses.push(styles.isDragging);
|
||||||
@ -123,6 +130,7 @@ export default class StrategyConfigureComponent extends React.Component {
|
|||||||
<Icon name="extension" />
|
<Icon name="extension" />
|
||||||
|
|
||||||
{name}
|
{name}
|
||||||
|
{dirty ? <small> (Unsaved)</small> : ''}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
|
|
||||||
<CardText>
|
<CardText>
|
||||||
|
Loading…
Reference in New Issue
Block a user