Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b15ade4
feat: Make "Pages & Resources" course apps into plugins
bradenmacdonald Oct 13, 2023
371aa1d
feat: move ora_settings
bradenmacdonald Oct 16, 2023
c2fc5c9
feat: move proctoring
bradenmacdonald Oct 16, 2023
e7af283
feat: move progress
bradenmacdonald Oct 16, 2023
447dfbf
feat: move teams
bradenmacdonald Oct 16, 2023
2ccc8cf
feat: move wiki
bradenmacdonald Oct 16, 2023
c81182f
feat: move Xpert settings
bradenmacdonald Oct 17, 2023
d1be807
fix: add webpack.prod.config.js
bradenmacdonald Oct 27, 2023
f89c60a
chore: update with latest changes from master
bradenmacdonald Nov 3, 2023
0a0695b
fix: clean up unused parts of package.json files
bradenmacdonald Nov 3, 2023
48ba65e
feat: Add an error message when displaying a Course App Plugin fails
bradenmacdonald Nov 6, 2023
86b538a
chore: fix various eslint warnings
bradenmacdonald Nov 7, 2023
b385541
chore: fix jest tests
bradenmacdonald Nov 7, 2023
dab1291
chore: update with latest changes from master
bradenmacdonald Nov 7, 2023
6d0481c
fix: error preventing "npm ci" from working
bradenmacdonald Nov 7, 2023
8d26ef2
feat: better tests for <SettingsComponent>
bradenmacdonald Nov 8, 2023
dd45ac1
chore: update with latest master
bradenmacdonald Nov 15, 2023
2ab6b2d
chore: move xpert_unit_summary into same dir as other plugins
bradenmacdonald Nov 15, 2023
7257af9
fix: eslint-import-resolver-webpack is a dev dependency
bradenmacdonald Nov 15, 2023
10d6f3e
chore: update with latest master
bradenmacdonald Dec 14, 2023
3235066
Merge branch 'master' into braden/plugin-test
bradenmacdonald Feb 16, 2024
833845f
chore: move learning_assistant to be a plugin too
bradenmacdonald Feb 16, 2024
d869816
feat: for compatibility, install 2U plugins by default
bradenmacdonald Feb 16, 2024
15ec549
chore: update with latest master
bradenmacdonald Feb 16, 2024
decd291
fix: bug with learning_assistant package.json
bradenmacdonald Feb 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@
"@fortawesome/free-regular-svg-icons": "5.11.2",
"@fortawesome/free-solid-svg-icons": "5.11.2",
"@fortawesome/react-fontawesome": "0.2.0",
"@openedx-plugins/course-app-calculator": "file:plugins/course-apps/calculator",
"@openedx-plugins/course-app-edxnotes": "file:plugins/course-apps/edxnotes",
"@openedx-plugins/course-app-live": "file:plugins/course-apps/live",
"@openedx-plugins/course-app-ora_settings": "file:plugins/course-apps/ora_settings",
"@openedx-plugins/course-app-proctoring": "file:plugins/course-apps/proctoring",
"@openedx-plugins/course-app-progress": "file:plugins/course-apps/progress",
"@openedx-plugins/course-app-teams": "file:plugins/course-apps/teams",
"@openedx-plugins/course-app-wiki": "file:plugins/course-apps/wiki",
"@reduxjs/toolkit": "1.5.0",
"classnames": "2.2.6",
"core-js": "3.8.1",
Expand Down
27 changes: 27 additions & 0 deletions plugins/course-apps/calculator/Settings.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';

import { useIntl } from '@edx/frontend-platform/i18n';

import AppSettingsModal from 'CourseAuthoring/pages-and-resources/app-settings-modal/AppSettingsModal';
import messages from './messages';

/**
* Settings widget for the "calculator" Course App.
* @param {{onClose: () => void}} props
* @returns
*/
const CalculatorSettings = ({ onClose }) => {
const intl = useIntl();
return (
<AppSettingsModal
appId="calculator"
title={intl.formatMessage(messages.heading)}
enableAppHelp={intl.formatMessage(messages.enableCalculatorHelp)}
enableAppLabel={intl.formatMessage(messages.enableCalculatorLabel)}
learnMoreText={intl.formatMessage(messages.enableCalculatorLink)}
onClose={onClose}
/>
);
};

export default CalculatorSettings;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commentary: This file is mostly unchanged (just moved) but since I changed CalculatorSettings to use useIntl instead of injectIntl, the indentation all changed and git shows it in the diff as a new file.

8 changes: 8 additions & 0 deletions plugins/course-apps/calculator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@openedx-plugins/course-app-calculator",
"version": "0.1.0",
"description": "Calculator configuration for courses using it",
"dependencies": {
},
"devDependencies": {}
}
Copy link
Contributor Author

@bradenmacdonald bradenmacdonald Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case it's not clear, generally each plugin is just three files:

  • Settings.jsx which defines the UI (mostly unchanged from how it was before; just updated import paths)
  • messages.js which contains the strings (unchanged) (optional)
  • package.json which defines the plugin as an installable module (new)

27 changes: 27 additions & 0 deletions plugins/course-apps/edxnotes/Settings.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';

import { useIntl } from '@edx/frontend-platform/i18n';

import AppSettingsModal from 'CourseAuthoring/pages-and-resources/app-settings-modal/AppSettingsModal';
import messages from './messages';

/**
* Settings widget for the "edxnotes" Course App.
* @param {{onClose: () => void}} props
* @returns
*/
const NotesSettings = ({ onClose }) => {
const intl = useIntl();
return (
<AppSettingsModal
appId="edxnotes"
title={intl.formatMessage(messages.heading)}
enableAppHelp={intl.formatMessage(messages.enableNotesHelp)}
enableAppLabel={intl.formatMessage(messages.enableNotesLabel)}
learnMoreText={intl.formatMessage(messages.enableNotesLink)}
onClose={onClose}
/>
);
};

export default NotesSettings;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commentary: This file is mostly unchanged (just moved) but since I changed NotesSettings to use useIntl instead of injectIntl, the indentation all changed and git shows it in the diff as a new file. Even though useIntl is way nicer than injectIntl, I didn't change the rest of these plugins, in order to make the diff simpler.

8 changes: 8 additions & 0 deletions plugins/course-apps/edxnotes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@openedx-plugins/course-app-edxnotes",
"version": "0.1.0",
"description": "edxnotes configuration for courses using it",
"dependencies": {
},
"devDependencies": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Form, Hyperlink } from '@edx/paragon';
import PropTypes from 'prop-types';
import messages from './messages';
import { providerNames, bbbPlanTypes } from './constants';
import AppConfigFormDivider from '../discussions/app-config-form/apps/shared/AppConfigFormDivider';
import AppConfigFormDivider from 'CourseAuthoring/pages-and-resources/discussions/app-config-form/apps/shared/AppConfigFormDivider';
import LiveCommonFields from './LiveCommonFields';
import { useModel } from '../../generic/model-store';
import { useModel } from 'CourseAuthoring/generic/model-store';

const BbbSettings = ({
intl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import { AppProvider, PageRoute } from '@edx/frontend-platform/react';
import { IntlProvider } from '@edx/frontend-platform/i18n';

import userEvent from '@testing-library/user-event';
import initializeStore from '../../store';
import { executeThunk } from '../../utils';
import initializeStore from 'CourseAuthoring/store';
import { executeThunk } from 'CourseAuthoring/utils';
import LiveSettings from './Settings';
import {
generateLiveConfigurationApiResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import PropTypes from 'prop-types';
import messages from './messages';
import FormikControl from '../../generic/FormikControl';
import FormikControl from 'CourseAuthoring/generic/FormikControl';

const LiveCommonFields = ({
intl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import PropTypes from 'prop-types';
import * as Yup from 'yup';
import { fetchLiveData, saveLiveConfiguration, saveLiveConfigurationAsDraft } from './data/thunks';
import { selectApp } from './data/slice';
import AppSettingsModal from '../app-settings-modal/AppSettingsModal';
import { useModel } from '../../generic/model-store';
import Loading from '../../generic/Loading';
import AppSettingsModal from 'CourseAuthoring/pages-and-resources/app-settings-modal/AppSettingsModal';
import { useModel } from 'CourseAuthoring/generic/model-store';
import Loading from 'CourseAuthoring/generic/Loading';
import { iconsSrc, bbbPlanTypes } from './constants';
import { RequestStatus } from '../../data/constants';
import { RequestStatus } from 'CourseAuthoring/data/constants';
import messages from './messages';
import ZoomSettings from './ZoomSettings';
import BBBSettings from './BBBSettings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { AppProvider, PageRoute } from '@edx/frontend-platform/react';
import { IntlProvider } from '@edx/frontend-platform/i18n';

import initializeStore from '../../store';
import { executeThunk } from '../../utils';
import initializeStore from 'CourseAuthoring/store';
import { executeThunk } from 'CourseAuthoring/utils';
import LiveSettings from './Settings';
import {
generateLiveConfigurationApiResponse,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import messages from './messages';
import { providerNames } from './constants';
import LiveCommonFields from './LiveCommonFields';
import FormikControl from '../../generic/FormikControl';
import FormikControl from 'CourseAuthoring/generic/FormikControl';

const ZoomSettings = ({
intl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { AppProvider, PageRoute } from '@edx/frontend-platform/react';
import { IntlProvider } from '@edx/frontend-platform/i18n';

import initializeStore from '../../store';
import { executeThunk } from '../../utils';
import initializeStore from 'CourseAuthoring/store';
import { executeThunk } from 'CourseAuthoring/utils';
import LiveSettings from './Settings';
import {
generateLiveConfigurationApiResponse,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-param-reassign */
import { createSlice } from '@reduxjs/toolkit';
import { RequestStatus } from '../../../data/constants';
import { RequestStatus } from 'CourseAuthoring/data/constants';

const slice = createSlice({
name: 'live',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { history } from '@edx/frontend-platform';
import { addModel, addModels, updateModel } from '../../../generic/model-store';
import { addModel, addModels, updateModel } from 'CourseAuthoring/generic/model-store';
import {
getLiveConfiguration,
getLiveProviders,
Expand All @@ -8,7 +8,7 @@ import {
deNormalizeSettings,
} from './api';
import { loadApps, updateStatus, updateSaveStatus } from './slice';
import { RequestStatus } from '../../../data/constants';
import { RequestStatus } from 'CourseAuthoring/data/constants';

function updateLiveSettingsState({
appConfig,
Expand Down
8 changes: 8 additions & 0 deletions plugins/course-apps/live/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@openedx-plugins/course-app-live",
"version": "0.1.0",
"description": "Live course configuration for courses using it",
"dependencies": {
},
"devDependencies": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import * as Yup from 'yup';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';

import { Hyperlink } from '@edx/paragon';
import { useModel } from '../../generic/model-store';
import { useModel } from 'CourseAuthoring/generic/model-store';

import FormSwitchGroup from '../../generic/FormSwitchGroup';
import { useAppSetting } from '../../utils';
import AppSettingsModal from '../app-settings-modal/AppSettingsModal';
import FormSwitchGroup from 'CourseAuthoring/generic/FormSwitchGroup';
import { useAppSetting } from 'CourseAuthoring/utils';
import AppSettingsModal from 'CourseAuthoring/pages-and-resources/app-settings-modal/AppSettingsModal';
import messages from './messages';

const ORASettings = ({ intl, onClose }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jest.mock('@edx/frontend-platform/i18n', () => ({
jest.mock('yup', () => ({
boolean: jest.fn().mockReturnValue('Yub.boolean'),
}));
jest.mock('../../generic/model-store', () => ({
jest.mock('CourseAuthoring/generic/model-store', () => ({
useModel: jest.fn().mockReturnValue({ documentationLinks: { learnMoreConfiguration: 'https://learnmore.test' } }),
}));
jest.mock('../../generic/FormSwitchGroup', () => 'FormSwitchGroup');
jest.mock('../../utils', () => ({
jest.mock('CourseAuthoring/generic/FormSwitchGroup', () => 'FormSwitchGroup');
jest.mock('CourseAuthoring/utils', () => ({
useAppSetting: jest.fn().mockReturnValue(['abitrary value', jest.fn().mockName('saveSetting')]),
}));
jest.mock('../app-settings-modal/AppSettingsModal', () => 'AppSettingsModal');
jest.mock('CourseAuthoring/pages-and-resources/app-settings-modal/AppSettingsModal', () => 'AppSettingsModal');

const props = {
onClose: jest.fn().mockName('onClose'),
Expand Down
9 changes: 9 additions & 0 deletions plugins/course-apps/ora_settings/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@openedx-plugins/course-app-ora_settings",
"version": "0.1.0",
"description": "Open Response Assessment configuration for courses using it",
"dependencies": {
},
"devDependencies": {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import {
ActionRow, Alert, Badge, Form, Hyperlink, ModalDialog, StatefulButton,
} from '@edx/paragon';

import ExamsApiService from '../../data/services/ExamsApiService';
import StudioApiService from '../../data/services/StudioApiService';
import Loading from '../../generic/Loading';
import ConnectionErrorAlert from '../../generic/ConnectionErrorAlert';
import FormSwitchGroup from '../../generic/FormSwitchGroup';
import { useModel } from '../../generic/model-store';
import PermissionDeniedAlert from '../../generic/PermissionDeniedAlert';
import { useIsMobile } from '../../utils';
import { PagesAndResourcesContext } from '../PagesAndResourcesProvider';
import ExamsApiService from 'CourseAuthoring/data/services/ExamsApiService';
import StudioApiService from 'CourseAuthoring/data/services/StudioApiService';
import Loading from 'CourseAuthoring/generic/Loading';
import ConnectionErrorAlert from 'CourseAuthoring/generic/ConnectionErrorAlert';
import FormSwitchGroup from 'CourseAuthoring/generic/FormSwitchGroup';
import { useModel } from 'CourseAuthoring/generic/model-store';
import PermissionDeniedAlert from 'CourseAuthoring/generic/PermissionDeniedAlert';
import { useIsMobile } from 'CourseAuthoring/utils';
import { PagesAndResourcesContext } from 'CourseAuthoring/pages-and-resources/PagesAndResourcesProvider';
import messages from './messages';

const ProctoringSettings = ({ intl, onClose }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { IntlProvider, injectIntl } from '@edx/frontend-platform/i18n';
import { AppProvider } from '@edx/frontend-platform/react';

import StudioApiService from '../../data/services/StudioApiService';
import ExamsApiService from '../../data/services/ExamsApiService';
import initializeStore from '../../store';
import PagesAndResourcesProvider from '../PagesAndResourcesProvider';
import StudioApiService from 'CourseAuthoring/data/services/StudioApiService';
import ExamsApiService from 'CourseAuthoring/data/services/ExamsApiService';
import initializeStore from 'CourseAuthoring/store';
import PagesAndResourcesProvider from 'CourseAuthoring/pages-and-resources/PagesAndResourcesProvider';
import ProctoredExamSettings from './Settings';

const defaultProps = {
Expand Down
8 changes: 8 additions & 0 deletions plugins/course-apps/proctoring/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@openedx-plugins/course-app-proctoring",
"version": "0.1.0",
"description": "Proctoring configuration for courses using it",
"dependencies": {
},
"devDependencies": {}
}
Loading