1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-22 01:16:07 +02:00

chore: remove unleash.beta.variants flag

This commit is contained in:
Ivar Conradi Østhus 2019-04-03 20:28:46 +02:00
parent 73881e2cd4
commit 106085cb63
5 changed files with 8 additions and 37 deletions

View File

@ -9,6 +9,7 @@ The latest version of this document is always available in
## [3.2.3] ## [3.2.3]
- fix: Cleanup logut flow - fix: Cleanup logut flow
- chore: remove unleash.beta.variants flag
## [3.2.2] ## [3.2.2]
- fix: Use toggle/on/off endoints to ensure correct state - fix: Use toggle/on/off endoints to ensure correct state

View File

@ -97,6 +97,11 @@ exports[`renders correctly with one feature 1`] = `
> >
Metrics Metrics
</react-mdl-Tab> </react-mdl-Tab>
<react-mdl-Tab
onClick={[Function]}
>
Variants
</react-mdl-Tab>
<react-mdl-Tab <react-mdl-Tab
onClick={[Function]} onClick={[Function]}
> >

View File

@ -32,7 +32,6 @@ test('renders correctly with one feature', () => {
activeTab={'strategies'} activeTab={'strategies'}
featureToggleName="another" featureToggleName="another"
features={[feature]} features={[feature]}
betaFlags={[]}
featureToggle={feature} featureToggle={feature}
fetchFeatureToggles={jest.fn()} fetchFeatureToggles={jest.fn()}
history={{}} history={{}}

View File

@ -1,18 +1,6 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { import { Tabs, Tab, ProgressBar, Button, Card, CardText, CardTitle, CardActions, Textfield, Switch } from 'react-mdl';
Tabs,
Tab,
ProgressBar,
Button,
Card,
CardText,
CardTitle,
CardActions,
Textfield,
Switch,
Badge,
} from 'react-mdl';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import HistoryComponent from '../history/history-list-toggle-container'; import HistoryComponent from '../history/history-list-toggle-container';
@ -41,7 +29,6 @@ export default class ViewFeatureToggleComponent extends React.Component {
activeTab: PropTypes.string.isRequired, activeTab: PropTypes.string.isRequired,
featureToggleName: PropTypes.string.isRequired, featureToggleName: PropTypes.string.isRequired,
features: PropTypes.array.isRequired, features: PropTypes.array.isRequired,
betaFlags: PropTypes.array,
toggleFeature: PropTypes.func, toggleFeature: PropTypes.func,
removeFeatureToggle: PropTypes.func, removeFeatureToggle: PropTypes.func,
revive: PropTypes.func, revive: PropTypes.func,
@ -53,10 +40,6 @@ export default class ViewFeatureToggleComponent extends React.Component {
hasPermission: PropTypes.func.isRequired, hasPermission: PropTypes.func.isRequired,
}; };
static defaultProps = {
betaFlags: [],
};
componentWillMount() { componentWillMount() {
if (this.props.features.length === 0) { if (this.props.features.length === 0) {
if (this.isFeatureView) { if (this.isFeatureView) {
@ -102,7 +85,6 @@ export default class ViewFeatureToggleComponent extends React.Component {
const { const {
featureToggle, featureToggle,
features, features,
betaFlags,
activeTab, activeTab,
revive, revive,
// setValue, // setValue,
@ -112,9 +94,6 @@ export default class ViewFeatureToggleComponent extends React.Component {
hasPermission, hasPermission,
} = this.props; } = this.props;
// TODO: Find better solution for this
const showVariants = betaFlags.includes('unleash.beta.variants');
if (!featureToggle) { if (!featureToggle) {
if (features.length === 0) { if (features.length === 0) {
return <ProgressBar indeterminate />; return <ProgressBar indeterminate />;
@ -249,15 +228,7 @@ export default class ViewFeatureToggleComponent extends React.Component {
> >
<Tab onClick={() => this.goToTab('strategies', featureToggleName)}>Strategies</Tab> <Tab onClick={() => this.goToTab('strategies', featureToggleName)}>Strategies</Tab>
<Tab onClick={() => this.goToTab('view', featureToggleName)}>Metrics</Tab> <Tab onClick={() => this.goToTab('view', featureToggleName)}>Metrics</Tab>
{showVariants ? ( <Tab onClick={() => this.goToTab('variants', featureToggleName)}>Variants</Tab>
<Tab onClick={() => this.goToTab('variants', featureToggleName)}>
<Badge text="beta" noBackground>
Variants
</Badge>
</Tab>
) : (
[]
)}
<Tab onClick={() => this.goToTab('history', featureToggleName)}>History</Tab> <Tab onClick={() => this.goToTab('history', featureToggleName)}>History</Tab>
</Tabs> </Tabs>
{tabContent} {tabContent}

View File

@ -13,11 +13,6 @@ import { hasPermission } from '../../permissions';
export default connect( export default connect(
(state, props) => ({ (state, props) => ({
features: state.features.toJS(), 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), featureToggle: state.features.toJS().find(toggle => toggle.name === props.featureToggleName),
activeTab: props.activeTab, activeTab: props.activeTab,
hasPermission: hasPermission.bind(null, state.user.get('profile')), hasPermission: hasPermission.bind(null, state.user.get('profile')),