I tried using the example code from https://github.com/openedx/frontend-app-learner-dashboard/tree/frontend-base/src/slots/CourseBannerSlot by updating site.config.dev.tsx to be
-import { EnvironmentTypes, SiteConfig, footerApp, headerApp, shellApp } from '@openedx/frontend-base';
+import { EnvironmentTypes, WidgetOperationTypes, SiteConfig, footerApp, headerApp, shellApp } from '@openedx/frontend-base';
import { learnerDashboardApp } from './src';
+import { Alert } from '@openedx/paragon';
+
import '@openedx/frontend-base/shell/style';
+const myComponent = ({ cardId }) => (
+ <Alert variant="info" className="mb-0">
+ Course banner for course with {cardId}
+ </Alert>
+)
+
const siteConfig: SiteConfig = {
siteId: 'learner-dashboard-dev',
siteName: 'Learner Dashboard Dev',
@@ -17,7 +25,17 @@ const siteConfig: SiteConfig = {
shellApp,
headerApp,
footerApp,
- learnerDashboardApp
+ {
+ ...learnerDashboardApp,
+ slots: [
+ {
+ slotId: 'org.openedx.frontend.slot.learnerDashboard.courseCardBanner.v1',
+ id: 'my.widget',
+ op: WidgetOperationTypes.REPLACE,
+ component: myComponent
+ },
+ ]
+ },
],
externalRoutes: [
{
and got
adding relatedId: 'defaultContent', fixes the error. I'm not sure if that is supposed to be required for using WidgetOperationTypes.REPLACE or not
I tried using the example code from https://github.com/openedx/frontend-app-learner-dashboard/tree/frontend-base/src/slots/CourseBannerSlot by updating
site.config.dev.tsxto beand got
adding
relatedId: 'defaultContent',fixes the error. I'm not sure if that is supposed to be required for usingWidgetOperationTypes.REPLACEor not