mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
Add roadmap management to Site settings (#123)
This commit is contained in:
committed by
GitHub
parent
db674eaf6a
commit
e2065b2c5e
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch: any) => ({
|
||||
onSuccess: Function,
|
||||
authenticityToken: string,
|
||||
) {
|
||||
dispatch(updatePostStatus(id, name, color, authenticityToken)).then(res => {
|
||||
dispatch(updatePostStatus({id, name, color, authenticityToken})).then(res => {
|
||||
if (res && res.status === HttpStatus.OK) onSuccess();
|
||||
});
|
||||
},
|
||||
|
||||
30
app/javascript/containers/RoadmapSiteSettings.tsx
Normal file
30
app/javascript/containers/RoadmapSiteSettings.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { connect } from "react-redux";
|
||||
|
||||
import RoadmapSiteSettingsP from "../components/SiteSettings/Roadmap/RoadmapSiteSettingsP";
|
||||
|
||||
import { requestPostStatuses } from "../actions/PostStatus/requestPostStatuses";
|
||||
import { State } from "../reducers/rootReducer";
|
||||
import { updatePostStatus } from "../actions/PostStatus/updatePostStatus";
|
||||
|
||||
const mapStateToProps = (state: State) => ({
|
||||
postStatuses: state.postStatuses,
|
||||
settingsAreUpdating: state.siteSettings.roadmap.areUpdating,
|
||||
settingsError: state.siteSettings.roadmap.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch: any) => ({
|
||||
requestPostStatuses() {
|
||||
dispatch(requestPostStatuses());
|
||||
},
|
||||
|
||||
updatePostStatus(id: number, showInRoadmap: boolean, onComplete: Function, authenticityToken: string) {
|
||||
dispatch(updatePostStatus({id, showInRoadmap, authenticityToken})).then(() => {
|
||||
onComplete();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(RoadmapSiteSettingsP);
|
||||
Reference in New Issue
Block a user