From 106085cb6377f5ff5613076a89c181011ee33a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 3 Apr 2019 20:28:46 +0200 Subject: [PATCH] chore: remove unleash.beta.variants flag --- frontend/CHANGELOG.md | 1 + .../view-component-test.jsx.snap | 5 +++ .../feature/__tests__/view-component-test.jsx | 1 - .../src/component/feature/view-component.jsx | 33 ++----------------- .../src/component/feature/view-container.jsx | 5 --- 5 files changed, 8 insertions(+), 37 deletions(-) diff --git a/frontend/CHANGELOG.md b/frontend/CHANGELOG.md index 40a3f52435..6728c4f5ba 100644 --- a/frontend/CHANGELOG.md +++ b/frontend/CHANGELOG.md @@ -9,6 +9,7 @@ The latest version of this document is always available in ## [3.2.3] - fix: Cleanup logut flow +- chore: remove unleash.beta.variants flag ## [3.2.2] - fix: Use toggle/on/off endoints to ensure correct state diff --git a/frontend/src/component/feature/__tests__/__snapshots__/view-component-test.jsx.snap b/frontend/src/component/feature/__tests__/__snapshots__/view-component-test.jsx.snap index 5fbbfe5201..7eacca3a01 100644 --- a/frontend/src/component/feature/__tests__/__snapshots__/view-component-test.jsx.snap +++ b/frontend/src/component/feature/__tests__/__snapshots__/view-component-test.jsx.snap @@ -97,6 +97,11 @@ exports[`renders correctly with one feature 1`] = ` > Metrics + + Variants + diff --git a/frontend/src/component/feature/__tests__/view-component-test.jsx b/frontend/src/component/feature/__tests__/view-component-test.jsx index b672e5e08d..921549ce29 100644 --- a/frontend/src/component/feature/__tests__/view-component-test.jsx +++ b/frontend/src/component/feature/__tests__/view-component-test.jsx @@ -32,7 +32,6 @@ test('renders correctly with one feature', () => { activeTab={'strategies'} featureToggleName="another" features={[feature]} - betaFlags={[]} featureToggle={feature} fetchFeatureToggles={jest.fn()} history={{}} diff --git a/frontend/src/component/feature/view-component.jsx b/frontend/src/component/feature/view-component.jsx index 22d4300e19..17f99d488a 100644 --- a/frontend/src/component/feature/view-component.jsx +++ b/frontend/src/component/feature/view-component.jsx @@ -1,18 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { - Tabs, - Tab, - ProgressBar, - Button, - Card, - CardText, - CardTitle, - CardActions, - Textfield, - Switch, - Badge, -} from 'react-mdl'; +import { Tabs, Tab, ProgressBar, Button, Card, CardText, CardTitle, CardActions, Textfield, Switch } from 'react-mdl'; import { Link } from 'react-router-dom'; import HistoryComponent from '../history/history-list-toggle-container'; @@ -41,7 +29,6 @@ export default class ViewFeatureToggleComponent extends React.Component { activeTab: PropTypes.string.isRequired, featureToggleName: PropTypes.string.isRequired, features: PropTypes.array.isRequired, - betaFlags: PropTypes.array, toggleFeature: PropTypes.func, removeFeatureToggle: PropTypes.func, revive: PropTypes.func, @@ -53,10 +40,6 @@ export default class ViewFeatureToggleComponent extends React.Component { hasPermission: PropTypes.func.isRequired, }; - static defaultProps = { - betaFlags: [], - }; - componentWillMount() { if (this.props.features.length === 0) { if (this.isFeatureView) { @@ -102,7 +85,6 @@ export default class ViewFeatureToggleComponent extends React.Component { const { featureToggle, features, - betaFlags, activeTab, revive, // setValue, @@ -112,9 +94,6 @@ export default class ViewFeatureToggleComponent extends React.Component { hasPermission, } = this.props; - // TODO: Find better solution for this - const showVariants = betaFlags.includes('unleash.beta.variants'); - if (!featureToggle) { if (features.length === 0) { return ; @@ -249,15 +228,7 @@ export default class ViewFeatureToggleComponent extends React.Component { > this.goToTab('strategies', featureToggleName)}>Strategies this.goToTab('view', featureToggleName)}>Metrics - {showVariants ? ( - this.goToTab('variants', featureToggleName)}> - - Variants - - - ) : ( - [] - )} + this.goToTab('variants', featureToggleName)}>Variants this.goToTab('history', featureToggleName)}>History {tabContent} diff --git a/frontend/src/component/feature/view-container.jsx b/frontend/src/component/feature/view-container.jsx index 6fcd0e4734..4ed95e6309 100644 --- a/frontend/src/component/feature/view-container.jsx +++ b/frontend/src/component/feature/view-container.jsx @@ -13,11 +13,6 @@ import { hasPermission } from '../../permissions'; export default connect( (state, props) => ({ features: state.features.toJS(), - betaFlags: state.features - .toJS() - .filter(t => t.enabled) - .filter(t => t.name.startsWith('unleash.beta')) - .map(t => t.name), featureToggle: state.features.toJS().find(toggle => toggle.name === props.featureToggleName), activeTab: props.activeTab, hasPermission: hasPermission.bind(null, state.user.get('profile')),