mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-09 11:14:29 +02:00
* chore: update changelog * 4.0.0-alpha.4 * wip: frontend should understand rbac permissions * move all feature components to hasAccess * fix: remove all change permissions * fix all the tests * fix all the tests x2 * fix snapshot for node 12 * fine tune perms a bit * refactor: rewrite to ts * refactor: use admin constant * fix: import Co-authored-by: Fredrik Oseberg <fredrik.no@gmail.com>
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import ShowStrategy from './strategy-details-component';
|
|
import { fetchStrategies } from './../../store/strategy/actions';
|
|
import { fetchAll } from './../../store/application/actions';
|
|
import { fetchFeatureToggles } from './../../store/feature-toggle/actions';
|
|
|
|
const mapStateToProps = (state, props) => {
|
|
let strategy = state.strategies.get('list').find(n => n.name === props.strategyName);
|
|
|
|
const applications = state.applications
|
|
.get('list')
|
|
.filter(app => app.strategies && app.strategies.includes(props.strategyName));
|
|
|
|
const toggles = state.features.filter(
|
|
toggle => toggle.get('strategies').findIndex(s => s.name === props.strategyName) > -1
|
|
);
|
|
|
|
return {
|
|
strategy,
|
|
strategyName: props.strategyName,
|
|
applications: applications && applications.toJS(),
|
|
toggles: toggles && toggles.toJS(),
|
|
activeTab: props.activeTab,
|
|
};
|
|
};
|
|
|
|
const Constainer = connect(mapStateToProps, {
|
|
fetchStrategies,
|
|
fetchApplications: fetchAll,
|
|
fetchFeatureToggles,
|
|
})(ShowStrategy);
|
|
|
|
export default Constainer;
|