From 111b2353bfe6e9436274ceabd6cf671cb15822e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Mon, 14 Dec 2020 21:39:22 +0100 Subject: [PATCH] fix: minor strategy configure update --- frontend/CHANGELOG.md | 4 ++++ .../feature/strategy/strategy-configure-component.jsx | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/CHANGELOG.md b/frontend/CHANGELOG.md index 49ba3ce012..6b088c99bf 100644 --- a/frontend/CHANGELOG.md +++ b/frontend/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). The latest version of this document is always available in [releases][releases-url]. +# 3.8.1 +- fix: minor CSS improvement for strategy configs +- fix: minor strategy configure update + # 3.8.0 - feat: Should update activation strategies immediately (#229) diff --git a/frontend/src/component/feature/strategy/strategy-configure-component.jsx b/frontend/src/component/feature/strategy/strategy-configure-component.jsx index 07672e4b3f..e705a696f5 100644 --- a/frontend/src/component/feature/strategy/strategy-configure-component.jsx +++ b/frontend/src/component/feature/strategy/strategy-configure-component.jsx @@ -31,6 +31,7 @@ export default class StrategyConfigureComponent extends React.Component { constructor(props) { super(); this.state = { + constraints: props.strategy.constraints ? [...props.strategy.constraints] : [], parameters: { ...props.strategy.parameters }, edit: false, dirty: false, @@ -39,12 +40,18 @@ export default class StrategyConfigureComponent extends React.Component { } updateParameters = parameters => { + const { constraints } = this.state; const updatedStrategy = Object.assign({}, this.props.strategy, { parameters, + constraints, }); this.props.updateStrategy(updatedStrategy); }; + updateConstraints = constraints => { + this.setState({ constraints, dirty: true }); + }; + updateParameter = async (field, value, forceUp = false) => { const { parameters } = this.state; parameters[field] = value; @@ -106,7 +113,7 @@ export default class StrategyConfigureComponent extends React.Component { const cardClasses = [styles.card]; if (dirty) { - cardClasses.push('mdl-color--pink-50'); + cardClasses.push('mdl-color--purple-50'); } if (isDragging) { cardClasses.push(styles.isDragging); @@ -123,6 +130,7 @@ export default class StrategyConfigureComponent extends React.Component {   {name} + {dirty ?  (Unsaved) : ''}