feat!: Removes rendering of the RecommendationsPanel by default in Open edX (#311)

This commit is contained in:
Justin Hynes
2024-04-05 14:30:08 -04:00
committed by GitHub
parent 11bf6f2554
commit 5cd8b005b9
6 changed files with 16 additions and 6 deletions

View File

@@ -7,7 +7,9 @@ exports[`WidgetSidebar snapshots default 1`] = `
<div
className="d-flex flex-column"
>
<RecommendationsPanel />
<PluginSlot
id="widget_sidebar_plugin_slot"
/>
</div>
</div>
`;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { PluginSlot } from '@openedx/frontend-plugin-framework';
import RecommendationsPanel from 'widgets/RecommendationsPanel';
import hooks from 'widgets/ProductRecommendations/hooks';
export const WidgetSidebar = ({ setSidebarShowing }) => {
@@ -13,7 +13,7 @@ export const WidgetSidebar = ({ setSidebarShowing }) => {
return (
<div className="widget-sidebar">
<div className="d-flex flex-column">
<RecommendationsPanel />
<PluginSlot id="widget_sidebar_plugin_slot" />
</div>
</div>
);

View File

@@ -8,6 +8,9 @@ jest.mock('widgets/LookingForChallengeWidget', () => 'LookingForChallengeWidget'
jest.mock('widgets/ProductRecommendations/hooks', () => ({
useShowRecommendationsFooter: jest.fn(),
}));
jest.mock('@openedx/frontend-plugin-framework', () => ({
PluginSlot: 'PluginSlot',
}));
describe('WidgetSidebar', () => {
beforeEach(() => jest.resetAllMocks());

View File

@@ -7,7 +7,9 @@ exports[`WidgetSidebar snapshots default 1`] = `
<div
className="d-flex"
>
<RecommendationsPanel />
<PluginSlot
id="widget_sidebar_plugin_slot"
/>
</div>
</div>
`;

View File

@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { PluginSlot } from '@openedx/frontend-plugin-framework';
import RecommendationsPanel from 'widgets/RecommendationsPanel';
import hooks from 'widgets/ProductRecommendations/hooks';
export const WidgetSidebar = ({ setSidebarShowing }) => {
@@ -13,7 +13,7 @@ export const WidgetSidebar = ({ setSidebarShowing }) => {
return (
<div className="widget-sidebar px-2">
<div className="d-flex">
<RecommendationsPanel />
<PluginSlot id="widget_sidebar_plugin_slot" />
</div>
</div>
);

View File

@@ -8,6 +8,9 @@ jest.mock('widgets/LookingForChallengeWidget', () => 'LookingForChallengeWidget'
jest.mock('widgets/ProductRecommendations/hooks', () => ({
useShowRecommendationsFooter: jest.fn(),
}));
jest.mock('@openedx/frontend-plugin-framework', () => ({
PluginSlot: 'PluginSlot',
}));
describe('WidgetSidebar', () => {
beforeEach(() => jest.resetAllMocks());