Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
813cbb3156 | ||
|
|
20aaa4f2e2 | ||
|
|
4dfb1b3053 | ||
|
|
171a770235 | ||
|
|
f47c1ed1e6 | ||
|
|
c63da3051b | ||
|
|
04b35786d4 | ||
|
|
657e9c0190 | ||
|
|
2874c9603f | ||
|
|
ec5381ea17 | ||
|
|
d5ac171a5b | ||
|
|
3be690b34b | ||
|
|
441e1542ad | ||
|
|
c1db3d409e | ||
|
|
0c343cfdf0 | ||
|
|
f740d0107e | ||
|
|
98bc20a282 | ||
|
|
ca15863c82 | ||
|
|
ff9cb1b238 | ||
|
|
67967156f4 | ||
|
|
e4720ff6b0 | ||
|
|
df704ce6d7 | ||
|
|
a2dc80ffb8 | ||
|
|
95efe7fedd | ||
|
|
8df7d928dd | ||
|
|
5e77a47708 | ||
|
|
8ef3a27a62 | ||
|
|
e0841996d0 | ||
|
|
90f2e2540e | ||
|
|
6a02c517b9 | ||
|
|
5076d55314 |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -24,6 +24,8 @@ jobs:
|
|||||||
run: make validate-no-uncommitted-package-lock-changes
|
run: make validate-no-uncommitted-package-lock-changes
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
- name: Type check
|
||||||
|
run: npm run types
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -25,6 +25,8 @@ jobs:
|
|||||||
run: make validate-no-uncommitted-package-lock-changes
|
run: make validate-no-uncommitted-package-lock-changes
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
- name: Type check
|
||||||
|
run: npm run types
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: i18n_extract
|
- name: i18n_extract
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import 'babel-polyfill';
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { initialize, getConfig, subscribe, APP_READY } from '@edx/frontend-platform';
|
import { initialize, getConfig, subscribe, APP_READY } from '@edx/frontend-platform';
|
||||||
|
|||||||
4403
package-lock.json
generated
4403
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
29
package.json
29
package.json
@@ -10,18 +10,15 @@
|
|||||||
"build": "make build",
|
"build": "make build",
|
||||||
"i18n_extract": "fedx-scripts formatjs extract",
|
"i18n_extract": "fedx-scripts formatjs extract",
|
||||||
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
|
"lint": "fedx-scripts eslint --ext .js --ext .jsx .",
|
||||||
|
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx .",
|
||||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||||
"start": "fedx-scripts webpack-dev-server --progress",
|
"start": "fedx-scripts webpack-dev-server --progress",
|
||||||
"test": "fedx-scripts jest --coverage"
|
"test": "fedx-scripts jest --coverage",
|
||||||
|
"types": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"/dist"
|
"/dist"
|
||||||
],
|
],
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "npm run lint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/openedx/frontend-component-header.git"
|
"url": "git+https://github.com/openedx/frontend-component-header.git"
|
||||||
@@ -42,29 +39,25 @@
|
|||||||
"@testing-library/dom": "^10.4.0",
|
"@testing-library/dom": "^10.4.0",
|
||||||
"@testing-library/jest-dom": "5.17.0",
|
"@testing-library/jest-dom": "5.17.0",
|
||||||
"@testing-library/react": "^16.2.0",
|
"@testing-library/react": "^16.2.0",
|
||||||
"husky": "8.0.3",
|
"jest": "30.0.5",
|
||||||
"jest": "29.7.0",
|
"jest-environment-jsdom": "^30.0.0",
|
||||||
"jest-chain": "1.1.6",
|
|
||||||
"prop-types": "15.8.1",
|
"prop-types": "15.8.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-redux": "^8.1.1",
|
"react-redux": "^8.1.1",
|
||||||
"react-router-dom": "6.28.1",
|
"react-router-dom": "6.30.1",
|
||||||
"react-test-renderer": "^18.3.1",
|
"react-test-renderer": "^18.3.1",
|
||||||
"redux": "4.2.1",
|
"redux": "4.2.1",
|
||||||
"redux-saga": "1.3.0"
|
"redux-saga": "1.3.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "6.6.0",
|
"@fortawesome/fontawesome-svg-core": "6.7.2",
|
||||||
"@fortawesome/free-brands-svg-icons": "6.6.0",
|
"@fortawesome/free-brands-svg-icons": "6.7.2",
|
||||||
"@fortawesome/free-regular-svg-icons": "6.6.0",
|
"@fortawesome/free-regular-svg-icons": "6.7.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "6.6.0",
|
"@fortawesome/free-solid-svg-icons": "6.7.2",
|
||||||
"@fortawesome/react-fontawesome": "^0.2.0",
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
||||||
"@openedx/frontend-plugin-framework": "^1.6.0",
|
"@openedx/frontend-plugin-framework": "^1.7.0",
|
||||||
"axios-mock-adapter": "1.22.0",
|
|
||||||
"babel-polyfill": "6.26.0",
|
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"jest-environment-jsdom": "^29.7.0",
|
|
||||||
"react-responsive": "8.2.0",
|
"react-responsive": "8.2.0",
|
||||||
"react-transition-group": "4.4.5"
|
"react-transition-group": "4.4.5"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ describe('<Header />', () => {
|
|||||||
};
|
};
|
||||||
const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
|
const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
|
||||||
|
|
||||||
|
// FIXME: react-test-renderer is deprecated. Convert to @testing-library/react.
|
||||||
const wrapper = TestRenderer.create(component);
|
const wrapper = TestRenderer.create(component);
|
||||||
|
|
||||||
expect(wrapper.toJSON()).toMatchSnapshot();
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
||||||
@@ -56,6 +57,7 @@ describe('<Header />', () => {
|
|||||||
};
|
};
|
||||||
const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
|
const component = <HeaderComponent width={{ width: 1280 }} contextValue={contextValue} />;
|
||||||
|
|
||||||
|
// FIXME: react-test-renderer is deprecated. Convert to @testing-library/react.
|
||||||
const wrapper = TestRenderer.create(component);
|
const wrapper = TestRenderer.create(component);
|
||||||
|
|
||||||
expect(wrapper.toJSON()).toMatchSnapshot();
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
||||||
@@ -74,6 +76,7 @@ describe('<Header />', () => {
|
|||||||
};
|
};
|
||||||
const component = <HeaderComponent width={{ width: 500 }} contextValue={contextValue} />;
|
const component = <HeaderComponent width={{ width: 500 }} contextValue={contextValue} />;
|
||||||
|
|
||||||
|
// FIXME: react-test-renderer is deprecated. Convert to @testing-library/react.
|
||||||
const wrapper = TestRenderer.create(component);
|
const wrapper = TestRenderer.create(component);
|
||||||
|
|
||||||
expect(wrapper.toJSON()).toMatchSnapshot();
|
expect(wrapper.toJSON()).toMatchSnapshot();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import messages from '../Header.messages';
|
|||||||
import { CaretIcon } from '../Icons';
|
import { CaretIcon } from '../Icons';
|
||||||
|
|
||||||
class DesktopHeader extends React.Component {
|
class DesktopHeader extends React.Component {
|
||||||
constructor(props) { // eslint-disable-line no-useless-constructor
|
constructor(props) { // eslint-disable-line @typescript-eslint/no-useless-constructor
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
41
src/frontend-platform.d.ts
vendored
Normal file
41
src/frontend-platform.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
// frontend-platform currently doesn't provide types... do it ourselves for i18n module at least.
|
||||||
|
// We can remove this in the future when we migrate to frontend-shell, or when frontend-platform gets types
|
||||||
|
// (whichever comes first).
|
||||||
|
|
||||||
|
declare module '@edx/frontend-platform/i18n' {
|
||||||
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
|
import { injectIntl as _injectIntl } from 'react-intl';
|
||||||
|
/** @deprecated Use useIntl() hook instead. */
|
||||||
|
export const injectIntl: typeof _injectIntl;
|
||||||
|
/** @deprecated Use useIntl() hook instead. */
|
||||||
|
export const intlShape: any;
|
||||||
|
|
||||||
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
|
export {
|
||||||
|
createIntl,
|
||||||
|
FormattedDate,
|
||||||
|
FormattedTime,
|
||||||
|
FormattedRelativeTime,
|
||||||
|
FormattedNumber,
|
||||||
|
FormattedPlural,
|
||||||
|
FormattedMessage,
|
||||||
|
defineMessages,
|
||||||
|
IntlProvider,
|
||||||
|
useIntl,
|
||||||
|
} from 'react-intl';
|
||||||
|
|
||||||
|
// Other exports from the i18n module:
|
||||||
|
export const configure: any;
|
||||||
|
export const getPrimaryLanguageSubtag: (code: string) => string;
|
||||||
|
export const getLocale: (locale?: string) => string;
|
||||||
|
export const getMessages: any;
|
||||||
|
export const isRtl: (locale?: string) => boolean;
|
||||||
|
export const handleRtl: any;
|
||||||
|
export const mergeMessages: any;
|
||||||
|
export const LOCALE_CHANGED: any;
|
||||||
|
export const LOCALE_TOPIC: any;
|
||||||
|
export const getCountryList: any;
|
||||||
|
export const getCountryMessages: any;
|
||||||
|
export const getLanguageList: any;
|
||||||
|
export const getLanguageMessages: any;
|
||||||
|
}
|
||||||
@@ -37,7 +37,7 @@ const AuthenticatedUserDropdown = ({ intl, username }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown className="user-dropdown ml-3">
|
<Dropdown className="user-dropdown ml-3">
|
||||||
<Dropdown.Toggle variant="outline-primary">
|
<Dropdown.Toggle variant="outline-primary" aria-label={intl.formatMessage(messages.userOptionsDropdownLabel)}>
|
||||||
<FontAwesomeIcon icon={faUserCircle} className="d-md-none" size="lg" />
|
<FontAwesomeIcon icon={faUserCircle} className="d-md-none" size="lg" />
|
||||||
<span data-hj-suppress className="d-none d-md-inline">
|
<span data-hj-suppress className="d-none d-md-inline">
|
||||||
{username}
|
{username}
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ const messages = defineMessages({
|
|||||||
defaultMessage: 'Sign Out',
|
defaultMessage: 'Sign Out',
|
||||||
description: 'The label for the user menu Sign Out action.',
|
description: 'The label for the user menu Sign Out action.',
|
||||||
},
|
},
|
||||||
|
userOptionsDropdownLabel: {
|
||||||
|
id: 'header.menu.aria-label',
|
||||||
|
defaultMessage: 'User Options',
|
||||||
|
description: 'The aria-label for the user options dropdown.',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default messages;
|
export default messages;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import messages from '../Header.messages';
|
|||||||
import { MenuIcon } from '../Icons';
|
import { MenuIcon } from '../Icons';
|
||||||
|
|
||||||
class MobileHeader extends React.Component {
|
class MobileHeader extends React.Component {
|
||||||
constructor(props) { // eslint-disable-line no-useless-constructor
|
constructor(props) { // eslint-disable-line @typescript-eslint/no-useless-constructor
|
||||||
super(props);
|
super(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Course Info Slot
|
# Course Info Slot
|
||||||
|
|
||||||
### Slot ID: `course_info_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_learning_course_info.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `course_info_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -24,7 +27,7 @@ const replaceCourseTitle = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
course_info_slot: {
|
'org.openedx.frontend.layout.header_learning_course_info.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -51,7 +54,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
course_info_slot: {
|
'org.openedx.frontend.layout.header_learning_course_info.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -83,7 +86,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
course_info_slot: {
|
'org.openedx.frontend.layout.header_learning_course_info.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ const CourseInfoSlot = ({
|
|||||||
...attributes
|
...attributes
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="course_info_slot"
|
id="org.openedx.frontend.layout.header_learning_course_info.v1"
|
||||||
|
idAliases={['course_info_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Desktop Header Slot
|
# Desktop Header Slot
|
||||||
|
|
||||||
### Slot ID: `desktop_header_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_desktop.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `desktop_header_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -19,7 +22,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_header_slot: {
|
'org.openedx.frontend.layout.header_desktop.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const DesktopHeaderSlot = ({
|
|||||||
props,
|
props,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="desktop_header_slot"
|
id="org.openedx.frontend.layout.header_desktop.v1"
|
||||||
|
idAliases={['desktop_header_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Desktop Logged Out Items Slot
|
# Desktop Logged Out Items Slot
|
||||||
|
|
||||||
### Slot ID: `desktop_logged_out_items_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_desktop_logged_out_items.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `desktop_logged_out_items_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ const modifyLoggedOutItems = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_desktop_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const DesktopLoggedOutItemsSlot = ({
|
|||||||
items,
|
items,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="desktop_logged_out_items_slot"
|
id="org.openedx.frontend.layout.header_desktop_logged_out_items.v1"
|
||||||
|
idAliases={['desktop_logged_out_items_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Desktop Main Menu Slot
|
# Desktop Main Menu Slot
|
||||||
|
|
||||||
### Slot ID: `desktop_main_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_desktop_main_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `desktop_main_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ const modifyMainMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_main_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_main_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_main_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_main_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const DesktopMainMenuSlot = ({
|
|||||||
menu,
|
menu,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="desktop_main_menu_slot"
|
id="org.openedx.frontend.layout.header_desktop_main_menu.v1"
|
||||||
|
idAliases={['desktop_main_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Desktop Secondary Menu Slot
|
# Desktop Secondary Menu Slot
|
||||||
|
|
||||||
### Slot ID: `desktop_secondary_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_desktop_secondary_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `desktop_secondary_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ const modifySecondaryMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_secondary_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -62,7 +65,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_secondary_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -94,7 +97,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_secondary_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_secondary_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const DesktopSecondaryMenuSlot = ({
|
|||||||
menu,
|
menu,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="desktop_secondary_menu_slot"
|
id="org.openedx.frontend.layout.header_desktop_secondary_menu.v1"
|
||||||
|
idAliases={['desktop_secondary_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Desktop User Menu Slot
|
# Desktop User Menu Slot
|
||||||
|
|
||||||
### Slot ID: `desktop_user_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_desktop_user_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `desktop_user_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ const modifyUserMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_user_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -75,7 +78,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_user_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -107,7 +110,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
desktop_user_menu_slot: {
|
'org.openedx.frontend.layout.header_desktop_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const DesktopUserMenuSlot = ({
|
|||||||
menu,
|
menu,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="desktop_user_menu_slot"
|
id="org.openedx.frontend.layout.header_desktop_user_menu.v1"
|
||||||
|
idAliases={['desktop_user_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Learning Help Slot
|
# Learning Help Slot
|
||||||
|
|
||||||
### Slot ID: `learning_help_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_learning_help.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `learning_help_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -19,7 +22,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_help_slot: {
|
'org.openedx.frontend.layout.header_learning_help.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { PluginSlot } from '@openedx/frontend-plugin-framework';
|
|||||||
import LearningHeaderHelpLink from '../../learning-header/LearningHeaderHelpLink';
|
import LearningHeaderHelpLink from '../../learning-header/LearningHeaderHelpLink';
|
||||||
|
|
||||||
const LearningHelpSlot = () => (
|
const LearningHelpSlot = () => (
|
||||||
<PluginSlot id="learning_help_slot">
|
<PluginSlot id="org.openedx.frontend.layout.header_learning_help.v1" idAliases={['learning_help_slot']}>
|
||||||
<LearningHeaderHelpLink />
|
<LearningHeaderHelpLink />
|
||||||
</PluginSlot>
|
</PluginSlot>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Learning Logged Out Items Slot
|
# Learning Logged Out Items Slot
|
||||||
|
|
||||||
### Slot ID: `learning_logged_out_items_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_learning_logged_out_items.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `learning_logged_out_items_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -38,7 +41,7 @@ const modifyLoggedOutItems = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -65,7 +68,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -97,7 +100,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_learning_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const LearningLoggedOutItemsSlot = ({
|
|||||||
buttonsInfo,
|
buttonsInfo,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="learning_logged_out_items_slot"
|
id="org.openedx.frontend.layout.header_learning_logged_out_items.v1"
|
||||||
|
idAliases={['learning_logged_out_items_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Learning User Menu Slot
|
# Learning User Menu Slot
|
||||||
|
|
||||||
### Slot ID: `learning_user_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_learning_user_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `learning_user_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -37,7 +40,7 @@ const modifyUserMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_user_menu_slot: {
|
'org.openedx.frontend.layout.header_learning_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -64,7 +67,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_user_menu_slot: {
|
'org.openedx.frontend.layout.header_learning_user_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -96,7 +99,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
learning_user_menu_slot: {
|
'org.openedx.frontend.layout.header_learning_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const LearningUserMenuSlot = ({
|
|||||||
items,
|
items,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="learning_user_menu_slot"
|
id="org.openedx.frontend.layout.header_learning_user_menu.v1"
|
||||||
|
idAliases={['learning_user_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Logo Slot
|
# Logo Slot
|
||||||
|
|
||||||
### Slot ID: `logo_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_logo.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `logo_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -22,7 +25,7 @@ const modifyLogoHref = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
logo_slot: {
|
'org.openedx.frontend.layout.header_logo.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -47,7 +50,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
logo_slot: {
|
'org.openedx.frontend.layout.header_logo.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const LogoSlot = ({
|
|||||||
href, src, alt, ...attributes
|
href, src, alt, ...attributes
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="logo_slot"
|
id="org.openedx.frontend.layout.header_logo.v1"
|
||||||
|
idAliases={['logo_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Mobile Header Slot
|
# Mobile Header Slot
|
||||||
|
|
||||||
### Slot ID: `mobile_header_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_mobile.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `mobile_header_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -19,7 +22,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_header_slot: {
|
'org.openedx.frontend.layout.header_mobile.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const MobileHeaderSlot = ({
|
|||||||
props,
|
props,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="mobile_header_slot"
|
id="org.openedx.frontend.layout.header_mobile.v1"
|
||||||
|
idAliases={['mobile_header_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Mobile Logged Out Items Slot
|
# Mobile Logged Out Items Slot
|
||||||
|
|
||||||
### Slot ID: `mobile_logged_out_items_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_mobile_logged_out_items.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `mobile_logged_out_items_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ const modifyLoggedOutItems = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_mobile_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_mobile_logged_out_items.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_logged_out_items_slot: {
|
'org.openedx.frontend.layout.header_mobile_logged_out_items.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -131,4 +134,3 @@ const config = {
|
|||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const MobileLoggedOutItemsSlot = ({
|
|||||||
items,
|
items,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="mobile_logged_out_items_slot"
|
id="org.openedx.frontend.layout.header_mobile_logged_out_items.v1"
|
||||||
|
idAliases={['mobile_logged_out_items_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Mobile Main Menu Slot
|
# Mobile Main Menu Slot
|
||||||
|
|
||||||
### Slot ID: `mobile_main_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_mobile_main_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `mobile_main_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -40,7 +43,7 @@ const modifyMainMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_main_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_main_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -67,7 +70,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_main_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_main_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -99,7 +102,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_main_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_main_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -131,4 +134,3 @@ const config = {
|
|||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const MobileMainMenuSlot = ({
|
|||||||
menu,
|
menu,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="mobile_main_menu_slot"
|
id="org.openedx.frontend.layout.header_mobile_main_menu.v1"
|
||||||
|
idAliases={['mobile_main_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
# Mobile User Menu Slot
|
# Mobile User Menu Slot
|
||||||
|
|
||||||
### Slot ID: `mobile_user_menu_slot`
|
### Slot ID: `org.openedx.frontend.layout.header_mobile_user_menu.v1`
|
||||||
|
|
||||||
|
### Slot ID Aliases
|
||||||
|
* `mobile_user_menu_slot`
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@@ -48,7 +51,7 @@ const modifyUserMenu = ( widget ) => {
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_user_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -75,7 +78,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_user_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_user_menu.v1': {
|
||||||
keepDefault: false,
|
keepDefault: false,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -107,7 +110,7 @@ import { DIRECT_PLUGIN, PLUGIN_OPERATIONS } from '@openedx/frontend-plugin-frame
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
pluginSlots: {
|
pluginSlots: {
|
||||||
mobile_user_menu_slot: {
|
'org.openedx.frontend.layout.header_mobile_user_menu.v1': {
|
||||||
keepDefault: true,
|
keepDefault: true,
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
@@ -139,4 +142,3 @@ const config = {
|
|||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ const MobileUserMenuSlot = ({
|
|||||||
menu,
|
menu,
|
||||||
}) => (
|
}) => (
|
||||||
<PluginSlot
|
<PluginSlot
|
||||||
id="mobile_user_menu_slot"
|
id="org.openedx.frontend.layout.header_mobile_user_menu.v1"
|
||||||
|
idAliases={['mobile_user_menu_slot']}
|
||||||
slotOptions={{
|
slotOptions={{
|
||||||
mergeProps: true,
|
mergeProps: true,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
# `frontend-component-header` Plugin Slots
|
# `frontend-component-header` Plugin Slots
|
||||||
|
|
||||||
* [`logo_slot`](./LogoSlot/)
|
### Shared
|
||||||
* [`desktop_main_menu_slot`](./DesktopMainMenuSlot/)
|
* [`org.openedx.frontend.layout.header_logo.v1`](./LogoSlot/)
|
||||||
* [`desktop_secondary_menu_slot`](./DesktopSecondaryMenuSlot/)
|
|
||||||
* [`mobile_main_menu_slot`](./MobileMainMenuSlot/)
|
### Desktop Header
|
||||||
* [`course_info_slot`](./CourseInfoSlot/)
|
* [`org.openedx.frontend.layout.header_desktop.v1`](./DesktopHeaderSlot/)
|
||||||
* [`learning_help_slot`](./LearningHelpSlot/)
|
* [`org.openedx.frontend.layout.header_desktop_logged_out_items.v1`](./DesktopLoggedOutItemsSlot/)
|
||||||
* [`desktop_logged_out_items_slot`](./DesktopLoggedOutItemsSlot/)
|
* [`org.openedx.frontend.layout.header_desktop_main_menu.v1`](./DesktopMainMenuSlot/)
|
||||||
* [`mobile_logged_out_items_slot`](./MobileLoggedOutItemsSlot/)
|
* [`org.openedx.frontend.layout.header_desktop_secondary_menu.v1`](./DesktopSecondaryMenuSlot/)
|
||||||
* [`mobile_user_menu_slot`](./MobileUserMenuSlot/)
|
* [`org.openedx.frontend.layout.header_desktop_user_menu.v1`](./DesktopUserMenuSlot/)
|
||||||
* [`desktop_user_menu_slot`](./DesktopUserMenuSlot/)
|
|
||||||
* [`learning_user_menu_slot`](./LearningUserMenuSlot/)
|
### Learning Header
|
||||||
* [`learning_logged_out_items_slot`](./LearningLoggedOutItemsSlot/)
|
* [`org.openedx.frontend.layout.header_learning_course_info.v1`](./CourseInfoSlot/)
|
||||||
* [`desktop_header_slot`](./DesktopHeaderSlot/)
|
* [`org.openedx.frontend.layout.header_learning_help.v1`](./LearningHelpSlot/)
|
||||||
|
* [`org.openedx.frontend.layout.header_learning_logged_out_items.v1`](./LearningLoggedOutItemsSlot/)
|
||||||
|
* [`org.openedx.frontend.layout.header_learning_user_menu.v1`](./LearningUserMenuSlot/)
|
||||||
|
|
||||||
|
### Mobile Header
|
||||||
|
* [`org.openedx.frontend.layout.header_mobile.v1`](./MobileHeaderSlot/)
|
||||||
|
* [`org.openedx.frontend.layout.header_mobile_logged_out_items.v1`](./MobileLoggedOutItemsSlot/)
|
||||||
|
* [`org.openedx.frontend.layout.header_mobile_main_menu.v1`](./MobileMainMenuSlot/)
|
||||||
|
* [`org.openedx.frontend.layout.header_mobile_user_menu.v1`](./MobileUserMenuSlot/)
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ import React from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import '@testing-library/jest-dom';
|
import '@testing-library/jest-dom';
|
||||||
import '@testing-library/jest-dom/extend-expect';
|
import '@testing-library/jest-dom/extend-expect';
|
||||||
import 'babel-polyfill';
|
|
||||||
import 'jest-chain';
|
|
||||||
import { getConfig, mergeConfig } from '@edx/frontend-platform';
|
import { getConfig, mergeConfig } from '@edx/frontend-platform';
|
||||||
import { configure as configureLogging } from '@edx/frontend-platform/logging';
|
import { configure as configureLogging } from '@edx/frontend-platform/logging';
|
||||||
import { configure as configureI18n } from '@edx/frontend-platform/i18n';
|
import { configure as configureI18n } from '@edx/frontend-platform/i18n';
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ describe('BrandNav Component', () => {
|
|||||||
it('displays a link that navigates to studioBaseUrl', () => {
|
it('displays a link that navigates to studioBaseUrl', () => {
|
||||||
render(<RootWrapper />);
|
render(<RootWrapper />);
|
||||||
|
|
||||||
const link = screen.getByRole('link');
|
const link = screen.getByRole('link') as HTMLAnchorElement;
|
||||||
expect(link.href).toBe(studioBaseUrl);
|
expect(link.href).toBe(studioBaseUrl);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -16,7 +16,7 @@ const mockProps = {
|
|||||||
|
|
||||||
const RootWrapper = (props) => (
|
const RootWrapper = (props) => (
|
||||||
<MemoryRouter>
|
<MemoryRouter>
|
||||||
<IntlProvider locale="en" messages={messages}>
|
<IntlProvider locale="en" messages={{}}>
|
||||||
<CourseLockUp {...props} />
|
<CourseLockUp {...props} />
|
||||||
</IntlProvider>
|
</IntlProvider>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
@@ -52,7 +52,8 @@ describe('CourseLockUp Component', () => {
|
|||||||
it('navigates to an absolute URL when clicked', () => {
|
it('navigates to an absolute URL when clicked', () => {
|
||||||
render(<RootWrapper {...mockProps} />);
|
render(<RootWrapper {...mockProps} />);
|
||||||
|
|
||||||
const link = screen.getByTestId('course-lock-up-block');
|
// FIXME: don't use testId - https://testing-library.com/docs/queries/about#priority
|
||||||
|
const link = screen.getByTestId('course-lock-up-block') as HTMLAnchorElement;
|
||||||
expect(link.href).toBe(mockProps.outlineLink);
|
expect(link.href).toBe(mockProps.outlineLink);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -35,7 +35,7 @@ const defaultProps = {
|
|||||||
|
|
||||||
const RootWrapper = (props) => (
|
const RootWrapper = (props) => (
|
||||||
<MemoryRouter>
|
<MemoryRouter>
|
||||||
<IntlProvider locale="en" messages={messages}>
|
<IntlProvider locale="en" messages={{}}>
|
||||||
<HeaderBody {...props} />
|
<HeaderBody {...props} />
|
||||||
</IntlProvider>
|
</IntlProvider>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
@@ -135,6 +135,7 @@ const HeaderBody = ({
|
|||||||
logoutUrl,
|
logoutUrl,
|
||||||
authenticatedUserAvatar,
|
authenticatedUserAvatar,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
|
isMobile,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Nav>
|
</Nav>
|
||||||
@@ -13,6 +13,7 @@ const MobileHeader = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{/* @ts-expect-error The type of 'props' is any until we convert from propTypes to TypeScript interface/types */}
|
||||||
<HeaderBody
|
<HeaderBody
|
||||||
{...props}
|
{...props}
|
||||||
isMobile
|
isMobile
|
||||||
@@ -26,7 +26,7 @@ let screenWidth = 1280;
|
|||||||
|
|
||||||
const RootWrapper = ({
|
const RootWrapper = ({
|
||||||
...props
|
...props
|
||||||
}) => {
|
}: React.ComponentProps<typeof StudioHeader>) => {
|
||||||
const appContextValue = useMemo(() => ({
|
const appContextValue = useMemo(() => ({
|
||||||
authenticatedUser: currentUser,
|
authenticatedUser: currentUser,
|
||||||
config: {
|
config: {
|
||||||
@@ -55,7 +55,7 @@ const RootWrapper = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = {
|
const props: React.ComponentProps<typeof StudioHeader> = {
|
||||||
number: '123',
|
number: '123',
|
||||||
org: 'Ed',
|
org: 'Ed',
|
||||||
title: 'test',
|
title: 'test',
|
||||||
@@ -74,6 +74,10 @@ const props = {
|
|||||||
outlineLink: 'tEsTLInK',
|
outlineLink: 'tEsTLInK',
|
||||||
searchButtonAction: null,
|
searchButtonAction: null,
|
||||||
isNewHomePage: true,
|
isNewHomePage: true,
|
||||||
|
// These default values shouldn't be needed but typescript is confused by propTypes; can remove after converting
|
||||||
|
// from propTypes to TypeScript:
|
||||||
|
containerProps: {},
|
||||||
|
isHiddenMainMenu: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('Header', () => {
|
describe('Header', () => {
|
||||||
@@ -19,6 +19,7 @@ const StudioHeader = ({
|
|||||||
number, org, title, containerProps, isHiddenMainMenu, mainMenuDropdowns,
|
number, org, title, containerProps, isHiddenMainMenu, mainMenuDropdowns,
|
||||||
outlineLink, searchButtonAction, isNewHomePage,
|
outlineLink, searchButtonAction, isNewHomePage,
|
||||||
}) => {
|
}) => {
|
||||||
|
// @ts-expect-error - frontend-platform doesn't yet have type information :/
|
||||||
const { authenticatedUser, config } = useContext(AppContext);
|
const { authenticatedUser, config } = useContext(AppContext);
|
||||||
const props = {
|
const props = {
|
||||||
logo: config.LOGO_URL,
|
logo: config.LOGO_URL,
|
||||||
12
tsconfig.json
Normal file
12
tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "@edx/typescript-config",
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"baseUrl": "./src",
|
||||||
|
"paths": {
|
||||||
|
"*": ["*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": ["*.js", ".eslintrc.js", "src/**/*", "plugins/**/*"],
|
||||||
|
"exclude": ["dist", "node_modules"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user