Compare commits

...

48 Commits

Author SHA1 Message Date
renovate[bot]
f47c1ed1e6 fix(deps): update jest monorepo to v30 (#620)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-14 06:41:21 +00:00
renovate[bot]
c63da3051b chore(deps): update dependency @openedx/paragon to v23.14.0 (#616)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-07-07 06:16:34 +00:00
renovate[bot]
04b35786d4 fix(deps): update font awesome to v6.7.2 (#610)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 12:47:21 +00:00
renovate[bot]
657e9c0190 chore(deps): update dependency @openedx/frontend-build to v14.6.1 (#609)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 12:47:03 +00:00
renovate[bot]
2874c9603f chore(deps): update dependency @openedx/paragon to v23.13.0 (#614)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-30 06:47:01 +00:00
renovate[bot]
ec5381ea17 chore(deps): update dependency @openedx/paragon to v23.12.2 (#606)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-16 05:48:54 +00:00
renovate[bot]
d5ac171a5b chore(deps): update dependency @edx/frontend-platform to v8.4.0 (#605)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-16 05:48:36 +00:00
renovate[bot]
3be690b34b chore(deps): update dependency @openedx/paragon to v23.10.1 (#602)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-09 05:36:02 +00:00
renovate[bot]
441e1542ad chore(deps): update dependency @edx/frontend-platform to v8.3.9 (#601)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-09 05:35:41 +00:00
renovate[bot]
c1db3d409e chore(deps): update dependency @openedx/paragon to v23.10.0 (#600)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-02 06:36:18 +00:00
renovate[bot]
0c343cfdf0 chore(deps): update dependency @edx/frontend-platform to v8.3.8 (#599)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-02 06:36:03 +00:00
renovate[bot]
f740d0107e chore(deps): update dependency react-router-dom to v6.30.1 (#597)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-26 06:57:40 +00:00
renovate[bot]
98bc20a282 chore(deps): update dependency @edx/frontend-platform to v8.3.7 (#596)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-26 06:57:30 +00:00
renovate[bot]
ca15863c82 chore(deps): update dependency react-router-dom to v6.30.0 (#595)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 06:08:20 +00:00
renovate[bot]
ff9cb1b238 chore(deps): update dependency @openedx/paragon to v23.6.0 (#594)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 06:08:14 +00:00
renovate[bot]
67967156f4 chore(deps): update dependency @edx/frontend-platform to v8.3.6 (#592)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 07:13:35 +00:00
renovate[bot]
e4720ff6b0 chore(deps): update dependency @openedx/paragon to v23.5.1 (#593)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 07:12:12 +00:00
renovate[bot]
df704ce6d7 chore(deps): update dependency @openedx/frontend-build to v14.6.0 (#591)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 07:44:35 +00:00
renovate[bot]
a2dc80ffb8 chore(deps): update dependency @edx/frontend-platform to v8.3.5 (#590)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-05 07:44:23 +00:00
Brian Smith
95efe7fedd feat: standardize slot ids (#589) 2025-04-23 15:45:16 -04:00
renovate[bot]
8df7d928dd chore(deps): update dependency @openedx/paragon to v23.4.5 (#588)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-21 05:55:17 +00:00
renovate[bot]
5e77a47708 chore(deps): update dependency @edx/frontend-platform to v8.3.4 (#587)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-21 05:54:58 +00:00
Régis Behmo
8ef3a27a62 chore: remove husky 🪓🐶
We remove husky, which is triggering pre-push git hooks, including
running "npm lint". This is causing failures when building Docker
images, because "npm clean-install --omit=dev" automatically triggers "npm
prepare", which attemps to run "husky". But husky is not listed in the
build dependencies, only in devDependencies. As a consequence, package
installation is failing with the following error:

        14.13 > @edx/frontend-app-ora-grading@0.0.1 prepare
        14.13 > husky install
        14.13
        14.15 sh: 1: husky: not found

Similar to: https://github.com/openedx/frontend-app-learning/pull/1622
2025-04-14 11:03:03 -03:00
vladislavkeblysh
e0841996d0 feat: added laber for header dropdown btn 2025-04-07 19:30:59 -07:00
renovate[bot]
90f2e2540e chore(deps): update dependency @openedx/paragon to v23.4.3 (#583)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-31 06:00:52 +00:00
renovate[bot]
6a02c517b9 chore(deps): update dependency @openedx/paragon to v23.4.2 (#582)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 06:00:25 +00:00
renovate[bot]
5076d55314 chore(deps): update dependency @edx/frontend-platform to v8.3.3 (#581)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-24 06:00:17 +00:00
Brian Smith
2f3b9b87ca feat: add react 18 support (#580) 2025-03-21 13:40:42 -04:00
Peter Kulko
7970561181 feat: added support Paragon design tokens (#351)
Co-authored-by: Diana Catalina Olarte <diana.olarte@edunext.co>
2025-03-18 12:41:04 -04:00
Brian Smith
8d46de8fe3 feat!: remove Paragon 21 support (#578)
BREAKING CHANGE: consumers must now use Paragon 22
2025-03-17 16:00:03 -04:00
renovate[bot]
8341f17d46 chore(deps): update dependency @openedx/paragon to v22.16.0 (#577)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 05:55:14 +00:00
renovate[bot]
d7c3e5a687 chore(deps): update dependency @edx/frontend-platform to v8.3.1 (#576)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-10 05:59:56 +00:00
renovate[bot]
07b1c5bde1 chore(deps): update dependency @openedx/paragon to v22.15.3 (#572)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-03 05:29:00 +00:00
renovate[bot]
5512faa9b0 chore(deps): update dependency @edx/frontend-platform to v8.2.1 (#570)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-24 05:38:39 +00:00
Kyle McCormick
48c49fe0b2 revert: fix: Remove Studio Maintenance link (#565)
This reverts commit a229c34535.

We are temporarily re-introducing the Maintenance link, as the Maintenance
Announcements tool is still in use, as discussed on:
https://github.com/openedx/edx-platform/pull/35852

For more details, see the related edx-platform revert:
https://github.com/openedx/edx-platform/pull/36107

In the future, this will be re-removed:
https://github.com/openedx/edx-platform/issues/36263
2025-02-19 14:25:06 -05:00
renovate[bot]
8c7778218b chore(deps): update dependency @edx/browserslist-config to v1.5.0 (#569)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-17 06:14:04 +00:00
Feanil Patel
0dedbbd589 docs: Document the owner and drop the old metadata file.
This is going to be changing soon with the module federation work so I
think it makes sense to be maintained by the committers-frontend group.

I'm also cleaning up the old openedx.yaml file which is obsolete and out
of date while I'm adding the new metadata that should be up-to-date.
2025-02-14 16:55:15 -03:00
renovate[bot]
ef0b101fea chore(deps): update dependency @edx/frontend-platform to v8.1.5 (#566)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 08:48:36 +00:00
renovate[bot]
edb22316b8 chore(deps): update dependency @openedx/paragon to v22.13.0 (#564)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-30 06:16:38 +00:00
renovate[bot]
227a97afa1 chore(deps): update dependency @edx/browserslist-config to v1.4.0 (#563)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-30 05:11:57 +00:00
renovate[bot]
d01486e5f7 chore(deps): update dependency react-router-dom to v6.28.1 (#562)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-23 06:17:00 +00:00
renovate[bot]
a58f1eaf19 chore(deps): update dependency @edx/frontend-platform to v8.1.3 (#561)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-16 06:24:09 +00:00
Brian Smith
a5024c3fde fix: move overflow: hidden to address mixed-decls warning (#549)
https://sass-lang.com/documentation/breaking-changes/mixed-decls/
2024-12-09 12:20:38 -05:00
renovate[bot]
d7be18e717 chore(deps): update dependency @openedx/frontend-build to v14.2.2 (#559)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-09 06:44:08 +00:00
renovate[bot]
5e405da37e fix(deps): update dependency @openedx/frontend-plugin-framework to v1.4.1 (#558)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-02 07:19:05 +00:00
renovate[bot]
901f39f42c chore(deps): update dependency @openedx/frontend-build to v14.2.0 (#557)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-25 06:30:07 +00:00
Brian Smith
346a636b76 feat: add pluginProps to CourseInfoSlot (#550) 2024-11-18 14:22:32 -05:00
renovate[bot]
34dcc88880 chore(deps): update dependency @openedx/paragon to v22.10.0 (#554)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-18 05:02:52 +00:00
46 changed files with 9911 additions and 2524 deletions

2
.gitignore vendored
View File

@@ -9,4 +9,4 @@ module.config.js
.idea/ .idea/
.vscode .vscode
src/i18n/messages src/i18n/messages

14
catalog-info.yaml Normal file
View File

@@ -0,0 +1,14 @@
# This file records information about this repo. Its use is described in OEP-55:
# https://open-edx-proposals.readthedocs.io/en/latest/processes/oep-0055-proc-project-maintainers.html
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: "frontend-component-header"
description: "A generic header for the Open edX micro-frontend applications."
annotations:
openedx.org/arch-interest-groups: ""
spec:
owner: group:committers-frontend
type: "library"
lifecycle: "production"

View File

@@ -1,6 +1,4 @@
@import "@edx/brand/paragon/fonts"; @use "@openedx/paragon/dist/core.min.css" as paragonCore;
@import "@edx/brand/paragon/variables"; @use "@openedx/paragon/dist/light.min.css" as paragonLight;
@import "@openedx/paragon/scss/core/core";
@import "@edx/brand/paragon/overrides";
@import "@edx/frontend-component-header/index"; @import "@edx/frontend-component-header/index";

View File

@@ -1,8 +0,0 @@
# openedx.yaml
---
owner: edx/fedx-team
tags:
- library
- component
- react

11989
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,7 @@
"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"
@@ -17,11 +18,6 @@
"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"
@@ -35,45 +31,44 @@
"devDependencies": { "devDependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2", "@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/browserslist-config": "^1.1.1", "@edx/browserslist-config": "^1.1.1",
"@edx/frontend-platform": "8.1.2", "@edx/frontend-platform": "^8.3.1",
"@edx/reactifex": "^2.1.1", "@edx/reactifex": "^2.1.1",
"@openedx/frontend-build": "14.1.5", "@openedx/frontend-build": "^14.3.2",
"@openedx/paragon": "22.9.0", "@openedx/paragon": "^23.0.0",
"@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": "10.4.9", "@testing-library/react": "^16.2.0",
"husky": "8.0.3", "jest": "30.0.4",
"jest": "29.7.0",
"jest-chain": "1.1.6", "jest-chain": "1.1.6",
"prop-types": "15.8.1", "prop-types": "15.8.1",
"react": "17.0.2", "react": "^18.3.1",
"react-dom": "17.0.2", "react-dom": "^18.3.1",
"react-redux": "7.2.9", "react-redux": "^8.1.1",
"react-router-dom": "6.28.0", "react-router-dom": "6.30.1",
"react-test-renderer": "17.0.2", "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.3.0", "@openedx/frontend-plugin-framework": "^1.7.0",
"axios-mock-adapter": "1.22.0", "axios-mock-adapter": "1.22.0",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
"classnames": "^2.5.1", "classnames": "^2.5.1",
"jest-environment-jsdom": "^29.7.0", "jest-environment-jsdom": "^30.0.0",
"react-responsive": "8.2.0", "react-responsive": "8.2.0",
"react-transition-group": "4.4.5" "react-transition-group": "4.4.5"
}, },
"peerDependencies": { "peerDependencies": {
"@edx/frontend-platform": "^7.0.0 || ^8.0.0", "@edx/frontend-platform": "^7.0.0 || ^8.0.0",
"@openedx/paragon": ">= 21.5.7 < 23.0.0", "@openedx/paragon": ">= 22.0.0 < 24.0.0",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0", "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.9.0 || ^17.0.0", "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-router-dom": "^6.14.2" "react-router-dom": "^6.14.2"
} }
} }

View File

@@ -61,6 +61,11 @@ const messages = defineMessages({
defaultMessage: 'Studio Home', defaultMessage: 'Studio Home',
description: 'Link to the Studio Home', description: 'Link to the Studio Home',
}, },
'header.user.menu.studio.maintenance': {
id: 'header.user.menu.studio.maintenance',
defaultMessage: 'Maintenance',
description: 'Link to the Studio Maintenance',
},
'header.label.account.nav': { 'header.label.account.nav': {
id: 'header.label.account.nav', id: 'header.label.account.nav',
defaultMessage: 'Account', defaultMessage: 'Account',

View File

@@ -1,45 +1,45 @@
.menu { .menu {
position: relative; position: relative;
} }
.menu-content { .menu-content {
position: absolute; position: absolute;
top: 100%; top: 100%;
z-index: 10; z-index: 10;
background: #fff; background: var(--pgn-color-white, #fff);
min-width: 10rem; min-width: 10rem;
&.pin-left { &.pin-left {
left: 0; left: 0;
} }
&.pin-right { &.pin-right {
right: 0; right: 0;
} }
} }
.menu-dropdown-enter { .menu-dropdown-enter {
opacity: 0; opacity: 0;
transform-origin: 75% 0; transform-origin: 75% 0;
transform: scale3d(0.8, 0.8, 1); transform: scale3d(0.8, 0.8, 1);
} }
.menu-dropdown-enter-active { .menu-dropdown-enter-active {
transform-origin: 75% 0; transform-origin: 75% 0;
transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1); transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1);
opacity: 1; opacity: 1;
} }
.menu-dropdown-enter-done {
}
.menu-dropdown-exit { .menu-dropdown-exit {
transform-origin: 75% 0; transform-origin: 75% 0;
transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1);
opacity: 1; opacity: 1;
} }
.menu-dropdown-exit-active { .menu-dropdown-exit-active {
transform-origin: 75% 0; transform-origin: 75% 0;
transform: scale3d(0.8, 0.8, 1); transform: scale3d(0.8, 0.8, 1);
transition: all 250ms cubic-bezier(0.8, 0, 0.6, 1); transition: all 250ms cubic-bezier(0.8, 0, 0.6, 1);
opacity: 0; opacity: 0;
} }
.menu-dropdown-exit-done {
}

View File

@@ -1,6 +1,9 @@
$spacer: 1rem; $spacer: 1rem;
$blue: #007db8; $blue: #007db8;
$white: #fff; $white: #fff;
$component-active-bg: #0A3055FF !default;
$component-active-color: $white !default;
$rounded-pill: 50rem !default;
@import './Menu/menu.scss'; @import './Menu/menu.scss';
@import './studio-header/StudioHeader.scss'; @import './studio-header/StudioHeader.scss';
@@ -21,8 +24,9 @@ $white: #fff;
padding: .75rem; padding: .75rem;
justify-content: center; justify-content: center;
align-items:center; align-items:center;
&:hover, &:focus { &:hover, &:focus {
background: rgba(0,0,0,.1); background: rgba(0, 0, 0, .1);
} }
} }
@@ -36,17 +40,12 @@ $white: #fff;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding-bottom: 0.1rem; padding-bottom: calc(var(--pgn-spacing-spacer-base, $spacer)* 0.1);
} }
} }
.user-dropdown { .user-dropdown .btn {
.btn { height: 3rem;
height: 3rem;
// @media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
// padding: 0 0.5rem;
// }
}
} }
} }
@@ -63,6 +62,7 @@ $white: #fff;
text-decoration: none; text-decoration: none;
cursor: pointer; cursor: pointer;
} }
img { img {
height: 1.5rem; height: 1.5rem;
} }
@@ -70,19 +70,22 @@ $white: #fff;
.site-header-desktop { .site-header-desktop {
box-shadow: 0 1px 0 0 rgba(0,0,0,.1); box-shadow: 0 1px 0 0 rgba(0, 0, 0, .1);
background: $white; background: var(--pgn-color-white, $white);
.nav-link { .nav-link {
text-decoration: none; text-decoration: none;
} }
.logo { .logo {
display: block; display: block;
box-sizing: content-box; box-sizing: content-box;
position: relative; position: relative;
top: -.05em; top: -.05em;
height: 1.75rem; height: 1.75rem;
padding: 1rem 0; padding: var(--pgn-spacing-spacer-base, $spacer) 0;
margin-right: 1rem; margin-right: var(--pgn-spacing-spacer-base, $spacer);
img { img {
display: block; display: block;
height: 100%; height: 100%;
@@ -93,38 +96,42 @@ $white: #fff;
.nav-link:focus, .nav-link:focus,
.nav-link.active, .nav-link.active,
.expanded .nav-link { .expanded .nav-link {
background: $component-active-bg; background: var(--pgn-color-bg-active, $component-active-bg);
color: $component-active-color; color: var(--pgn-color-active, $component-active-color);
} }
} }
.main-nav { .main-nav {
.nav-link { .nav-link {
padding: 1.125rem 1rem; padding: 1.125rem var(--pgn-spacing-spacer-base, $spacer);
text-decoration: none; text-decoration: none;
font-weight: 500; font-weight: 500;
letter-spacing: .01em; letter-spacing: .01em;
} }
.nav-link:hover, .nav-link:hover,
.nav-link:focus, .nav-link:focus,
.nav-link.active, .nav-link.active,
.expanded .nav-link { .expanded .nav-link {
background: $component-active-bg; background: var(--pgn-color-bg-active, $component-active-bg);
color: $component-active-color; color: var(--pgn-color-active, $component-active-color);
} }
.menu { .menu {
position: static; position: static;
.menu-content { .menu-content {
border-top: solid 2px $component-active-bg; border-top: solid 2px var(--pgn-color-bg-active);
left: 0; left: 0;
right: 0; right: 0;
box-shadow: 0 1px 2px rgba(0,0,0,.25); box-shadow: var(--pgn-elevation-box-shadow-down-1, 0 1px 2px rgba(0,0,0,.25));
border-bottom-left-radius: 2px; border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px; border-bottom-right-radius: 2px;
padding: 1rem; padding: var(--pgn-spacing-spacer-base, $spacer);
} }
} }
} }
.search-input { .search-input {
border-radius: $rounded-pill; border-radius: var(--pgn-size-rounded-pill, $rounded-pill);
} }
} }

View File

@@ -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}

View File

@@ -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;

View File

@@ -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: [
{ {

View File

@@ -9,10 +9,16 @@ 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,
}} }}
pluginProps={{
courseOrg,
courseNumber,
courseTitle,
}}
> >
<LearningHeaderCourseInfo <LearningHeaderCourseInfo
courseOrg={courseOrg} courseOrg={courseOrg}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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>
); );

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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: [
{ {

View File

@@ -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,
}} }}

View File

@@ -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;
``` ```

View File

@@ -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,
}} }}

View File

@@ -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;
``` ```

View File

@@ -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,
}} }}

View File

@@ -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;
``` ```

View File

@@ -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,
}} }}

View File

@@ -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/)

View File

@@ -36,16 +36,16 @@ const MobileHeader = ({
}; };
MobileHeader.propTypes = { MobileHeader.propTypes = {
studioBaseUrl: PropTypes.string.isRequired, studioBaseUrl: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
logoutUrl: PropTypes.string.isRequired, logoutUrl: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
number: PropTypes.string, number: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
org: PropTypes.string, org: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
title: PropTypes.string, title: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
logo: PropTypes.string, logo: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
logoAltText: PropTypes.string, logoAltText: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
authenticatedUserAvatar: PropTypes.string, authenticatedUserAvatar: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
username: PropTypes.string, username: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
isAdmin: PropTypes.bool, isAdmin: PropTypes.bool, // eslint-disable-line react/no-unused-prop-types
mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({ mainMenuDropdowns: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string, id: PropTypes.string,
buttonTitle: PropTypes.node, buttonTitle: PropTypes.node,
@@ -54,7 +54,7 @@ MobileHeader.propTypes = {
title: PropTypes.node, title: PropTypes.node,
})), })),
})), })),
outlineLink: PropTypes.string, outlineLink: PropTypes.string, // eslint-disable-line react/no-unused-prop-types
}; };
MobileHeader.defaultProps = { MobileHeader.defaultProps = {

View File

@@ -7,10 +7,10 @@ $white: #FFFFFF;
height: 3.75rem; height: 3.75rem;
box-shadow: 0 1px 0 0 rgb(0 0 0 / .1); box-shadow: 0 1px 0 0 rgb(0 0 0 / .1);
background: $white; background: var(--pgn-color-white, $white);
.btn-outline-primary { .btn-outline-primary {
border-color: $white; border-color: var(--pgn-color-white, $white);
} }
.logo { .logo {
@@ -19,8 +19,8 @@ $white: #FFFFFF;
position: relative; position: relative;
top: -.05em; top: -.05em;
height: 1.75rem; height: 1.75rem;
padding: $spacer 0; padding: var(--pgn-spacing-spacer-base, $spacer) 0;
margin-right: $spacer; margin-right: var(--pgn-spacing-spacer-base, $spacer);
img { img {
display: block; display: block;
@@ -29,17 +29,17 @@ $white: #FFFFFF;
} }
.course-title-lockup { .course-title-lockup {
overflow: hidden;
@media only screen and (min-width: 769px) { @media only screen and (min-width: 769px) {
padding: .5rem; padding: .5rem;
padding-right: $spacer; padding-right: var(--pgn-spacing-spacer-base, $spacer);
border-right: 1px solid #E5E5E5; border-right: 1px solid #E5E5E5;
width: 70%; width: 70%;
} }
overflow: hidden;
span { span {
color: #333333; color: var(--pgn-color-gray-800, #333333);
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@@ -12,6 +12,7 @@ import { Context as ResponsiveContext } from 'react-responsive';
import { MemoryRouter } from 'react-router-dom'; import { MemoryRouter } from 'react-router-dom';
import StudioHeader from './StudioHeader'; import StudioHeader from './StudioHeader';
import messages from './messages';
const authenticatedUser = { const authenticatedUser = {
userId: 3, userId: 3,
@@ -114,6 +115,16 @@ describe('Header', () => {
expect(dropdownOption).toBeVisible(); expect(dropdownOption).toBeVisible();
}); });
it('maintenance should not be in user menu', async () => {
currentUser = { ...authenticatedUser, administrator: false };
const { getAllByRole, queryByText } = render(<RootWrapper {...props} />);
const userMenu = getAllByRole('button')[1];
await waitFor(() => fireEvent.click(userMenu));
const maintenanceButton = queryByText(messages['header.user.menu.maintenance'].defaultMessage);
expect(maintenanceButton).toBeNull();
});
it('user menu should use avatar icon', async () => { it('user menu should use avatar icon', async () => {
currentUser = { ...authenticatedUser, avatar: null }; currentUser = { ...authenticatedUser, avatar: null };
const { getByTestId } = render(<RootWrapper {...props} />); const { getByTestId } = render(<RootWrapper {...props} />);
@@ -175,6 +186,15 @@ describe('Header', () => {
expect(desktopMenu).toBeNull(); expect(desktopMenu).toBeNull();
}); });
it('maintenance should be in user menu', async () => {
const { getAllByRole, getByText } = render(<RootWrapper {...props} />);
const userMenu = getAllByRole('button')[1];
await waitFor(() => fireEvent.click(userMenu));
const maintenanceButton = getByText(messages['header.user.menu.maintenance'].defaultMessage);
expect(maintenanceButton).toBeVisible();
});
it('user menu should use avatar image', async () => { it('user menu should use avatar image', async () => {
const { getByTestId } = render(<RootWrapper {...props} />); const { getByTestId } = render(<RootWrapper {...props} />);
const avatarImage = getByTestId('avatar-image'); const avatarImage = getByTestId('avatar-image');

View File

@@ -6,6 +6,11 @@ const messages = defineMessages({
defaultMessage: 'Studio Home', defaultMessage: 'Studio Home',
description: 'Link to Studio Home', description: 'Link to Studio Home',
}, },
'header.user.menu.maintenance': {
id: 'header.user.menu.maintenance',
defaultMessage: 'Maintenance',
description: 'Link to the Studio maintenance page',
},
'header.user.menu.logout': { 'header.user.menu.logout': {
id: 'header.user.menu.logout', id: 'header.user.menu.logout',
defaultMessage: 'Logout', defaultMessage: 'Logout',

View File

@@ -1,3 +1,4 @@
import { getConfig } from '@edx/frontend-platform';
import messages from './messages'; import messages from './messages';
const getUserMenuItems = ({ const getUserMenuItems = ({
@@ -20,6 +21,9 @@ const getUserMenuItems = ({
{ {
href: `${studioBaseUrl}`, href: `${studioBaseUrl}`,
title: intl.formatMessage(messages['header.user.menu.studio']), title: intl.formatMessage(messages['header.user.menu.studio']),
}, {
href: `${getConfig().STUDIO_BASE_URL}/maintenance`,
title: intl.formatMessage(messages['header.user.menu.maintenance']),
}, { }, {
href: `${logoutUrl}`, href: `${logoutUrl}`,
title: intl.formatMessage(messages['header.user.menu.logout']), title: intl.formatMessage(messages['header.user.menu.logout']),

View File

@@ -2,7 +2,9 @@ const path = require('path');
const { createConfig } = require('@openedx/frontend-build'); const { createConfig } = require('@openedx/frontend-build');
module.exports = createConfig('webpack-dev', { module.exports = createConfig('webpack-dev', {
entry: path.resolve(__dirname, 'example'), entry: {
app: path.resolve(__dirname, 'example'),
},
output: { output: {
path: path.resolve(__dirname, 'example/dist'), path: path.resolve(__dirname, 'example/dist'),
publicPath: '/', publicPath: '/',