From 6e657314c2d55babcc907407d7920cea59af45bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Sat, 18 Apr 2020 21:50:01 +0200 Subject: [PATCH] fix: rename use of legacy react lifecyle methods replaced with "UNSAFE_*" methods. Needs to be fixed at some point. --- .../component/feature/form/flexible-rollout-strategy-input.jsx | 3 ++- .../src/component/feature/form/form-copy-feature-component.jsx | 3 ++- .../component/feature/form/form-update-feature-component.jsx | 3 ++- frontend/src/component/feature/form/strategies-section.jsx | 3 ++- frontend/src/component/feature/metric-component.jsx | 3 ++- frontend/src/component/feature/progress.jsx | 3 ++- .../src/component/feature/variant/update-variant-component.jsx | 3 ++- frontend/src/component/feature/view-component.jsx | 3 ++- frontend/src/component/menu/header.jsx | 3 ++- frontend/src/component/strategies/add-strategy.jsx | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/src/component/feature/form/flexible-rollout-strategy-input.jsx b/frontend/src/component/feature/form/flexible-rollout-strategy-input.jsx index e725a61484..92ac748834 100644 --- a/frontend/src/component/feature/form/flexible-rollout-strategy-input.jsx +++ b/frontend/src/component/feature/form/flexible-rollout-strategy-input.jsx @@ -20,7 +20,8 @@ export default class FlexibleRolloutStrategy extends Component { handleConfigChange: PropTypes.func.isRequired, }; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { const { strategy, featureToggleName } = this.props; if (!strategy.parameters.rollout) { this.setConfig('rollout', 100); diff --git a/frontend/src/component/feature/form/form-copy-feature-component.jsx b/frontend/src/component/feature/form/form-copy-feature-component.jsx index 3dfeb97464..4f37c4a0d6 100644 --- a/frontend/src/component/feature/form/form-copy-feature-component.jsx +++ b/frontend/src/component/feature/form/form-copy-feature-component.jsx @@ -17,7 +17,8 @@ class CopyFeatureComponent extends Component { this.state = { newToggleName: '', replaceGroupId: true }; } - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { // TODO unwind this stuff if (this.props.copyToggle) { this.setState({ featureToggle: this.props.copyToggle }); diff --git a/frontend/src/component/feature/form/form-update-feature-component.jsx b/frontend/src/component/feature/form/form-update-feature-component.jsx index 931756b2c0..2531dfe9fa 100644 --- a/frontend/src/component/feature/form/form-update-feature-component.jsx +++ b/frontend/src/component/feature/form/form-update-feature-component.jsx @@ -6,7 +6,8 @@ import { FormButtons } from './../../common'; class UpdateFeatureComponent extends Component { // static displayName = `UpdateFeatureComponent-{getDisplayName(Component)}`; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { // TODO unwind this stuff if (this.props.initCallRequired === true) { this.props.init(this.props.input); diff --git a/frontend/src/component/feature/form/strategies-section.jsx b/frontend/src/component/feature/form/strategies-section.jsx index 308debc184..cbf9f1ffe2 100644 --- a/frontend/src/component/feature/form/strategies-section.jsx +++ b/frontend/src/component/feature/form/strategies-section.jsx @@ -15,7 +15,8 @@ class StrategiesSectionComponent extends React.Component { fetchStrategies: PropTypes.func, }; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { this.props.fetchStrategies(); } diff --git a/frontend/src/component/feature/metric-component.jsx b/frontend/src/component/feature/metric-component.jsx index 7a16b36bd6..3cdc4e3227 100644 --- a/frontend/src/component/feature/metric-component.jsx +++ b/frontend/src/component/feature/metric-component.jsx @@ -43,7 +43,8 @@ export default class MetricComponent extends React.Component { location: PropTypes.object, }; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { this.props.fetchSeenApps(); this.props.fetchFeatureMetrics(); } diff --git a/frontend/src/component/feature/progress.jsx b/frontend/src/component/feature/progress.jsx index 638460a23c..b65a557ece 100644 --- a/frontend/src/component/feature/progress.jsx +++ b/frontend/src/component/feature/progress.jsx @@ -24,7 +24,8 @@ class Progress extends Component { } } - componentWillReceiveProps({ percentage }) { + // eslint-disable-next-line camelcase + UNSAFE_componentWillReceiveProps({ percentage }) { if (this.state.percentage !== percentage) { const nextState = { percentage }; if (this.props.animatePercentageText) { diff --git a/frontend/src/component/feature/variant/update-variant-component.jsx b/frontend/src/component/feature/variant/update-variant-component.jsx index 4ba03328ee..3b61e04ea1 100644 --- a/frontend/src/component/feature/variant/update-variant-component.jsx +++ b/frontend/src/component/feature/variant/update-variant-component.jsx @@ -12,7 +12,8 @@ class UpdateVariantComponent extends Component { super(props); } - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { // TODO unwind this stuff if (this.props.initCallRequired === true) { this.props.init(this.props.input); diff --git a/frontend/src/component/feature/view-component.jsx b/frontend/src/component/feature/view-component.jsx index 3935937a15..f656347662 100644 --- a/frontend/src/component/feature/view-component.jsx +++ b/frontend/src/component/feature/view-component.jsx @@ -41,7 +41,8 @@ export default class ViewFeatureToggleComponent extends React.Component { hasPermission: PropTypes.func.isRequired, }; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { if (this.props.features.length === 0) { if (this.isFeatureView) { this.props.fetchFeatureToggles(); diff --git a/frontend/src/component/menu/header.jsx b/frontend/src/component/menu/header.jsx index 22cf6219ee..c9a7046214 100644 --- a/frontend/src/component/menu/header.jsx +++ b/frontend/src/component/menu/header.jsx @@ -22,7 +22,8 @@ class HeaderComponent extends PureComponent { this.props.fetchContext(); } - componentWillReceiveProps(nextProps) { + // eslint-disable-next-line camelcase + UNSAFE_componentWillReceiveProps(nextProps) { if (this.props.location.pathname !== nextProps.location.pathname) { clearTimeout(this.timer); this.timer = setTimeout(() => { diff --git a/frontend/src/component/strategies/add-strategy.jsx b/frontend/src/component/strategies/add-strategy.jsx index bbc1a35b6a..642125db53 100644 --- a/frontend/src/component/strategies/add-strategy.jsx +++ b/frontend/src/component/strategies/add-strategy.jsx @@ -116,7 +116,8 @@ class AddStrategy extends Component { init: PropTypes.func, }; - componentWillMount() { + // eslint-disable-next-line camelcase + UNSAFE_componentWillMount() { // TODO unwind this stuff if (this.props.initCallRequired === true) { this.props.init(this.props.input);