Skip to content

Commit 95efe7f

Browse files
feat: standardize slot ids (#589)
1 parent 8df7d92 commit 95efe7f

File tree

31 files changed

+145
-84
lines changed

31 files changed

+145
-84
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"build": "make build",
1111
"i18n_extract": "fedx-scripts formatjs extract",
1212
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
13+
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
1314
"snapshot": "fedx-scripts jest --updateSnapshot",
1415
"start": "fedx-scripts webpack-dev-server --progress",
1516
"test": "fedx-scripts jest --coverage"
@@ -54,7 +55,7 @@
5455
"@fortawesome/free-regular-svg-icons": "6.6.0",
5556
"@fortawesome/free-solid-svg-icons": "6.6.0",
5657
"@fortawesome/react-fontawesome": "^0.2.0",
57-
"@openedx/frontend-plugin-framework": "^1.6.0",
58+
"@openedx/frontend-plugin-framework": "^1.7.0",
5859
"axios-mock-adapter": "1.22.0",
5960
"babel-polyfill": "6.26.0",
6061
"classnames": "^2.5.1",

src/plugin-slots/CourseInfoSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Course Info Slot
22

3-
### Slot ID: `course_info_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_learning_course_info.v1`
4+
5+
### Slot ID Aliases
6+
* `course_info_slot`
47

58
## Description
69

@@ -24,7 +27,7 @@ const replaceCourseTitle = ( widget ) => {
2427

2528
const config = {
2629
pluginSlots: {
27-
course_info_slot: {
30+
'org.openedx.frontend.layout.header_learning_course_info.v1': {
2831
keepDefault: true,
2932
plugins: [
3033
{
@@ -51,7 +54,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
5154

5255
const config = {
5356
pluginSlots: {
54-
course_info_slot: {
57+
'org.openedx.frontend.layout.header_learning_course_info.v1': {
5558
keepDefault: false,
5659
plugins: [
5760
{
@@ -83,7 +86,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
8386

8487
const config = {
8588
pluginSlots: {
86-
course_info_slot: {
89+
'org.openedx.frontend.layout.header_learning_course_info.v1': {
8790
keepDefault: true,
8891
plugins: [
8992
{

src/plugin-slots/CourseInfoSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const CourseInfoSlot = ({
99
...attributes
1010
}) => (
1111
<PluginSlot
12-
id="course_info_slot"
12+
id="org.openedx.frontend.layout.header_learning_course_info.v1"
13+
idAliases={['course_info_slot']}
1314
slotOptions={{
1415
mergeProps: true,
1516
}}

src/plugin-slots/DesktopHeaderSlot/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Desktop Header Slot
22

3-
### Slot ID: `desktop_header_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_desktop.v1`
4+
5+
### Slot ID Aliases
6+
* `desktop_header_slot`
47

58
## Description
69

@@ -19,7 +22,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
1922

2023
const config = {
2124
pluginSlots: {
22-
desktop_header_slot: {
25+
'org.openedx.frontend.layout.header_desktop.v1': {
2326
keepDefault: false,
2427
plugins: [
2528
{

src/plugin-slots/DesktopHeaderSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const DesktopHeaderSlot = ({
66
props,
77
}) => (
88
<PluginSlot
9-
id="desktop_header_slot"
9+
id="org.openedx.frontend.layout.header_desktop.v1"
10+
idAliases={['desktop_header_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

src/plugin-slots/DesktopLoggedOutItemsSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Desktop Logged Out Items Slot
22

3-
### Slot ID: `desktop_logged_out_items_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_desktop_logged_out_items.v1`
4+
5+
### Slot ID Aliases
6+
* `desktop_logged_out_items_slot`
47

58
## Description
69

@@ -40,7 +43,7 @@ const modifyLoggedOutItems = ( widget ) => {
4043

4144
const config = {
4245
pluginSlots: {
43-
desktop_logged_out_items_slot: {
46+
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
4447
keepDefault: true,
4548
plugins: [
4649
{
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6770

6871
const config = {
6972
pluginSlots: {
70-
desktop_logged_out_items_slot: {
73+
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
7174
keepDefault: false,
7275
plugins: [
7376
{
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
99102

100103
const config = {
101104
pluginSlots: {
102-
desktop_logged_out_items_slot: {
105+
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
103106
keepDefault: true,
104107
plugins: [
105108
{

src/plugin-slots/DesktopLoggedOutItemsSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const DesktopLoggedOutItemsSlot = ({
66
items,
77
}) => (
88
<PluginSlot
9-
id="desktop_logged_out_items_slot"
9+
id="org.openedx.frontend.layout.header_desktop_logged_out_items.v1"
10+
idAliases={['desktop_logged_out_items_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

src/plugin-slots/DesktopMainMenuSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Desktop Main Menu Slot
22

3-
### Slot ID: `desktop_main_menu_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_desktop_main_menu.v1`
4+
5+
### Slot ID Aliases
6+
* `desktop_main_menu_slot`
47

58
## Description
69

@@ -40,7 +43,7 @@ const modifyMainMenu = ( widget ) => {
4043

4144
const config = {
4245
pluginSlots: {
43-
desktop_main_menu_slot: {
46+
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
4447
keepDefault: true,
4548
plugins: [
4649
{
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6770

6871
const config = {
6972
pluginSlots: {
70-
desktop_main_menu_slot: {
73+
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
7174
keepDefault: false,
7275
plugins: [
7376
{
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
99102

100103
const config = {
101104
pluginSlots: {
102-
desktop_main_menu_slot: {
105+
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
103106
keepDefault: true,
104107
plugins: [
105108
{

src/plugin-slots/DesktopMainMenuSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const DesktopMainMenuSlot = ({
66
menu,
77
}) => (
88
<PluginSlot
9-
id="desktop_main_menu_slot"
9+
id="org.openedx.frontend.layout.header_desktop_main_menu.v1"
10+
idAliases={['desktop_main_menu_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

src/plugin-slots/DesktopSecondaryMenuSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Desktop Secondary Menu Slot
22

3-
### Slot ID: `desktop_secondary_menu_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_desktop_secondary_menu.v1`
4+
5+
### Slot ID Aliases
6+
* `desktop_secondary_menu_slot`
47

58
## Description
69

@@ -35,7 +38,7 @@ const modifySecondaryMenu = ( widget ) => {
3538

3639
const config = {
3740
pluginSlots: {
38-
desktop_secondary_menu_slot: {
41+
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
3942
keepDefault: true,
4043
plugins: [
4144
{
@@ -62,7 +65,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6265

6366
const config = {
6467
pluginSlots: {
65-
desktop_secondary_menu_slot: {
68+
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
6669
keepDefault: false,
6770
plugins: [
6871
{
@@ -94,7 +97,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
9497

9598
const config = {
9699
pluginSlots: {
97-
desktop_secondary_menu_slot: {
100+
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
98101
keepDefault: true,
99102
plugins: [
100103
{

src/plugin-slots/DesktopSecondaryMenuSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const DesktopSecondaryMenuSlot = ({
66
menu,
77
}) => (
88
<PluginSlot
9-
id="desktop_secondary_menu_slot"
9+
id="org.openedx.frontend.layout.header_desktop_secondary_menu.v1"
10+
idAliases={['desktop_secondary_menu_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

src/plugin-slots/DesktopUserMenuSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Desktop User Menu Slot
22

3-
### Slot ID: `desktop_user_menu_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_desktop_user_menu.v1`
4+
5+
### Slot ID Aliases
6+
* `desktop_user_menu_slot`
47

58
## Description
69

@@ -48,7 +51,7 @@ const modifyUserMenu = ( widget ) => {
4851

4952
const config = {
5053
pluginSlots: {
51-
desktop_user_menu_slot: {
54+
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
5255
keepDefault: true,
5356
plugins: [
5457
{
@@ -75,7 +78,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
7578

7679
const config = {
7780
pluginSlots: {
78-
desktop_user_menu_slot: {
81+
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
7982
keepDefault: false,
8083
plugins: [
8184
{
@@ -107,7 +110,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
107110

108111
const config = {
109112
pluginSlots: {
110-
desktop_user_menu_slot: {
113+
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
111114
keepDefault: true,
112115
plugins: [
113116
{

src/plugin-slots/DesktopUserMenuSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const DesktopUserMenuSlot = ({
66
menu,
77
}) => (
88
<PluginSlot
9-
id="desktop_user_menu_slot"
9+
id="org.openedx.frontend.layout.header_desktop_user_menu.v1"
10+
idAliases={['desktop_user_menu_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

src/plugin-slots/LearningHelpSlot/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Learning Help Slot
22

3-
### Slot ID: `learning_help_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_learning_help.v1`
4+
5+
### Slot ID Aliases
6+
* `learning_help_slot`
47

58
## Description
69

@@ -19,7 +22,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
1922

2023
const config = {
2124
pluginSlots: {
22-
learning_help_slot: {
25+
'org.openedx.frontend.layout.header_learning_help.v1': {
2326
keepDefault: false,
2427
plugins: [
2528
{

src/plugin-slots/LearningHelpSlot/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { PluginSlot } from '@openedx/frontend-plugin-framework';
33
import LearningHeaderHelpLink from '../../learning-header/LearningHeaderHelpLink';
44

55
const LearningHelpSlot = () => (
6-
<PluginSlot id="learning_help_slot">
6+
<PluginSlot id="org.openedx.frontend.layout.header_learning_help.v1" idAliases={['learning_help_slot']}>
77
<LearningHeaderHelpLink />
88
</PluginSlot>
99
);

src/plugin-slots/LearningLoggedOutItemsSlot/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Learning Logged Out Items Slot
22

3-
### Slot ID: `learning_logged_out_items_slot`
3+
### Slot ID: `org.openedx.frontend.layout.header_learning_logged_out_items.v1`
4+
5+
### Slot ID Aliases
6+
* `learning_logged_out_items_slot`
47

58
## Description
69

@@ -38,7 +41,7 @@ const modifyLoggedOutItems = ( widget ) => {
3841

3942
const config = {
4043
pluginSlots: {
41-
learning_logged_out_items_slot: {
44+
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
4245
keepDefault: true,
4346
plugins: [
4447
{
@@ -65,7 +68,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
6568

6669
const config = {
6770
pluginSlots: {
68-
learning_logged_out_items_slot: {
71+
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
6972
keepDefault: false,
7073
plugins: [
7174
{
@@ -97,7 +100,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
97100

98101
const config = {
99102
pluginSlots: {
100-
learning_logged_out_items_slot: {
103+
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
101104
keepDefault: true,
102105
plugins: [
103106
{

src/plugin-slots/LearningLoggedOutItemsSlot/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const LearningLoggedOutItemsSlot = ({
66
buttonsInfo,
77
}) => (
88
<PluginSlot
9-
id="learning_logged_out_items_slot"
9+
id="org.openedx.frontend.layout.header_learning_logged_out_items.v1"
10+
idAliases={['learning_logged_out_items_slot']}
1011
slotOptions={{
1112
mergeProps: true,
1213
}}

0 commit comments

Comments
 (0)