Files
Braden MacDonald 3c661e15cb Convert "Pages & Resources" page to a plugin system (#638)
* feat: Make "Pages & Resources" course apps into plugins

* feat: move ora_settings

* feat: move proctoring

* feat: move progress

* feat: move teams

* feat: move wiki

* feat: move Xpert settings

* fix: add webpack.prod.config.js

* fix: clean up unused parts of package.json files

* feat: Add an error message when displaying a Course App Plugin fails

* chore: fix various eslint warnings

* chore: fix jest tests

* fix: error preventing "npm ci" from working

* feat: better tests for <SettingsComponent>

* chore: move xpert_unit_summary into same dir as other plugins

* fix: eslint-import-resolver-webpack is a dev dependency

* chore: move learning_assistant to be a plugin too

* feat: for compatibility, install 2U plugins by default

* fix: bug with learning_assistant package.json
2024-02-28 11:50:54 -05:00

49 lines
1.3 KiB
JavaScript

/* eslint-disable no-param-reassign */
import { createSlice } from '@reduxjs/toolkit';
import { RequestStatus } from 'CourseAuthoring/data/constants';
const slice = createSlice({
name: 'live',
initialState: {
appIds: [],
// activeAppId is the ID of the app that has been configured for the course.
activeAppId: null,
// selectedAppId is the ID of the app that has been selected in the UI. This happens when an
// activeAppId has been configured but the user is about to configure a different provider
// instead.
selectedAppId: null,
status: RequestStatus.IN_PROGRESS,
saveStatus: RequestStatus.SUCCESSFUL,
},
reducers: {
loadApps: (state, { payload }) => {
state.status = RequestStatus.SUCCESSFUL;
state.saveStatus = RequestStatus.SUCCESSFUL;
Object.assign(state, payload);
},
selectApp: (state, { payload }) => {
const { appId } = payload;
state.selectedAppId = appId;
},
updateStatus: (state, { payload }) => {
const { status } = payload;
state.status = status;
},
updateSaveStatus: (state, { payload }) => {
const { status } = payload;
state.saveStatus = status;
},
},
});
export const {
loadApps,
selectApp,
updateStatus,
updateSaveStatus,
} = slice.actions;
export const {
reducer,
} = slice;