Compare commits

..

9 Commits

Author SHA1 Message Date
Bilal Qamar
6421765100 refactor: updated workflow 2023-02-27 17:55:56 +05:00
Bilal Qamar
f27fc6fa07 refactor: updated workflow 2023-02-27 17:46:40 +05:00
Bilal Qamar
8f052a7ea1 refactor: updated workflow 2023-02-27 17:44:05 +05:00
Bilal Qamar
5e29402f5b refactor: updated workflow 2023-02-27 17:41:16 +05:00
Bilal Qamar
bc0eaf18fc refactor: updated workflow 2023-02-27 17:37:32 +05:00
Bilal Qamar
772008b361 refactor: updated workflow 2023-02-27 17:32:50 +05:00
Bilal Qamar
6e17d53b6a refactor: updated node version to v18 for release dry-run 2023-02-27 17:21:03 +05:00
Bilal Qamar
063ce855ca refactor: fixed build typo 2023-02-27 17:18:00 +05:00
Bilal Qamar
748d4746b3 refactor: added semantic-release-export-data & updated workflows 2023-02-27 17:12:30 +05:00
26 changed files with 35043 additions and 4449 deletions

View File

@@ -5,21 +5,22 @@ on:
- master - master
pull_request: pull_request:
branches: branches:
- '**' - master
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
- name: Setup Nodejs - name: Setup Nodejs
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_VER }} node-version: ${{ matrix.node }}
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Validate package-lock.json changes - name: Validate package-lock.json changes
@@ -34,3 +35,27 @@ jobs:
run: npm run i18n_extract run: npm run i18n_extract
- name: Coverage - name: Coverage
uses: codecov/codecov-action@v3 uses: codecov/codecov-action@v3
get-next-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npx semantic-release --dry-run
id: get-next-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: echo "The new release version is ${{ needs.get-next-version.outputs.new-release-version }}"
outputs:
new-release-published: ${{ steps.get-next-version.outputs.new-release-published }}
new-release-version: ${{ steps.get-next-version.outputs.new-release-version }}
build:
runs-on: ubuntu-latest
needs: get-next-version
steps:
- uses: actions/checkout@v3
- run: echo "The new release version is ${{ needs.get-next-version.outputs.new-release-version }}"

View File

@@ -10,4 +10,5 @@ on:
jobs: jobs:
version-check: version-check:
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master uses: openedx/.github/.github/workflows/lockfileversion-check.yml@master

View File

@@ -12,12 +12,10 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_VER }} node-version: 16
- name: Install dependencies - name: Install dependencies
run: npm ci run: npm ci
- name: Validate package-lock.json changes - name: Validate package-lock.json changes
@@ -33,7 +31,7 @@ jobs:
- name: Build - name: Build
run: npm run build run: npm run build
- name: Release - name: Release
uses: cycjimmy/semantic-release-action@v3 uses: cycjimmy/semantic-release-action@v2
with: with:
semantic_version: 16 semantic_version: 16
env: env:

1
.nvmrc
View File

@@ -1 +0,0 @@
18

View File

@@ -1,5 +1,5 @@
{ {
"branch": "master", "branches": ["master", "next"],
"tagFormat": "v${version}", "tagFormat": "v${version}",
"verifyConditions": [ "verifyConditions": [
"@semantic-release/npm", "@semantic-release/npm",
@@ -12,7 +12,13 @@
], ],
"analyzeCommits": "@semantic-release/commit-analyzer", "analyzeCommits": "@semantic-release/commit-analyzer",
"generateNotes": "@semantic-release/release-notes-generator", "generateNotes": "@semantic-release/release-notes-generator",
"prepare": "@semantic-release/npm", "prepare": [
"@semantic-release/npm",
{
"path": "semantic-release-export-data",
"output": "release.json"
}
],
"publish": [ "publish": [
"@semantic-release/npm", "@semantic-release/npm",
{ {

View File

@@ -1,9 +1,11 @@
export TRANSIFEX_RESOURCE = frontend-component-header transifex_resource = frontend-component-header
transifex_langs = "ar,fr,es_419,zh_CN,pt,it,de,uk,ru,hi,fr_CA" transifex_langs = "ar,fr,es_419,zh_CN,pt,it,de,uk,ru,hi,fr_CA"
transifex_utils = ./node_modules/.bin/transifex-utils.js transifex_utils = ./node_modules/.bin/transifex-utils.js
i18n = ./src/i18n i18n = ./src/i18n
transifex_input = $(i18n)/transifex_input.json transifex_input = $(i18n)/transifex_input.json
tx_url1 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/translation/en/strings/
tx_url2 = https://www.transifex.com/api/2/project/edx-platform/resource/$(transifex_resource)/source/
# This directory must match .babelrc . # This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl transifex_temp = ./temp/babel-plugin-react-intl
@@ -40,11 +42,11 @@ push_translations:
# Pushing strings to Transifex... # Pushing strings to Transifex...
tx push -s tx push -s
# Fetching hashes from Transifex... # Fetching hashes from Transifex...
./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh ./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
# Writing out comments to file... # Writing out comments to file...
$(transifex_utils) $(transifex_temp) --comments --v3-scripts-path $(transifex_utils) $(transifex_temp) --comments
# Pushing comments to Transifex... # Pushing comments to Transifex...
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh ./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
# Pulls translations from Transifex. # Pulls translations from Transifex.
pull_translations: pull_translations:

View File

@@ -65,7 +65,7 @@ Development
Install dependencies:: Install dependencies::
npm ci npm i
Start the development server:: Start the development server::

39256
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -31,47 +31,49 @@
"bugs": { "bugs": {
"url": "https://github.com/openedx/frontend-component-header/issues" "url": "https://github.com/openedx/frontend-component-header/issues"
}, },
"release": {
"branches": ["master", "next"]
},
"homepage": "https://github.com/openedx/frontend-component-header#readme", "homepage": "https://github.com/openedx/frontend-component-header#readme",
"devDependencies": { "devDependencies": {
"@edx/brand": "npm:@edx/brand-openedx@1.2.0", "@edx/brand": "npm:@edx/brand-openedx@1.2.0",
"@edx/browserslist-config": "^1.1.1", "@edx/browserslist-config": "^1.1.1",
"@edx/frontend-build": "12.9.3", "@edx/frontend-build": "^12.4.19",
"@edx/frontend-platform": "4.6.0", "@edx/frontend-platform": "^3.0.1",
"@edx/reactifex": "^2.1.1", "@testing-library/dom": "8.20.0",
"@testing-library/dom": "9.3.1", "@testing-library/jest-dom": "5.16.5",
"@testing-library/jest-dom": "5.17.0",
"@testing-library/react": "10.4.9", "@testing-library/react": "10.4.9",
"@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
"enzyme": "3.11.0", "enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.7",
"husky": "8.0.3", "husky": "8.0.3",
"jest": "29.6.2", "jest": "29.4.3",
"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": "16.14.0",
"react-dom": "17.0.2", "react-dom": "16.14.0",
"react-redux": "7.2.9", "react-redux": "7.2.9",
"react-router-dom": "5.3.4", "react-router-dom": "5.3.4",
"react-test-renderer": "17.0.2", "react-test-renderer": "16.14.0",
"reactifex": "1.1.1",
"redux": "4.2.1", "redux": "4.2.1",
"redux-saga": "1.2.3" "redux-saga": "1.2.2",
"semantic-release-export-data": "^1.0.1"
}, },
"dependencies": { "dependencies": {
"@edx/paragon": "20.45.5", "@edx/paragon": "20.28.4",
"@fortawesome/fontawesome-svg-core": "6.4.0", "@fortawesome/fontawesome-svg-core": "6.3.0",
"@fortawesome/free-brands-svg-icons": "6.4.0", "@fortawesome/free-brands-svg-icons": "6.3.0",
"@fortawesome/free-regular-svg-icons": "6.4.0", "@fortawesome/free-regular-svg-icons": "6.3.0",
"@fortawesome/free-solid-svg-icons": "6.4.0", "@fortawesome/free-solid-svg-icons": "6.3.0",
"@fortawesome/react-fontawesome": "^0.2.0", "@fortawesome/react-fontawesome": "^0.2.0",
"axios-mock-adapter": "1.21.5",
"babel-polyfill": "6.26.0", "babel-polyfill": "6.26.0",
"react-responsive": "8.2.0", "react-responsive": "8.2.0",
"react-router-dom": "5.3.4",
"react-transition-group": "4.4.5" "react-transition-group": "4.4.5"
}, },
"peerDependencies": { "peerDependencies": {
"@edx/frontend-platform": "^4.0.0", "@edx/frontend-platform": "^2.0.0 || ^3.0.0",
"prop-types": "^15.5.10", "prop-types": "^15.5.10",
"react": "^16.9.0 || ^17.0.0", "react": "^16.9.0",
"react-dom": "^16.9.0 || ^17.0.0" "react-dom": "^16.9.0"
} }
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "الحساب", "header.menu.account.label": "الحساب",
"header.menu.orderHistory.label": "سجل الطلبيات", "header.menu.orderHistory.label": "سجل الطلبيات",
"header.navigation.skipNavLink": "التخطي إلى المحتوى الرئيسي", "header.navigation.skipNavLink": "التخطي إلى المحتوى الرئيسي",
"header.menu.signOut.label": "تسجيل الخروج", "header.menu.signOut.label": "تسجيل الخروج"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Cuenta", "header.menu.account.label": "Cuenta",
"header.menu.orderHistory.label": "Historial de órdenes", "header.menu.orderHistory.label": "Historial de órdenes",
"header.navigation.skipNavLink": "Dirígete al contenido principal.", "header.navigation.skipNavLink": "Dirígete al contenido principal.",
"header.menu.signOut.label": "Cerrar sesión", "header.menu.signOut.label": "Cerrar sesión"
"notification.title": "Notificaciones",
"notification.today.heading": "Últimas 24 horas",
"notification.earlier.heading": "Más temprano",
"notification.mark.as.read": "Marcar todo como leído",
"notification.fullStop": "•",
"notification.load.more.notifications": "Cargar más notificaciones"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Compte", "header.menu.account.label": "Compte",
"header.menu.orderHistory.label": "Historique des commandes", "header.menu.orderHistory.label": "Historique des commandes",
"header.navigation.skipNavLink": "Passer au contenu principal", "header.navigation.skipNavLink": "Passer au contenu principal",
"header.menu.signOut.label": "Se déconnecter", "header.menu.signOut.label": "Se déconnecter"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Compte", "header.menu.account.label": "Compte",
"header.menu.orderHistory.label": "Historique des commandes", "header.menu.orderHistory.label": "Historique des commandes",
"header.navigation.skipNavLink": "Passer au contenu principal.", "header.navigation.skipNavLink": "Passer au contenu principal.",
"header.menu.signOut.label": "Se déconnecter", "header.menu.signOut.label": "Se déconnecter"
"notification.title": "Notifications",
"notification.today.heading": "Dernières 24 heures",
"notification.earlier.heading": "Plus tôt",
"notification.mark.as.read": "tout marquer comme lu",
"notification.fullStop": "•",
"notification.load.more.notifications": "Charger plus de notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -1,8 +1,8 @@
{ {
"general.register.sentenceCase": "Register", "general.register.sentenceCase": "Register",
"general.signIn.sentenceCase": "Увійти", "general.signIn.sentenceCase": "Sign in",
"header.links.courses": "Курси", "header.links.courses": "Courses",
"header.links.programs": "Програми", "header.links.programs": "Programs",
"header.links.content.search": "Discover New", "header.links.content.search": "Discover New",
"header.links.schools": "Schools & Partners", "header.links.schools": "Schools & Partners",
"header.user.menu.dashboard": "Dashboard", "header.user.menu.dashboard": "Dashboard",
@@ -15,25 +15,19 @@
"header.user.menu.studio.home": "Studio Home", "header.user.menu.studio.home": "Studio Home",
"header.user.menu.studio.maintenance": "Maintenance", "header.user.menu.studio.maintenance": "Maintenance",
"header.label.account.nav": "Account", "header.label.account.nav": "Account",
"header.label.account.menu": "Меню облікового запису", "header.label.account.menu": "Account Menu",
"header.label.account.menu.for": "Меню облікового запису для {username}", "header.label.account.menu.for": "Account menu for {username}",
"header.label.main.nav": "Main", "header.label.main.nav": "Main",
"header.label.main.menu": "Main Menu", "header.label.main.menu": "Main Menu",
"header.label.main.header": "Main", "header.label.main.header": "Main",
"header.label.secondary.nav": "Secondary", "header.label.secondary.nav": "Secondary",
"header.label.skip.nav": "Перейти до головного змісту", "header.label.skip.nav": "Skip to main content",
"header.label.app.nav": "App", "header.label.app.nav": "App",
"header.menu.dashboard.label": "Dashboard", "header.menu.dashboard.label": "Dashboard",
"header.help.label": "Help", "header.help.label": "Help",
"header.menu.profile.label": "Profile", "header.menu.profile.label": "Profile",
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Перейти до головного змісту.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -29,11 +29,5 @@
"header.menu.account.label": "Account", "header.menu.account.label": "Account",
"header.menu.orderHistory.label": "Order History", "header.menu.orderHistory.label": "Order History",
"header.navigation.skipNavLink": "Skip to main content.", "header.navigation.skipNavLink": "Skip to main content.",
"header.menu.signOut.label": "Sign Out", "header.menu.signOut.label": "Sign Out"
"notification.title": "Notifications",
"notification.today.heading": "Last 24 hours",
"notification.earlier.heading": "Earlier",
"notification.mark.as.read": "Mark all as read",
"notification.fullStop": "•",
"notification.load.more.notifications": "Load more notifications"
} }

View File

@@ -27,7 +27,7 @@ $white: #fff;
.learning-header { .learning-header {
min-width: 0; min-width: 0;
.course-title-lockup { .course-title-lockup {
min-width: 0; min-width: 0;

View File

@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faUserCircle } from '@fortawesome/free-solid-svg-icons'; import { faUserCircle } from '@fortawesome/free-solid-svg-icons';
import { getConfig } from '@edx/frontend-platform'; import { getConfig } from '@edx/frontend-platform';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { Dropdown } from '@edx/paragon'; import { Dropdown } from '@edx/paragon';
@@ -18,8 +19,8 @@ const AuthenticatedUserDropdown = ({ intl, username }) => {
return ( return (
<> <>
<a className="text-gray-700" href={`${getConfig().SUPPORT_URL}`}>{intl.formatMessage(messages.help)}</a> <a className="text-gray-700 mr-3" href={`${getConfig().SUPPORT_URL}`}>{intl.formatMessage(messages.help)}</a>
<Dropdown className="user-dropdown ml-3"> <Dropdown className="user-dropdown">
<Dropdown.Toggle variant="outline-primary"> <Dropdown.Toggle variant="outline-primary">
<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">

View File

@@ -49,12 +49,12 @@ const LearningHeader = ({
<span className="d-block m-0 font-weight-bold course-title">{courseTitle}</span> <span className="d-block m-0 font-weight-bold course-title">{courseTitle}</span>
</div> </div>
{showUserDropdown && authenticatedUser && ( {showUserDropdown && authenticatedUser && (
<AuthenticatedUserDropdown <AuthenticatedUserDropdown
username={authenticatedUser.username} username={authenticatedUser.username}
/> />
)} )}
{showUserDropdown && !authenticatedUser && ( {showUserDropdown && !authenticatedUser && (
<AnonymousUserMenu /> <AnonymousUserMenu />
)} )}
</div> </div>
</header> </header>

View File

@@ -12,7 +12,7 @@ describe('Header', () => {
it('displays user button', () => { it('displays user button', () => {
render(<Header />); render(<Header />);
expect(screen.getByText(authenticatedUser.username)).toBeInTheDocument(); expect(screen.getByRole('button')).toHaveTextContent(authenticatedUser.username);
}); });
it('displays course data', () => { it('displays course data', () => {

View File

@@ -3,7 +3,7 @@
import Enzyme from 'enzyme'; import Enzyme from 'enzyme';
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; import Adapter from 'enzyme-adapter-react-16';
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 'babel-polyfill';

View File

@@ -1,6 +0,0 @@
const executeThunk = async (thunk, dispatch, getState) => {
await thunk(dispatch, getState);
await new Promise(setImmediate);
};
export default executeThunk;