update tutorial builder
- update tutorial modell - add difficulty closes #82 - add review system - make tutorials private by default - add admin overview
This commit is contained in:
@@ -4,6 +4,9 @@ import {
|
||||
BUILDER_CHANGE,
|
||||
BUILDER_ERROR,
|
||||
BUILDER_TITLE,
|
||||
BUILDER_PUBLIC,
|
||||
BUILDER_DIFFICULTY,
|
||||
BUILDER_REVIEW,
|
||||
BUILDER_ID,
|
||||
BUILDER_ADD_STEP,
|
||||
BUILDER_DELETE_STEP,
|
||||
@@ -35,6 +38,30 @@ export const tutorialTitle = (title) => (dispatch) => {
|
||||
dispatch(changeTutorialBuilder());
|
||||
};
|
||||
|
||||
export const tutorialPublic = (pub) => (dispatch) => {
|
||||
dispatch({
|
||||
type: BUILDER_PUBLIC,
|
||||
payload: pub,
|
||||
});
|
||||
dispatch(changeTutorialBuilder());
|
||||
};
|
||||
|
||||
export const tutorialDifficulty = (difficulty) => (dispatch) => {
|
||||
dispatch({
|
||||
type: BUILDER_DIFFICULTY,
|
||||
payload: difficulty,
|
||||
});
|
||||
dispatch(changeTutorialBuilder());
|
||||
};
|
||||
|
||||
export const tutorialReview = (review) => (dispatch) => {
|
||||
dispatch({
|
||||
type: BUILDER_REVIEW,
|
||||
payload: review,
|
||||
});
|
||||
dispatch(changeTutorialBuilder());
|
||||
};
|
||||
|
||||
export const tutorialSteps = (steps) => (dispatch) => {
|
||||
dispatch({
|
||||
type: BUILDER_ADD_STEP,
|
||||
@@ -320,6 +347,7 @@ export const readJSON = (json) => (dispatch, getState) => {
|
||||
return object;
|
||||
});
|
||||
dispatch(tutorialTitle(json.title));
|
||||
dispatch(tutorialDifficulty(json.difficulty));
|
||||
dispatch(tutorialSteps(steps));
|
||||
dispatch(setSubmitError());
|
||||
dispatch(progress(false));
|
||||
|
||||
Reference in New Issue
Block a user