From cb1de82f0a88adc3d9185eb8009d1d8dddea5237 Mon Sep 17 00:00:00 2001 From: Brian Smith <112954497+brian-smith-tcril@users.noreply.github.com> Date: Thu, 24 Apr 2025 07:47:52 -0400 Subject: [PATCH] feat: standardize slot ids (#608) --- package-lock.json | 2 +- package.json | 2 +- src/plugin-slots/CourseCardActionSlot/README.md | 8 ++++++-- src/plugin-slots/CourseCardActionSlot/index.jsx | 3 ++- src/plugin-slots/CourseListSlot/README.md | 7 +++++-- src/plugin-slots/CourseListSlot/index.jsx | 6 +++++- src/plugin-slots/NoCoursesViewSlot/README.md | 7 +++++-- src/plugin-slots/NoCoursesViewSlot/index.jsx | 5 ++++- src/plugin-slots/README.md | 8 ++++---- src/plugin-slots/WidgetSidebarSlot/README.md | 7 +++++-- .../WidgetSidebarSlot/__snapshots__/index.test.jsx.snap | 7 ++++++- src/plugin-slots/WidgetSidebarSlot/index.jsx | 5 ++++- 12 files changed, 48 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index fad5a33..696b7c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.2.0", - "@openedx/frontend-plugin-framework": "^1.6.0", + "@openedx/frontend-plugin-framework": "^1.7.0", "@openedx/frontend-slot-footer": "^1.0.2", "@openedx/paragon": "^22.16.0", "@redux-devtools/extension": "3.3.0", diff --git a/package.json b/package.json index 51c32c9..472fc6e 100755 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@fortawesome/free-brands-svg-icons": "^5.15.4", "@fortawesome/free-solid-svg-icons": "^5.15.4", "@fortawesome/react-fontawesome": "^0.2.0", - "@openedx/frontend-plugin-framework": "^1.6.0", + "@openedx/frontend-plugin-framework": "^1.7.0", "@openedx/frontend-slot-footer": "^1.0.2", "@openedx/paragon": "^22.16.0", "@redux-devtools/extension": "3.3.0", diff --git a/src/plugin-slots/CourseCardActionSlot/README.md b/src/plugin-slots/CourseCardActionSlot/README.md index 3447063..7a6c353 100644 --- a/src/plugin-slots/CourseCardActionSlot/README.md +++ b/src/plugin-slots/CourseCardActionSlot/README.md @@ -1,6 +1,10 @@ # Course Card Action Slot -### Slot ID: `course_card_action_slot` +### Slot ID: `org.openedx.frontend.learner_dashboard.course_card_action.v1` + +### Slot ID Aliases +* `course_card_action_slot` + ### Props: * `cardId` @@ -20,7 +24,7 @@ import ActionButton from 'containers/CourseCard/components/CourseCardActions/Act const config = { pluginSlots: { - course_card_action_slot: { + 'org.openedx.frontend.learner_dashboard.course_card_action.v1': { keepDefault: false, plugins: [ { diff --git a/src/plugin-slots/CourseCardActionSlot/index.jsx b/src/plugin-slots/CourseCardActionSlot/index.jsx index 7a95b67..0ddc2b8 100644 --- a/src/plugin-slots/CourseCardActionSlot/index.jsx +++ b/src/plugin-slots/CourseCardActionSlot/index.jsx @@ -4,7 +4,8 @@ import { PluginSlot } from '@openedx/frontend-plugin-framework'; const CourseCardActionSlot = ({ cardId }) => ( ( - + ); diff --git a/src/plugin-slots/NoCoursesViewSlot/README.md b/src/plugin-slots/NoCoursesViewSlot/README.md index 92389fa..c6c62ea 100644 --- a/src/plugin-slots/NoCoursesViewSlot/README.md +++ b/src/plugin-slots/NoCoursesViewSlot/README.md @@ -1,6 +1,9 @@ # No Courses View Slot -### Slot ID: `no_courses_view_slot` +### Slot ID: `org.openedx.frontend.learner_dashboard.no_courses_view.v1` + +### Slot ID Aliases +* `no_courses_view_slot` ## Description @@ -21,7 +24,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame const config = { pluginSlots: { - no_courses_view_slot: { + 'org.openedx.frontend.learner_dashboard.no_courses_view.v1': { // Hide the default NoCoursesView component keepDefault: false, plugins: [ diff --git a/src/plugin-slots/NoCoursesViewSlot/index.jsx b/src/plugin-slots/NoCoursesViewSlot/index.jsx index cbb70e4..564b760 100644 --- a/src/plugin-slots/NoCoursesViewSlot/index.jsx +++ b/src/plugin-slots/NoCoursesViewSlot/index.jsx @@ -4,7 +4,10 @@ import { PluginSlot } from '@openedx/frontend-plugin-framework'; import NoCoursesView from 'containers/CoursesPanel/NoCoursesView'; export const NoCoursesViewSlot = () => ( - + ); diff --git a/src/plugin-slots/README.md b/src/plugin-slots/README.md index 91370bf..893cc7e 100644 --- a/src/plugin-slots/README.md +++ b/src/plugin-slots/README.md @@ -1,8 +1,8 @@ # `frontend-app-learner-dashboard` Plugin Slots -* [`course_card_action_slot`](./CourseCardActionSlot/) +* [`org.openedx.frontend.learner_dashboard.course_card_action.v1`](./CourseCardActionSlot/) * [`footer_slot`](./FooterSlot/) -* [`widget_sidebar_slot`](./WidgetSidebarSlot/) -* [`course_list_slot`](./CourseListSlot/) -* [`no_courses_view_slot`](./NoCoursesViewSlot/) +* [`org.openedx.frontend.learner_dashboard.widget_sidebar.v1`](./WidgetSidebarSlot/) +* [`org.openedx.frontend.learner_dashboard.course_list.v1`](./CourseListSlot/) +* [`org.openedx.frontend.learner_dashboard.no_courses_view.v1`](./NoCoursesViewSlot/) * [`org.openedx.frontend.learner_dashboard.dashboard_modal.v1`](./DashboardModalSlot) \ No newline at end of file diff --git a/src/plugin-slots/WidgetSidebarSlot/README.md b/src/plugin-slots/WidgetSidebarSlot/README.md index 39fcbf1..cb70bba 100644 --- a/src/plugin-slots/WidgetSidebarSlot/README.md +++ b/src/plugin-slots/WidgetSidebarSlot/README.md @@ -1,6 +1,9 @@ # Widget Sidebar Slot -### Slot ID: `widget_sidebar_slot` +### Slot ID: `org.openedx.frontend.learner_dashboard.widget_sidebar.v1` + +### Slot ID Aliases +* `widget_sidebar_slot` ## Description @@ -21,7 +24,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame const config = { pluginSlots: { - widget_sidebar_slot: { + 'org.openedx.frontend.learner_dashboard.widget_sidebar.v1': { // Hide the default LookingForChallenge component keepDefault: false, plugins: [ diff --git a/src/plugin-slots/WidgetSidebarSlot/__snapshots__/index.test.jsx.snap b/src/plugin-slots/WidgetSidebarSlot/__snapshots__/index.test.jsx.snap index 8a7ac4d..38ac325 100644 --- a/src/plugin-slots/WidgetSidebarSlot/__snapshots__/index.test.jsx.snap +++ b/src/plugin-slots/WidgetSidebarSlot/__snapshots__/index.test.jsx.snap @@ -2,7 +2,12 @@ exports[`WidgetSidebar snapshots 1`] = ` diff --git a/src/plugin-slots/WidgetSidebarSlot/index.jsx b/src/plugin-slots/WidgetSidebarSlot/index.jsx index d4bebe4..370027c 100644 --- a/src/plugin-slots/WidgetSidebarSlot/index.jsx +++ b/src/plugin-slots/WidgetSidebarSlot/index.jsx @@ -5,7 +5,10 @@ import LookingForChallengeWidget from 'widgets/LookingForChallengeWidget'; // eslint-disable-next-line arrow-body-style export const WidgetSidebarSlot = () => ( - + );