Adds a new tab and listing view for learners in a course that have interacted with the discussions forums. It reports stats about the learner's created posts, comments, and reported content. Co-authored-by: Kshitij Sobti <kshitij@sobti.in>
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
/* eslint-disable no-param-reassign,import/prefer-default-export */
|
|
import { createSlice } from '@reduxjs/toolkit';
|
|
|
|
import { RequestStatus } from '../../data/constants';
|
|
|
|
const configSlice = createSlice({
|
|
name: 'config',
|
|
initialState: {
|
|
status: RequestStatus.IN_PROGRESS,
|
|
blackouts: [],
|
|
allowAnonymous: false,
|
|
allowAnonymousToPeers: false,
|
|
userRoles: [],
|
|
userIsPrivileged: false,
|
|
learnersTabEnabled: false,
|
|
settings: {
|
|
divisionScheme: 'none',
|
|
alwaysDivideInlineDiscussions: false,
|
|
dividedInlineDiscussions: [],
|
|
dividedCourseWideDiscussions: [],
|
|
},
|
|
reasonCodesEnabled: false,
|
|
editReasons: [],
|
|
postCloseReasons: [],
|
|
},
|
|
reducers: {
|
|
fetchConfigRequest: (state) => {
|
|
state.status = RequestStatus.IN_PROGRESS;
|
|
},
|
|
fetchConfigSuccess: (state, { payload }) => {
|
|
state.status = RequestStatus.SUCCESSFUL;
|
|
Object.assign(state, payload);
|
|
},
|
|
fetchConfigFailed: (state) => {
|
|
state.status = RequestStatus.FAILED;
|
|
},
|
|
fetchConfigDenied: (state) => {
|
|
state.status = RequestStatus.DENIED;
|
|
},
|
|
},
|
|
});
|
|
|
|
export const {
|
|
fetchConfigDenied,
|
|
fetchConfigFailed,
|
|
fetchConfigRequest,
|
|
fetchConfigSuccess,
|
|
} = configSlice.actions;
|
|
|
|
export const configReducer = configSlice.reducer;
|