Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5b34595520 | ||
|
|
32ae2d8e7c | ||
|
|
abac1cd6d4 | ||
|
|
e0115e3d88 | ||
|
|
ff18f3add9 | ||
|
|
4926c3105b | ||
|
|
838a81a020 | ||
|
|
0ac6840cea | ||
|
|
26a17bf2e4 | ||
|
|
17b9710810 | ||
|
|
df0129485e | ||
|
|
1c2f290faa | ||
|
|
9af9024bcc | ||
|
|
0008bd485a | ||
|
|
181b9916a0 | ||
|
|
22dbec317c | ||
|
|
6f15e4dafa | ||
|
|
9f5aed3c76 | ||
|
|
54bc04b182 | ||
|
|
ea2578fa15 | ||
|
|
5f7fab236d | ||
|
|
adf5f6c9a8 | ||
|
|
132b080195 | ||
|
|
0d4ea96874 | ||
|
|
8b9f5fa348 | ||
|
|
c014e30ca8 | ||
|
|
0e6ab3c358 | ||
|
|
7d0a126580 | ||
|
|
c422ce40be | ||
|
|
7299d5367f | ||
|
|
38203b91ba | ||
|
|
83c340fe08 | ||
|
|
9eaebf4b11 | ||
|
|
2a883857cf | ||
|
|
5f26c1ae93 | ||
|
|
89ad7234ac | ||
|
|
936915f81f | ||
|
|
b993992987 | ||
|
|
64fc8adeed | ||
|
|
a49b06349e | ||
|
|
aa13b4946c | ||
|
|
cff78e021c | ||
|
|
62bf038a06 |
@@ -12,7 +12,7 @@ TERMS_OF_SERVICE_URL=null
|
||||
PRIVACY_POLICY_URL=null
|
||||
SUPPORT_EMAIL=null
|
||||
STUDIO_BASE_URL=http://localhost:18010
|
||||
SHOW_ACCESSIBILITY_PAGE=false
|
||||
ENABLE_ACCESSIBILITY_PAGE=false
|
||||
ORDER_HISTORY_URL=localhost:1996/orders
|
||||
REFRESH_ACCESS_TOKEN_ENDPOINT=http://localhost:18000/login_refresh
|
||||
SEGMENT_KEY=null
|
||||
|
||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -33,4 +33,7 @@ jobs:
|
||||
- name: i18n_extract
|
||||
run: npm run i18n_extract
|
||||
- name: Coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
||||
|
||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -3,6 +3,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- alpha
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
@@ -29,7 +30,10 @@ jobs:
|
||||
- name: i18n_extract
|
||||
run: npm run i18n_extract
|
||||
- name: Coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: false
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Release
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ src/i18n/transifex_input.json
|
||||
temp/babel-plugin-react-intl
|
||||
/.vscode
|
||||
module.config.js
|
||||
src/i18n/messages
|
||||
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"branch": "master",
|
||||
"branches": [
|
||||
"master",
|
||||
{name: "alpha", prerelease: true}
|
||||
],
|
||||
"tagFormat": "v${version}",
|
||||
"verifyConditions": [
|
||||
"@semantic-release/npm",
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:open-edx:p:edx-platform:r:frontend-component-footer]
|
||||
file_filter = src/i18n/messages/<lang>.json
|
||||
source_file = src/i18n/transifex_input.json
|
||||
source_lang = en
|
||||
type = KEYVALUEJSON
|
||||
|
||||
17
Makefile
17
Makefile
@@ -1,6 +1,3 @@
|
||||
export TRANSIFEX_RESOURCE = frontend-component-footer
|
||||
transifex_langs = "ar,fr,es_419,zh_CN,pt,it,de,uk,ru,hi,fr_CA,it_IT,pt_PT,de_DE"
|
||||
|
||||
transifex_utils = ./node_modules/.bin/transifex-utils.js
|
||||
i18n = ./src/i18n
|
||||
transifex_input = $(i18n)/transifex_input.json
|
||||
@@ -35,20 +32,6 @@ detect_changed_source_translations:
|
||||
# Checking for changed translations...
|
||||
git diff --exit-code $(i18n)
|
||||
|
||||
# Pushes translations to Transifex. You must run make extract_translations first.
|
||||
push_translations:
|
||||
# Pushing strings to Transifex...
|
||||
tx push -s
|
||||
# Fetching hashes from Transifex...
|
||||
./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh
|
||||
# Writing out comments to file...
|
||||
$(transifex_utils) $(transifex_temp) --comments --v3-scripts-path
|
||||
# Pushing comments to Transifex...
|
||||
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh
|
||||
|
||||
# Pulls translations from Transifex.
|
||||
pull_translations:
|
||||
tx pull -t -f --mode reviewed --languages=$(transifex_langs)
|
||||
|
||||
# This target is used by Travis.
|
||||
validate-no-uncommitted-package-lock-changes:
|
||||
|
||||
@@ -93,6 +93,12 @@ This library has the following exports:
|
||||
language from its dropdown.
|
||||
* supportedLanguages: An array of objects representing available languages. See example below for object shape.
|
||||
|
||||
Plugin
|
||||
======
|
||||
The footer can be replaced using using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
|
||||
|
||||
Information on how to utilize the ``FooterSlot`` component to do so is available in the `frontend-slot-footer repository <https://github.com/openedx/frontend-slot-footer/>`_.
|
||||
|
||||
Examples
|
||||
========
|
||||
|
||||
@@ -113,6 +119,8 @@ Component Usage Example::
|
||||
* `An example of minimal component and messages usage. <https://github.com/openedx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L23>`_
|
||||
* `An example of SCSS file usage. <https://github.com/openedx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L9>`_
|
||||
|
||||
|
||||
|
||||
Development
|
||||
===========
|
||||
|
||||
|
||||
18441
package-lock.json
generated
18441
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
@@ -13,7 +13,7 @@
|
||||
"snapshot": "fedx-scripts jest --updateSnapshot",
|
||||
"start": "fedx-scripts webpack-dev-server --progress",
|
||||
"start:with-theme": "paragon install-theme && npm start && npm install",
|
||||
"test": "fedx-scripts jest"
|
||||
"test": "fedx-scripts jest --coverage"
|
||||
},
|
||||
"files": [
|
||||
"/dist"
|
||||
@@ -36,10 +36,11 @@
|
||||
"devDependencies": {
|
||||
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
|
||||
"@edx/browserslist-config": "^1.1.1",
|
||||
"@openedx/frontend-build": "^13.0.19",
|
||||
"@openedx/paragon": "22.0.0",
|
||||
"@edx/frontend-platform": "6.2.0",
|
||||
"@edx/frontend-platform": "8.1.0",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"@openedx/frontend-build": "14.0.10",
|
||||
"@openedx/frontend-plugin-framework": "^1.1.2",
|
||||
"@openedx/paragon": "22.6.1",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^12.1.1",
|
||||
"husky": "8.0.3",
|
||||
@@ -47,21 +48,23 @@
|
||||
"react": "17.0.2",
|
||||
"react-dom": "17.0.2",
|
||||
"react-redux": "7.2.9",
|
||||
"react-router-dom": "6.21.2",
|
||||
"react-router-dom": "6.24.1",
|
||||
"react-test-renderer": "17.0.2",
|
||||
"redux": "4.2.1",
|
||||
"semantic-release": "21.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fortawesome/fontawesome-svg-core": "6.5.1",
|
||||
"@fortawesome/free-brands-svg-icons": "6.5.1",
|
||||
"@fortawesome/free-regular-svg-icons": "6.5.1",
|
||||
"@fortawesome/free-solid-svg-icons": "6.5.1",
|
||||
"@fortawesome/react-fontawesome": "0.2.0",
|
||||
"lodash": "^4.17.21"
|
||||
"@fortawesome/fontawesome-svg-core": "6.5.2",
|
||||
"@fortawesome/free-brands-svg-icons": "6.5.2",
|
||||
"@fortawesome/free-regular-svg-icons": "6.5.2",
|
||||
"@fortawesome/free-solid-svg-icons": "6.5.2",
|
||||
"@fortawesome/react-fontawesome": "0.2.2",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-jest": "^29.1.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@edx/frontend-platform": "^7.0.0",
|
||||
"@edx/frontend-platform": "^7.0.0 || ^8.0.0",
|
||||
"@openedx/paragon": ">= 21.11.3 < 23.0.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "^16.9.0 || ^17.0.0",
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
|
||||
import { sendTrackEvent } from '@edx/frontend-platform/analytics';
|
||||
import { ensureConfig } from '@edx/frontend-platform/config';
|
||||
import { ensureConfig } from '@edx/frontend-platform';
|
||||
import { AppContext } from '@edx/frontend-platform/react';
|
||||
|
||||
import messages from './Footer.messages';
|
||||
|
||||
@@ -17,7 +17,7 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
|
||||
alt="Powered by Open edX"
|
||||
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"maxHeight": 45,
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ exports[`<Footer /> renders correctly renders without a language selector 1`] =
|
||||
alt="Powered by Open edX"
|
||||
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"maxHeight": 45,
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ exports[`<Footer /> renders correctly renders without a language selector in es
|
||||
alt="Powered by Open edX"
|
||||
src="https://edx-cdn.org/v3/default/logo-trademark.svg"
|
||||
style={
|
||||
Object {
|
||||
{
|
||||
"maxHeight": 45,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ ensureConfig([
|
||||
'SUPPORT_EMAIL',
|
||||
'SITE_NAME',
|
||||
'STUDIO_BASE_URL',
|
||||
'SHOW_ACCESSIBILITY_PAGE',
|
||||
'ENABLE_ACCESSIBILITY_PAGE',
|
||||
], 'Studio Footer component');
|
||||
|
||||
const StudioFooter = ({
|
||||
@@ -105,7 +105,7 @@ const StudioFooter = ({
|
||||
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
|
||||
</Hyperlink>
|
||||
)}
|
||||
{config.SHOW_ACCESSIBILITY_PAGE === 'true' && (
|
||||
{config.ENABLE_ACCESSIBILITY_PAGE === 'true' && (
|
||||
<Hyperlink
|
||||
destination={`${config.STUDIO_BASE_URL}/accessibility`}
|
||||
data-testid="accessibilityRequest"
|
||||
|
||||
@@ -15,7 +15,7 @@ const config = {
|
||||
SUPPORT_EMAIL: process.env.SUPPORT_EMAIL,
|
||||
SITE_NAME: process.env.SITE_NAME,
|
||||
STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,
|
||||
SHOW_ACCESSIBILITY_PAGE: process.env.SHOW_ACCESSIBILITY_PAGE,
|
||||
ENABLE_ACCESSIBILITY_PAGE: process.env.ENABLE_ACCESSIBILITY_PAGE,
|
||||
};
|
||||
|
||||
let currentConfig = config;
|
||||
@@ -111,7 +111,7 @@ describe('Footer', () => {
|
||||
expect(screen.queryByTestId('accessibilityRequest')).toBeNull();
|
||||
});
|
||||
it('should show accessibilty request link', () => {
|
||||
render(<Component updateVariable={['SHOW_ACCESSIBILITY_PAGE', 'true']} />);
|
||||
render(<Component updateVariable={['ENABLE_ACCESSIBILITY_PAGE', 'true']} />);
|
||||
expect(screen.getByText('LMS')).toBeVisible();
|
||||
expect(screen.queryByTestId('termsOfService')).toBeNull();
|
||||
expect(screen.queryByTestId('privacyPolicy')).toBeNull();
|
||||
|
||||
@@ -1,34 +1 @@
|
||||
import arMessages from './messages/ar.json';
|
||||
import frMessages from './messages/fr.json';
|
||||
import es419Messages from './messages/es_419.json';
|
||||
import zhcnMessages from './messages/zh_CN.json';
|
||||
import ptMessages from './messages/pt.json';
|
||||
import itMessages from './messages/it.json';
|
||||
import ukMessages from './messages/uk.json';
|
||||
import deMessages from './messages/de.json';
|
||||
import ruMessages from './messages/ru.json';
|
||||
import hiMessages from './messages/hi.json';
|
||||
import frCAMessages from './messages/fr_CA.json';
|
||||
import dedeCAMessages from './messages/de_DE.json';
|
||||
import ititCAMessages from './messages/it_IT.json';
|
||||
import ptptCAMessages from './messages/pt_PT.json';
|
||||
// no need to import en messages-- they are in the defaultMessage field
|
||||
|
||||
const messages = {
|
||||
ar: arMessages,
|
||||
'es-419': es419Messages,
|
||||
fr: frMessages,
|
||||
'zh-cn': zhcnMessages,
|
||||
pt: ptMessages,
|
||||
it: itMessages,
|
||||
de: deMessages,
|
||||
hi: hiMessages,
|
||||
'fr-ca': frCAMessages,
|
||||
ru: ruMessages,
|
||||
uk: ukMessages,
|
||||
'de-de': dedeCAMessages,
|
||||
'it-it': ititCAMessages,
|
||||
'pt-pt': ptptCAMessages,
|
||||
};
|
||||
|
||||
export default messages;
|
||||
export default {};
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -3,4 +3,6 @@ import messages from './i18n/index';
|
||||
import StudioFooter from './components/studio-footer';
|
||||
|
||||
export default Footer;
|
||||
export { messages, EVENT_NAMES, StudioFooter };
|
||||
export {
|
||||
messages, EVENT_NAMES, StudioFooter,
|
||||
};
|
||||
|
||||
@@ -19,3 +19,4 @@ process.env.LOGO_URL = 'https://edx-cdn.org/v3/default/logo.svg';
|
||||
process.env.LOGO_TRADEMARK_URL = 'https://edx-cdn.org/v3/default/logo-trademark.svg';
|
||||
process.env.LOGO_WHITE_URL = 'https://edx-cdn.org/v3/default/logo-white.svg';
|
||||
process.env.FAVICON_URL = 'https://edx-cdn.org/v3/default/favicon.ico';
|
||||
process.env.ENABLE_ACCESSIBILITY_PAGE = 'false';
|
||||
|
||||
Reference in New Issue
Block a user