From 9e913406793b80dace4d0b80a0d893e115a02c27 Mon Sep 17 00:00:00 2001 From: "sandro.costa@fccn.pt" Date: Thu, 18 Jul 2024 16:52:50 +0000 Subject: [PATCH 1/3] fix: dependencies for build * Remove the dependencies for bootstrap to solve the build issue. * Change package name to reflect namespace. --- package-lock.json | 8 +++---- package.json | 30 +++++++++++++------------- src/learning-header/LearningHeader.jsx | 2 +- src/learning-header/_header.scss | 7 ++---- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08db9e741..8699a9042 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "@edx/frontend-component-header", - "version": "1.0.0-semantically-released", + "name": "@nauedu/frontend-component-header", + "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@edx/frontend-component-header", - "version": "1.0.0-semantically-released", + "name": "@nauedu/frontend-component-header", + "version": "1.0.0", "license": "AGPL-3.0", "dependencies": { "@fortawesome/fontawesome-svg-core": "1.2.36", diff --git a/package.json b/package.json index 761c267ee..f074a5632 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "@edx/frontend-component-header", - "version": "1.0.0-semantically-released", + "name": "@nauedu/frontend-component-header", + "version": "1.0.0", "description": "The standard header for Open edX", "main": "dist/index.js", "publishConfig": { @@ -24,23 +24,28 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/edx/frontend-component-header.git" + "url": "git+https://github.com/fccn/frontend-component-header-nau.git" }, "author": "edX", "license": "AGPL-3.0", "bugs": { - "url": "https://github.com/edx/frontend-component-header/issues" + "url": "https://github.com/fccn/frontend-component-header-nau/issues" }, - "homepage": "https://github.com/edx/frontend-component-header#readme", + "homepage": "https://github.com/fccn/frontend-component-header-nau#readme", "devDependencies": { "@edx/brand": "npm:@edx/brand-openedx@1.1.0", "@edx/frontend-build": "9.1.1", "@edx/frontend-platform": "1.15.1", "@edx/paragon": "19.6.0", + "@testing-library/dom": "7.31.2", + "@testing-library/jest-dom": "5.16.2", + "@testing-library/react": "10.4.9", "codecov": "3.8.3", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.6", "husky": "7.0.4", + "jest": "27.5.0", + "jest-chain": "1.1.5", "prop-types": "15.8.1", "react": "16.14.0", "react-dom": "16.14.0", @@ -49,22 +54,17 @@ "react-test-renderer": "16.14.0", "reactifex": "1.1.1", "redux": "4.1.2", - "redux-saga": "1.1.3", - "@testing-library/dom": "7.31.2", - "@testing-library/jest-dom": "5.16.2", - "jest": "27.5.0", - "jest-chain": "1.1.5", - "@testing-library/react": "10.4.9" + "redux-saga": "1.1.3" }, "dependencies": { - "babel-polyfill": "6.26.0", - "react-responsive": "8.2.0", - "react-transition-group": "4.4.2", "@fortawesome/fontawesome-svg-core": "1.2.36", "@fortawesome/free-brands-svg-icons": "5.15.4", "@fortawesome/free-regular-svg-icons": "5.15.4", "@fortawesome/free-solid-svg-icons": "5.15.4", - "@fortawesome/react-fontawesome": "^0.1.14" + "@fortawesome/react-fontawesome": "^0.1.14", + "babel-polyfill": "6.26.0", + "react-responsive": "8.2.0", + "react-transition-group": "4.4.2" }, "peerDependencies": { "@edx/frontend-platform": "^1.8.0", diff --git a/src/learning-header/LearningHeader.jsx b/src/learning-header/LearningHeader.jsx index ea9cdd0db..f79768c33 100644 --- a/src/learning-header/LearningHeader.jsx +++ b/src/learning-header/LearningHeader.jsx @@ -31,7 +31,7 @@ LinkedLogo.propTypes = { }; // this feature flag is not included on the frontend-platform, we have to get it directly from ENV -const enabledOrgLogo = process.env.ENABLED_ORG_LOGO || false; +const enabledOrgLogo = !!process.env.ENABLED_ORG_LOGO || false; function LearningHeader({ courseOrg, courseTitle, intl, showUserDropdown, diff --git a/src/learning-header/_header.scss b/src/learning-header/_header.scss index 357cc6b3a..389073439 100644 --- a/src/learning-header/_header.scss +++ b/src/learning-header/_header.scss @@ -1,10 +1,7 @@ -@import "../../node_modules/bootstrap/scss/bootstrap-grid"; -@import "../../node_modules/bootstrap/scss/mixins/breakpoints"; - .logo { img { - @include media-breakpoint-down(sm) { + @media (max-width: 576px) { max-width: 85% !important; } } -} \ No newline at end of file +} From 8f5e8398c33ebb0646bb27e180a065c254bed703 Mon Sep 17 00:00:00 2001 From: "sandro.costa@fccn.pt" Date: Tue, 23 Jul 2024 13:51:01 +0000 Subject: [PATCH 2/3] docs: update docs for deployment * Update env var for organization logos. * Update installation instructions. --- README.rst | 28 +++++++++++++++++++++++++- src/learning-header/LearningHeader.jsx | 2 +- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f5326771e..69617f547 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,8 @@ Environment Variables * ``AUTHN_MINIMAL_HEADER`` - A boolean flag which hides the main menu, user menu, and logged-out menu items when truthy. This is intended to be used in micro-frontends like frontend-app-authentication in which these menus are considered distractions from the user's task. +* ``ENABLE_ORG_LOGO`` - A boolean flag to enable the display of the org logo on the center of the + header nav bar. Defaults to **false** ************ Installation @@ -36,7 +38,7 @@ Installation To install this header into your Open edX micro-frontend, run the following command in your MFE: -``npm i --save @edx/frontend-component-header`` +``npm i --save @nauedu/frontend-component-header`` This will make the component available to be imported into your application. @@ -73,6 +75,30 @@ Build a production distribution:: npm run build +*********** +Publishing to npmjs.com +*********** + +Any changes to this library have to be pushed to npmjs.com to be reflected on the build. + +Publish to npm:: + + npm publish + + +*********** +Deploy in production +*********** +To replace the default edx header with the new one, use one of the following instructions: + +Add the necessary settings to the mfe_brand plugin:: + + RUN npm install '@edx/frontend-component-header@npm:@nauedu/frontend-component-header' + +Alternatively, you can specify the version:: + + RUN npm install '@edx/frontend-component-header@npm:@nauedu/frontend-component-header@1.0.0' + .. |Build Status| image:: https://api.travis-ci.com/edx/frontend-component-header.svg?branch=master :target: https://travis-ci.com/edx/frontend-component-header .. |Codecov| image:: https://img.shields.io/codecov/c/github/edx/frontend-component-header diff --git a/src/learning-header/LearningHeader.jsx b/src/learning-header/LearningHeader.jsx index f79768c33..9241e59b1 100644 --- a/src/learning-header/LearningHeader.jsx +++ b/src/learning-header/LearningHeader.jsx @@ -31,7 +31,7 @@ LinkedLogo.propTypes = { }; // this feature flag is not included on the frontend-platform, we have to get it directly from ENV -const enabledOrgLogo = !!process.env.ENABLED_ORG_LOGO || false; +const enabledOrgLogo = !!process.env.ENABLE_ORG_LOGO || false; function LearningHeader({ courseOrg, courseTitle, intl, showUserDropdown, From 8fefddf423c4a2f0261e493e0d6529d6b9251c2f Mon Sep 17 00:00:00 2001 From: "sandro.costa@fccn.pt" Date: Wed, 24 Jul 2024 20:25:36 +0000 Subject: [PATCH 3/3] feat: setup release workflow * Change package.json version and description * Change release workflow to reflect the correct branch --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- .releaserc | 2 +- package.json | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebf0f92e0..c3760033c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: Default CI on: push: branches: - - 'master' + - 'nau/*.master' pull_request: branches: - '**' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4a459f5a3..9ce884b47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release CI on: push: branches: - - master + - nau/*.master jobs: release: name: Release diff --git a/.releaserc b/.releaserc index b5529bf00..9f5d27a78 100644 --- a/.releaserc +++ b/.releaserc @@ -1,5 +1,5 @@ { - "branch": "master", + "branch": "nau/*.master", "tagFormat": "v${version}", "verifyConditions": [ "@semantic-release/npm", diff --git a/package.json b/package.json index f074a5632..c00217aa7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nauedu/frontend-component-header", - "version": "1.0.0", - "description": "The standard header for Open edX", + "version": "14.0.0-semantically-released", + "description": "NAU header for Open edX", "main": "dist/index.js", "publishConfig": { "access": "public"