feat: remove widgets in favor of plugins (#708)

This commit is contained in:
Maxwell Frank
2025-08-20 11:35:58 -04:00
committed by GitHub
parent 8d23e7585b
commit 8116956a4b
10 changed files with 7 additions and 17 deletions

View File

@@ -39,22 +39,12 @@ The parts of this MFE that can be customized in that manner are documented `here
Contributing Contributing
------------ ------------
A core goal of this app is to provide a clean experimentation interface. To promote this end, we have provided a Contributions are very welcome. Please read `So you want to contribute to Open edX <https://docs.openedx.org/en/latest/developers/quickstarts/so_you_want_to_contribute.html>`_ for details on how to get started as an Open edX contributor.
silo'ed code directory at ``src/widgets`` in which contributors should add their custom widget components. In order to
ensure our ability to maintain the code stability of the app, the code for these widgets should be strictly contained
within the bounds of that directory.
Once written, the widgets can be configured into one of our widget containers at ``src/containers/WidgetContainers``. This project is currently accepting all types of contributions — bug fixes, security fixes, maintenance work, or new features.
This can include conditional logic, as well as Optimizely triggers. It is important to note that our integration tests However, if you intend to add a new feature, make sure it has gone through the `Product Review process <https://openedx.atlassian.net/wiki/spaces/COMM/pages/3875962884/How+to+submit+an+open+source+contribution+for+Product+Review>`_.
will isolate and ignore these containers, and thus testing your widget is the response of the creator/maintainer of the
widget itself.
Some guidelines for writing widgets: When proposing a change, create an issue in this repo to get the discussion started.
* Code for the widget should be strictly confined to the ``src/widgets`` directory.
* You can load data from the redux store, but should not add or modify fields in that structure.
* Network events should be managed in component hooks, though can use our ``data/constants/requests:requestStates`` for
ease of tracking the request states.
License License
------- -------

View File

@@ -22,7 +22,7 @@ import track from 'tracking';
import fakeData from 'data/services/lms/fakeData/courses'; import fakeData from 'data/services/lms/fakeData/courses';
import AppWrapper from 'containers/WidgetContainers/AppWrapper'; import AppWrapper from 'containers/AppWrapper';
import LearnerDashboardHeader from 'containers/LearnerDashboardHeader'; import LearnerDashboardHeader from 'containers/LearnerDashboardHeader';
import { getConfig } from '@edx/frontend-platform'; import { getConfig } from '@edx/frontend-platform';

View File

@@ -13,7 +13,7 @@ jest.mock('@edx/frontend-component-footer', () => ({
})); }));
jest.mock('containers/Dashboard', () => jest.fn(() => <div>Dashboard</div>)); jest.mock('containers/Dashboard', () => jest.fn(() => <div>Dashboard</div>));
jest.mock('containers/LearnerDashboardHeader', () => jest.fn(() => <div>LearnerDashboardHeader</div>)); jest.mock('containers/LearnerDashboardHeader', () => jest.fn(() => <div>LearnerDashboardHeader</div>));
jest.mock('containers/WidgetContainers/AppWrapper', () => jest.fn(({ children }) => <div className="AppWrapper">{children}</div>)); jest.mock('containers/AppWrapper', () => jest.fn(({ children }) => <div className="AppWrapper">{children}</div>));
jest.mock('data/redux', () => ({ jest.mock('data/redux', () => ({
selectors: 'redux.selectors', selectors: 'redux.selectors',
actions: 'redux.actions', actions: 'redux.actions',

View File

@@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import { PluginSlot } from '@openedx/frontend-plugin-framework'; import { PluginSlot } from '@openedx/frontend-plugin-framework';
import LookingForChallengeWidget from 'widgets/LookingForChallengeWidget'; import LookingForChallengeWidget from 'plugins/LookingForChallengeWidget';
// eslint-disable-next-line arrow-body-style // eslint-disable-next-line arrow-body-style
export const WidgetSidebarSlot = () => ( export const WidgetSidebarSlot = () => (