mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
create permissions store and write selectors
This commit is contained in:
@@ -1,13 +1,46 @@
|
||||
//@flow
|
||||
import React from "react";
|
||||
import type { History } from "history";
|
||||
import connect from "react-redux/es/connect/connect";
|
||||
import { translate } from "react-i18next";
|
||||
import { fetchPermissions } from "../modules/permissions";
|
||||
|
||||
type Props = {};
|
||||
type Props = {
|
||||
namespace: string,
|
||||
name: string,
|
||||
|
||||
//dispatch functions
|
||||
fetchPermissions: (namespace: string, name: string) => void
|
||||
};
|
||||
|
||||
class Permissions extends React.Component<Props> {
|
||||
componentDidMount() {
|
||||
const { fetchPermissions, namespace, name } = this.props;
|
||||
|
||||
fetchPermissions(namespace, name);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <div>Permissions will be shown here!</div>;
|
||||
}
|
||||
}
|
||||
|
||||
export default Permissions;
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
// const { namespace, name } = ownProps.match.params;
|
||||
return {
|
||||
//namespace,
|
||||
//name
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
fetchPermissions: (namespace: string, name: string) => {
|
||||
dispatch(fetchPermissions(namespace, name));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(translate("repos")(Permissions));
|
||||
|
||||
Reference in New Issue
Block a user