mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
rename files to lowercase and dashes
This commit is contained in:
parent
047ea4447a
commit
ed1cce38b6
@ -1,8 +1,8 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Layout, Panel, NavDrawer, AppBar } from 'react-toolbox';
|
||||
import style from './style';
|
||||
import style from './styles.scss';
|
||||
|
||||
import Navigation from './Navigation';
|
||||
import Navigation from './nav';
|
||||
|
||||
export default class App extends Component {
|
||||
constructor (props) {
|
@ -1,9 +1,9 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { Input, Switch, Button } from 'react-toolbox';
|
||||
import AddFeatureToggleStrategy from './AddFeatureToggleStrategy';
|
||||
import ConfiguredStrategies from './ConfiguredStrategies';
|
||||
import AddFeatureToggleStrategy from './strategies-for-toggle';
|
||||
import SelectedStrategies from './selected-strategies';
|
||||
|
||||
const AddFeatureToggleUI = ({
|
||||
const AddFeatureToggleComponent = ({
|
||||
strategies,
|
||||
featureToggle,
|
||||
updateField,
|
||||
@ -50,7 +50,7 @@ const AddFeatureToggleUI = ({
|
||||
|
||||
<section>
|
||||
<strong>Activation strategies</strong>
|
||||
<ConfiguredStrategies
|
||||
<SelectedStrategies
|
||||
configuredStrategies={configuredStrategies}
|
||||
removeStrategy={removeStrategy} />
|
||||
</section>
|
||||
@ -69,7 +69,7 @@ const AddFeatureToggleUI = ({
|
||||
);
|
||||
};
|
||||
|
||||
AddFeatureToggleUI.propTypes = {
|
||||
AddFeatureToggleComponent.propTypes = {
|
||||
strategies: PropTypes.array.required,
|
||||
featureToggle: PropTypes.object,
|
||||
updateField: PropTypes.func.required,
|
||||
@ -80,4 +80,4 @@ AddFeatureToggleUI.propTypes = {
|
||||
editmode: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default AddFeatureToggleUI;
|
||||
export default AddFeatureToggleComponent;
|
@ -1,8 +1,8 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createFeatureToggles } from '../../store/feature-actions';
|
||||
import AddFeatureToggleUI from './AddFeatureToggleUI';
|
||||
import { fetchStrategies } from '../../store/strategy-actions';
|
||||
import AddFeatureToggleUI from './add-component';
|
||||
|
||||
class AddFeatureToggle extends React.Component {
|
||||
constructor () {
|
@ -1,7 +1,7 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { editFeatureToggle } from '../../store/feature-actions';
|
||||
import AddFeatureToggleUI from './AddFeatureToggleUI';
|
||||
import AddFeatureToggleComponent from './add-component';
|
||||
import { fetchStrategies } from '../../store/strategy-actions';
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ class EditFeatureToggle extends React.Component {
|
||||
|
||||
render () {
|
||||
return (
|
||||
<AddFeatureToggleUI
|
||||
<AddFeatureToggleComponent
|
||||
editmode="true"
|
||||
strategies={this.props.strategies}
|
||||
featureToggle={this.state}
|
@ -1,8 +1,8 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import Feature from './Feature';
|
||||
import Feature from './feature-component';
|
||||
import { List, ListItem, ListSubHeader, ListDivider } from 'react-toolbox/lib/list';
|
||||
|
||||
export default class FeatureList extends React.Component {
|
||||
export default class FeatureListComponent extends React.Component {
|
||||
|
||||
static propTypes () {
|
||||
return {
|
||||
@ -27,8 +27,8 @@ export default class FeatureList extends React.Component {
|
||||
return (
|
||||
<List>
|
||||
<ListSubHeader caption="Feature toggles" />
|
||||
{features.map(feature =>
|
||||
<Feature feature={feature} onFeatureClick={onFeatureClick} onFeatureRemove={onFeatureRemove}/>
|
||||
{features.map((feature, i) =>
|
||||
<Feature key={i} feature={feature} onFeatureClick={onFeatureClick} onFeatureRemove={onFeatureRemove}/>
|
||||
)}
|
||||
<ListDivider />
|
||||
<ListItem
|
@ -1,6 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { toggleFeature, fetchFeatureToggles, removeFeatureToggle } from '../../store/feature-actions';
|
||||
import FeatureList from './FeatureList';
|
||||
import FeatureListComponent from './list-component';
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
features: state.features.toJS(),
|
||||
@ -15,6 +15,6 @@ const mapDispatchToProps = {
|
||||
const FeatureListContainer = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(FeatureList);
|
||||
)(FeatureListComponent);
|
||||
|
||||
export default FeatureListContainer;
|
@ -1,7 +1,7 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { Button, Input } from 'react-toolbox';
|
||||
|
||||
class ConfigureStrategy extends React.Component {
|
||||
class SelectStrategies extends React.Component {
|
||||
constructor (props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@ -82,4 +82,4 @@ class ConfigureStrategy extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default ConfigureStrategy;
|
||||
export default SelectStrategies;
|
@ -1,7 +1,7 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { Avatar, Chip } from 'react-toolbox';
|
||||
|
||||
class ConfiguredStrategies extends React.Component {
|
||||
class SelectedStrategies extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
configuredStrategies: PropTypes.array.isRequired,
|
||||
@ -30,11 +30,11 @@ class ConfiguredStrategies extends React.Component {
|
||||
</Chip>
|
||||
));
|
||||
return (
|
||||
<p>
|
||||
<div>
|
||||
{strategies.length > 0 ? strategies : <p>No activation strategies added</p>}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ConfiguredStrategies;
|
||||
export default SelectedStrategies;
|
@ -1,7 +1,7 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import ConfigureStrategy from './ConfigureStrategy';
|
||||
import SelectStrategies from './select-strategies';
|
||||
|
||||
class AddFeatureToggleStrategy extends React.Component {
|
||||
class AddStrategiesToToggle extends React.Component {
|
||||
constructor () {
|
||||
super();
|
||||
this.state = {
|
||||
@ -40,7 +40,7 @@ class AddFeatureToggleStrategy extends React.Component {
|
||||
|
||||
render () {
|
||||
return this.state.showConfigure ?
|
||||
<ConfigureStrategy
|
||||
<SelectStrategies
|
||||
strategies={this.props.strategies}
|
||||
cancelConfig={this.cancelConfig}
|
||||
addStrategy={this.addStrategy} /> :
|
||||
@ -48,4 +48,4 @@ class AddFeatureToggleStrategy extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default AddFeatureToggleStrategy;
|
||||
export default AddStrategiesToToggle;
|
@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import { ListSubHeader, List, ListItem, ListDivider } from 'react-toolbox';
|
||||
import style from './style';
|
||||
import style from './styles.scss';
|
||||
|
||||
export default class UnleashNav extends Component {
|
||||
static contextTypes = {
|
@ -0,0 +1,40 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { createMapper, createActions } from '../input-helpers';
|
||||
import { createStrategy } from '../../store/strategy-actions';
|
||||
|
||||
import AddStrategy, { PARAM_PREFIX } from './add-strategy';
|
||||
|
||||
const ID = 'add-strategy';
|
||||
|
||||
const actions = createActions(ID, (methods, dispatch) => {
|
||||
methods.onSubmit = (input) => (
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const parametersTemplate = {};
|
||||
Object.keys(input).forEach(key => {
|
||||
if (key.startsWith(PARAM_PREFIX)) {
|
||||
parametersTemplate[input[key]] = 'string';
|
||||
}
|
||||
});
|
||||
input.parametersTemplate = parametersTemplate;
|
||||
|
||||
createStrategy(input)(dispatch)
|
||||
.then(() => methods.clear())
|
||||
// somewhat quickfix / hacky to go back..
|
||||
.then(() => window.history.back());
|
||||
}
|
||||
);
|
||||
|
||||
methods.onCancel = (e) => {
|
||||
e.preventDefault();
|
||||
// somewhat quickfix / hacky to go back..
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
|
||||
return methods;
|
||||
});
|
||||
|
||||
export default connect(createMapper(ID), actions)(AddStrategy);
|
@ -1,16 +1,13 @@
|
||||
import React, { PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import Input from 'react-toolbox/lib/input';
|
||||
import Button from 'react-toolbox/lib/button';
|
||||
|
||||
import { createMapper, createActions } from '../input-helpers';
|
||||
import { createStrategy } from '../../store/strategy-actions';
|
||||
|
||||
function gerArrayWithEntries (num) {
|
||||
return Array.from(Array(num));
|
||||
}
|
||||
const PARAM_PREFIX = 'param_';
|
||||
export const PARAM_PREFIX = 'param_';
|
||||
|
||||
const genParams = (input, num = 0, setValue) => {
|
||||
return (<div>{gerArrayWithEntries(num).map((v, i) => {
|
||||
const key = `${PARAM_PREFIX}${i + 1}`;
|
||||
@ -76,36 +73,4 @@ AddStrategy.propTypes = {
|
||||
onSubmit: PropTypes.func,
|
||||
};
|
||||
|
||||
const ID = 'add-strategy';
|
||||
|
||||
const actions = createActions(ID, (methods, dispatch) => {
|
||||
methods.onSubmit = (input) => (
|
||||
(e) => {
|
||||
e.preventDefault();
|
||||
|
||||
const parametersTemplate = {};
|
||||
Object.keys(input).forEach(key => {
|
||||
if (key.startsWith(PARAM_PREFIX)) {
|
||||
parametersTemplate[input[key]] = 'string';
|
||||
}
|
||||
});
|
||||
input.parametersTemplate = parametersTemplate;
|
||||
|
||||
createStrategy(input)(dispatch)
|
||||
.then(() => methods.clear())
|
||||
// somewhat quickfix / hacky to go back..
|
||||
.then(() => window.history.back());
|
||||
}
|
||||
);
|
||||
|
||||
methods.onCancel = (e) => {
|
||||
e.preventDefault();
|
||||
// somewhat quickfix / hacky to go back..
|
||||
window.history.back();
|
||||
};
|
||||
|
||||
|
||||
return methods;
|
||||
});
|
||||
|
||||
export default connect(createMapper(ID), actions)(AddStrategy);
|
||||
export default AddStrategy;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { connect } from 'react-redux';
|
||||
import StrategiesListComponent from './list.jsx';
|
||||
import StrategiesListComponent from './list-component.jsx';
|
||||
import { fetchStrategies, removeStrategy } from '../../store/strategy-actions';
|
||||
|
||||
const mapStateToProps = (state) => {
|
@ -6,7 +6,7 @@ import thunkMiddleware from 'redux-thunk';
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
|
||||
import store from './store';
|
||||
import App from './App';
|
||||
import App from './component/app';
|
||||
|
||||
import Features from './page/features';
|
||||
import CreateFeatureToggle from './page/features/create';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import AddFeatureToggle from '../../component/feature/AddFeatureToggle';
|
||||
import AddFeatureToggle from '../../component/feature/add-container';
|
||||
|
||||
const render = () => (
|
||||
<div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import EditFeatureToggle from '../../component/feature/EditFeatureToggle';
|
||||
import EditFeatureToggle from '../../component/feature/edit-container';
|
||||
|
||||
export default class Features extends Component {
|
||||
static propTypes () {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import FeatureListContainer from '../../component/feature/FeatureListContainer';
|
||||
import FeatureListContainer from '../../component/feature/list-container';
|
||||
|
||||
const render = () => (<FeatureListContainer />);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import AddStrategies from '../../component/strategies/add-strategy';
|
||||
import AddStrategies from '../../component/strategies/add-container';
|
||||
|
||||
export default () => (<AddStrategies />);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import Strategies from '../../component/strategies';
|
||||
import Strategies from '../../component/strategies/list-container';
|
||||
|
||||
export default () => (<Strategies />);
|
||||
|
Loading…
Reference in New Issue
Block a user