Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d7ed4bfaf2 | ||
|
|
898e23d4bd | ||
|
|
7c07480f31 | ||
|
|
f956c0ac93 | ||
|
|
d625329324 | ||
|
|
01ccaa6988 | ||
|
|
c0dd43ce4a | ||
|
|
56469df0b5 | ||
|
|
0de4ad621e | ||
|
|
5d50e59672 | ||
|
|
c715f0c4d4 | ||
|
|
a62124ddf2 | ||
|
|
8c222ddb0a | ||
|
|
b4031ce345 | ||
|
|
b787f5ecfe | ||
|
|
f87d47f42d | ||
|
|
818ed5d179 | ||
|
|
07eb5892da | ||
|
|
3b8b18051f | ||
|
|
1c719d63cb | ||
|
|
dc7d2fadff | ||
|
|
b710800b2a | ||
|
|
74ff35ae9a | ||
|
|
e6835f9c56 | ||
|
|
a0c19faa92 | ||
|
|
fa37ebb828 | ||
|
|
a24972b64f | ||
|
|
abb22a82ba | ||
|
|
1df0b94a8c | ||
|
|
d563e2f444 | ||
|
|
92a210f81d | ||
|
|
1b92a3c505 | ||
|
|
f88d47275b | ||
|
|
26f3900602 | ||
|
|
a9db712240 | ||
|
|
739cce6c50 | ||
|
|
3a19e219bb | ||
|
|
12511689e8 | ||
|
|
f084393cc9 | ||
|
|
4035ff122c | ||
|
|
159b5a842e | ||
|
|
b06c8b5d01 | ||
|
|
c79da49208 | ||
|
|
82b3310a8f | ||
|
|
fcd641259b | ||
|
|
509276df12 | ||
|
|
4527baef5a | ||
|
|
8183143ae5 | ||
|
|
91311f25da | ||
|
|
ccef5de855 | ||
|
|
01fa97055f | ||
|
|
3cff0970a3 | ||
|
|
f2c879999d | ||
|
|
3f18cf7c9d | ||
|
|
30796204b8 | ||
|
|
d206ecf3ad | ||
|
|
f3094e1725 | ||
|
|
5bbd266834 | ||
|
|
37eed0578f | ||
|
|
acbe489a7c | ||
|
|
2cfbb40265 | ||
|
|
3e1264b710 | ||
|
|
bf60da6554 | ||
|
|
cf879e53be | ||
|
|
e0a634900d | ||
|
|
15ae025990 | ||
|
|
efd85745fd | ||
|
|
fc5df4af36 | ||
|
|
f657c719ec | ||
|
|
6c346c18f9 | ||
|
|
2b9c5affbc | ||
|
|
4a13120d24 | ||
|
|
8e0587f871 | ||
|
|
7cc2f74562 | ||
|
|
3b13fc29b4 | ||
|
|
3f12c52221 | ||
|
|
826d071566 | ||
|
|
b66ae651b6 | ||
|
|
d23a4e2443 | ||
|
|
898b90eb07 | ||
|
|
dbb806d0a3 | ||
|
|
702bce8587 | ||
|
|
0bd6c9d452 | ||
|
|
3d4d356665 | ||
|
|
e656865502 | ||
|
|
2b4283ac5f | ||
|
|
fb06f7d9f9 |
@@ -1,3 +1,4 @@
|
||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const { createConfig } = require('@edx/frontend-build');
|
||||
|
||||
module.exports = createConfig('eslint');
|
||||
|
||||
@@ -16,4 +16,4 @@ jobs:
|
||||
secrets:
|
||||
GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
|
||||
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
|
||||
|
||||
20
.github/workflows/add-remove-label-on-comment.yml
vendored
Normal file
20
.github/workflows/add-remove-label-on-comment.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# This workflow runs when a comment is made on the ticket
|
||||
# If the comment starts with "label: " it tries to apply
|
||||
# the label indicated in rest of comment.
|
||||
# If the comment starts with "remove label: ", it tries
|
||||
# to remove the indicated label.
|
||||
# Note: Labels are allowed to have spaces and this script does
|
||||
# not parse spaces (as often a space is legitimate), so the command
|
||||
# "label: really long lots of words label" will apply the
|
||||
# label "really long lots of words label"
|
||||
|
||||
name: Allows for the adding and removing of labels via comment
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
add_remove_labels:
|
||||
uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master
|
||||
|
||||
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
@@ -1,26 +1,25 @@
|
||||
name: Default CI
|
||||
on:
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node: [12, 14, 16]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
- name: Setup Nodejs
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Validate package-lock.json changes
|
||||
@@ -29,7 +28,9 @@ jobs:
|
||||
run: npm run lint
|
||||
- name: Test
|
||||
run: npm run test
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: i18n_extract
|
||||
run: npm run i18n_extract
|
||||
- name: Coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
2
.github/workflows/commitlint.yml
vendored
2
.github/workflows/commitlint.yml
vendored
@@ -7,4 +7,4 @@ on:
|
||||
|
||||
jobs:
|
||||
commitlint:
|
||||
uses: edx/.github/.github/workflows/commitlint.yml@master
|
||||
uses: openedx/.github/.github/workflows/commitlint.yml@master
|
||||
|
||||
13
.github/workflows/lockfileversion-check.yml
vendored
Normal file
13
.github/workflows/lockfileversion-check.yml
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
#check package-lock file version
|
||||
|
||||
name: Lockfile Version check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
version-check:
|
||||
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
|
||||
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
@@ -2,36 +2,38 @@ name: Release CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- master
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Validate package-lock.json changes
|
||||
run: make validate-no-uncommitted-package-lock-changes
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Test
|
||||
run: npm run test
|
||||
- name: i18n_extract
|
||||
run: npm run i18n_extract
|
||||
- name: Coverage
|
||||
uses: codecov/codecov-action@v2
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
||||
run: npx semantic-release
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup Nodejs Env
|
||||
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VER }}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Validate package-lock.json changes
|
||||
run: make validate-no-uncommitted-package-lock-changes
|
||||
- name: Lint
|
||||
run: npm run lint
|
||||
- name: Test
|
||||
run: npm run test
|
||||
- name: i18n_extract
|
||||
run: npm run i18n_extract
|
||||
- name: Coverage
|
||||
uses: codecov/codecov-action@v3
|
||||
- name: Build
|
||||
run: npm run build
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
|
||||
run: npx semantic-release
|
||||
|
||||
12
.github/workflows/self-assign-issue.yml
vendored
Normal file
12
.github/workflows/self-assign-issue.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# This workflow runs when a comment is made on the ticket
|
||||
# If the comment starts with "assign me" it assigns the author to the
|
||||
# ticket (case insensitive)
|
||||
|
||||
name: Assign comment author to ticket if they say "assign me"
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
self_assign_by_comment:
|
||||
uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
|
||||
14
Makefile
Executable file → Normal file
14
Makefile
Executable file → Normal file
@@ -1,11 +1,9 @@
|
||||
transifex_resource = frontend-component-footer
|
||||
transifex_langs = "ar,fr,es_419,zh_CN"
|
||||
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
|
||||
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 .
|
||||
transifex_temp = ./temp/babel-plugin-react-intl
|
||||
@@ -42,15 +40,15 @@ push_translations:
|
||||
# Pushing strings to Transifex...
|
||||
tx push -s
|
||||
# Fetching hashes from Transifex...
|
||||
./node_modules/reactifex/bash_scripts/get_hashed_strings.sh $(tx_url1)
|
||||
./node_modules/@edx/reactifex/bash_scripts/get_hashed_strings_v3.sh
|
||||
# Writing out comments to file...
|
||||
$(transifex_utils) $(transifex_temp) --comments
|
||||
$(transifex_utils) $(transifex_temp) --comments --v3-scripts-path
|
||||
# Pushing comments to Transifex...
|
||||
./node_modules/reactifex/bash_scripts/put_comments.sh $(tx_url2)
|
||||
./node_modules/@edx/reactifex/bash_scripts/put_comments_v3.sh
|
||||
|
||||
# Pulls translations from Transifex.
|
||||
pull_translations:
|
||||
tx pull -f --mode reviewed --languages=$(transifex_langs)
|
||||
tx pull -t -f --mode reviewed --languages=$(transifex_langs)
|
||||
|
||||
# This target is used by Travis.
|
||||
validate-no-uncommitted-package-lock-changes:
|
||||
|
||||
@@ -14,7 +14,7 @@ A generic footer for Open edX micro-frontend applications. It includes a logo a
|
||||
Requirements
|
||||
************
|
||||
|
||||
This component uses ``@edx/frontend-platform`` services such as i18n, analytics, configuration, and the ``AppContext`` React component, and expects that it has been loaded into a micro-frontend that has been properly initialized via ``@edx/frontend-platform``'s ``initialize`` function. `Please visit the frontend template application to see an example. <https://github.com/edx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx>`_
|
||||
This component uses ``@edx/frontend-platform`` services such as i18n, analytics, configuration, and the ``AppContext`` React component, and expects that it has been loaded into a micro-frontend that has been properly initialized via ``@edx/frontend-platform``'s ``initialize`` function. `Please visit the frontend template application to see an example. <https://github.com/openedx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx>`_
|
||||
|
||||
Environment Variables
|
||||
=====================
|
||||
@@ -68,8 +68,8 @@ Component Usage Example::
|
||||
]}
|
||||
/>
|
||||
|
||||
* `An example of minimal component and messages usage. <https://github.com/edx/frontend-template-application/blob/3355bb3a96232390e9056f35b06ffa8f105ed7ca/src/index.jsx#L23>`_
|
||||
* `An example of SCSS file usage. <https://github.com/edx/frontend-template-application/blob/3cd5485bf387b8c479baf6b02bf59e3061dc3465/src/index.scss#L9>`_
|
||||
* `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
|
||||
|
||||
38910
package-lock.json
generated
38910
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -24,44 +24,44 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/edx/frontend-component-footer.git"
|
||||
"url": "git+https://github.com/openedx/frontend-component-footer.git"
|
||||
},
|
||||
"author": "edX",
|
||||
"license": "AGPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/edx/frontend-component-footer/issues"
|
||||
"url": "https://github.com/openedx/frontend-component-footer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/edx/frontend-component-footer#readme",
|
||||
"homepage": "https://github.com/openedx/frontend-component-footer#readme",
|
||||
"devDependencies": {
|
||||
"@edx/brand": "npm:@edx/brand-openedx@1.1.0",
|
||||
"@edx/frontend-build": "9.1.4",
|
||||
"@edx/frontend-platform": "^1.15.1",
|
||||
"@edx/paragon": "^19.6.0",
|
||||
"codecov": "3.8.3",
|
||||
"@edx/brand": "npm:@edx/brand-openedx@1.2.0",
|
||||
"@edx/browserslist-config": "^1.1.1",
|
||||
"@edx/frontend-build": "12.8.10",
|
||||
"@edx/frontend-platform": "4.2.0",
|
||||
"@edx/paragon": "^20.19.0",
|
||||
"@edx/reactifex": "^2.1.1",
|
||||
"enzyme": "3.11.0",
|
||||
"enzyme-adapter-react-16": "1.15.6",
|
||||
"husky": "7.0.4",
|
||||
"prop-types": "15.7.2",
|
||||
"enzyme-adapter-react-16": "1.15.7",
|
||||
"husky": "8.0.3",
|
||||
"prop-types": "15.8.1",
|
||||
"react": "16.14.0",
|
||||
"react-dom": "16.14.0",
|
||||
"react-redux": "7.2.8",
|
||||
"react-router-dom": "5.3.0",
|
||||
"react-redux": "7.2.9",
|
||||
"react-router-dom": "5.3.4",
|
||||
"react-test-renderer": "16.14.0",
|
||||
"reactifex": "1.1.1",
|
||||
"redux": "4.1.2",
|
||||
"semantic-release": "^17.0.0"
|
||||
"redux": "4.2.1",
|
||||
"semantic-release": "21.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@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.18"
|
||||
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
||||
"@fortawesome/free-brands-svg-icons": "6.4.0",
|
||||
"@fortawesome/free-regular-svg-icons": "6.4.0",
|
||||
"@fortawesome/free-solid-svg-icons": "6.4.0",
|
||||
"@fortawesome/react-fontawesome": "0.2.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@edx/frontend-platform": "^1.8.0",
|
||||
"@edx/frontend-platform": "^4.0.0",
|
||||
"prop-types": "^15.5.10",
|
||||
"react": "^16.9.0",
|
||||
"react-dom": "^16.9.0"
|
||||
"react": "^16.9.0 || ^17.0.0",
|
||||
"react-dom": "^16.9.0 || ^17.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,11 @@
|
||||
"pin"
|
||||
],
|
||||
"automerge": true
|
||||
},
|
||||
{
|
||||
"matchPackagePatterns": ["@edx"],
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"automerge": true
|
||||
}
|
||||
],
|
||||
"timezone": "America/New_York"
|
||||
|
||||
@@ -23,14 +23,6 @@ class SiteFooter extends React.Component {
|
||||
this.externalLinkClickHandler = this.externalLinkClickHandler.bind(this);
|
||||
}
|
||||
|
||||
getLocalePrefix(locale) {
|
||||
const twoLetterPrefix = locale.substring(0, 2).toLowerCase();
|
||||
if (twoLetterPrefix === 'en') {
|
||||
return '';
|
||||
}
|
||||
return `/${twoLetterPrefix}`;
|
||||
}
|
||||
|
||||
externalLinkClickHandler(event) {
|
||||
const label = event.currentTarget.getAttribute('href');
|
||||
const eventName = EVENT_NAMES.FOOTER_LINK;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
/* eslint-disable react/prop-types */
|
||||
import React, { useMemo } from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { mount } from 'enzyme';
|
||||
import { IntlProvider } from '@edx/frontend-platform/i18n';
|
||||
@@ -6,71 +7,69 @@ import { AppContext } from '@edx/frontend-platform/react';
|
||||
|
||||
import Footer from './Footer';
|
||||
|
||||
const FooterWithContext = ({ locale = 'es' }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}), []);
|
||||
|
||||
return (
|
||||
<IntlProvider locale={locale}>
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<Footer />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
const FooterWithLanguageSelector = ({ languageSelected = () => {} }) => {
|
||||
const contextValue = useMemo(() => ({
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}), []);
|
||||
|
||||
return (
|
||||
<IntlProvider locale="en">
|
||||
<AppContext.Provider
|
||||
value={contextValue}
|
||||
>
|
||||
<Footer
|
||||
onLanguageSelected={languageSelected}
|
||||
supportedLanguages={[
|
||||
{ label: 'English', value: 'en' },
|
||||
{ label: 'Español', value: 'es' },
|
||||
]}
|
||||
/>
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
};
|
||||
|
||||
describe('<Footer />', () => {
|
||||
describe('renders correctly', () => {
|
||||
it('renders without a language selector', () => {
|
||||
const tree = renderer
|
||||
.create((
|
||||
<IntlProvider locale="en">
|
||||
<AppContext.Provider
|
||||
value={{
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Footer />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
))
|
||||
.create(<FooterWithContext locale="en" />)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('renders without a language selector in es', () => {
|
||||
const tree = renderer
|
||||
.create((
|
||||
<IntlProvider locale="es">
|
||||
<AppContext.Provider
|
||||
value={{
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Footer />
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
))
|
||||
.create(<FooterWithContext locale="es" />)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
it('renders with a language selector', () => {
|
||||
const tree = renderer
|
||||
.create((
|
||||
<IntlProvider locale="en">
|
||||
<AppContext.Provider
|
||||
value={{
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Footer
|
||||
onLanguageSelected={() => {}}
|
||||
supportedLanguages={[
|
||||
{ label: 'English', value: 'en' },
|
||||
{ label: 'Español', value: 'es' },
|
||||
]}
|
||||
/>
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
))
|
||||
.create(<FooterWithLanguageSelector />)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
@@ -79,27 +78,7 @@ describe('<Footer />', () => {
|
||||
describe('handles language switching', () => {
|
||||
it('calls onLanguageSelected prop when a language is changed', () => {
|
||||
const mockHandleLanguageSelected = jest.fn();
|
||||
const wrapper = mount((
|
||||
<IntlProvider locale="en">
|
||||
<AppContext.Provider
|
||||
value={{
|
||||
authenticatedUser: null,
|
||||
config: {
|
||||
LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,
|
||||
LMS_BASE_URL: process.env.LMS_BASE_URL,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<Footer
|
||||
onLanguageSelected={mockHandleLanguageSelected}
|
||||
supportedLanguages={[
|
||||
{ label: 'English', value: 'en' },
|
||||
{ label: 'Español', value: 'es' },
|
||||
]}
|
||||
/>
|
||||
</AppContext.Provider>
|
||||
</IntlProvider>
|
||||
));
|
||||
const wrapper = mount(<FooterWithLanguageSelector languageSelected={mockHandleLanguageSelected} />);
|
||||
|
||||
wrapper.find('form').simulate('submit', {
|
||||
target: {
|
||||
|
||||
@@ -37,9 +37,7 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
|
||||
className="d-inline-block m-0"
|
||||
htmlFor="site-footer-language-select"
|
||||
>
|
||||
<span>
|
||||
Choose Language
|
||||
</span>
|
||||
Choose Language
|
||||
</label>
|
||||
<select
|
||||
className="form-control-sm mx-2"
|
||||
@@ -62,9 +60,7 @@ exports[`<Footer /> renders correctly renders with a language selector 1`] = `
|
||||
className="btn btn-outline-primary btn-sm"
|
||||
type="submit"
|
||||
>
|
||||
<span>
|
||||
Apply
|
||||
</span>
|
||||
Apply
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,32 +1,34 @@
|
||||
import arMessages from './messages/ar.json';
|
||||
import caMessages from './messages/ca.json';
|
||||
// no need to import en messages-- they are in the defaultMessage field
|
||||
import es419Messages from './messages/es_419.json';
|
||||
import frMessages from './messages/fr.json';
|
||||
import es419Messages from './messages/es_419.json';
|
||||
import zhcnMessages from './messages/zh_CN.json';
|
||||
import heMessages from './messages/he.json';
|
||||
import idMessages from './messages/id.json';
|
||||
import kokrMessages from './messages/ko_kr.json';
|
||||
import plMessages from './messages/pl.json';
|
||||
import ptbrMessages from './messages/pt_br.json';
|
||||
import ruMessages from './messages/ru.json';
|
||||
import thMessages from './messages/th.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,
|
||||
ca: caMessages,
|
||||
he: heMessages,
|
||||
id: idMessages,
|
||||
'ko-kr': kokrMessages,
|
||||
pl: plMessages,
|
||||
'pt-br': ptbrMessages,
|
||||
pt: ptMessages,
|
||||
it: itMessages,
|
||||
de: deMessages,
|
||||
hi: hiMessages,
|
||||
'fr-ca': frCAMessages,
|
||||
ru: ruMessages,
|
||||
th: thMessages,
|
||||
uk: ukMessages,
|
||||
'de-de': dedeCAMessages,
|
||||
'it-it': ititCAMessages,
|
||||
'pt-pt': ptptCAMessages,
|
||||
};
|
||||
|
||||
export default messages;
|
||||
|
||||
@@ -1,32 +1 @@
|
||||
{
|
||||
"footer.socialLinks.srText.facebook": "Like edX on Facebook",
|
||||
"footer.socialLinks.srText.twitter": "Follow edX on Twitter",
|
||||
"footer.socialLinks.srText.youtube": "Subscribe to the edX YouTube channel",
|
||||
"footer.socialLinks.srText.linkedin": "Follow edX on LinkedIn",
|
||||
"footer.socialLinks.srText.reddit": "Subscribe to the edX subreddit",
|
||||
"footer.languageForm.select.label": "Choose Language",
|
||||
"footer.languageForm.submit.label": "Apply",
|
||||
"footer.edxLinks.about": "About",
|
||||
"footer.edxLinks.business": "edX for Business",
|
||||
"footer.edxLinks.affiliates": "Affiliates",
|
||||
"footer.edxLinks.openEdx": "Open edX",
|
||||
"footer.edxLinks.careers": "Careers",
|
||||
"footer.edxLinks.news": "News",
|
||||
"footer.legalLinks.heading": "Legal",
|
||||
"footer.legalLinks.termsOfService": "Terms of Service & Honor Code",
|
||||
"footer.legalLinks.privacyPolicy": "Privacy Policy",
|
||||
"footer.legalLinks.a11yPolicy": "Accessibility Policy",
|
||||
"footer.legalLinks.trademarkPolicy": "Trademark Policy",
|
||||
"footer.legalLinks.sitemap": "Sitemap",
|
||||
"footer.connectLinks.heading": "Connect",
|
||||
"footer.connectLinks.blog": "Blog",
|
||||
"footer.connectLinks.contact": "Contact Us",
|
||||
"footer.connectLinks.help": "Help Center",
|
||||
"footer.connectLinks.mediaKit": "Media Kit",
|
||||
"footer.connectLinks.donate": "Donate",
|
||||
"footer.mobileApp.apple": "Download the edX mobile app from the Apple App Store",
|
||||
"footer.mobileApp.google": "Download the edX mobile app from Google Play",
|
||||
"footer.logo.altText": "Powered by Open edX",
|
||||
"footer.logo.ariaLabel": "edX Home",
|
||||
"footer.ariaLabel": "Page Footer"
|
||||
}
|
||||
{}
|
||||
@@ -1,32 +1 @@
|
||||
{
|
||||
"footer.socialLinks.srText.facebook": "Like edX on Facebook",
|
||||
"footer.socialLinks.srText.twitter": "Follow edX on Twitter",
|
||||
"footer.socialLinks.srText.youtube": "Subscribe to the edX YouTube channel",
|
||||
"footer.socialLinks.srText.linkedin": "Follow edX on LinkedIn",
|
||||
"footer.socialLinks.srText.reddit": "Subscribe to the edX subreddit",
|
||||
"footer.languageForm.select.label": "Choose Language",
|
||||
"footer.languageForm.submit.label": "Apply",
|
||||
"footer.edxLinks.about": "About",
|
||||
"footer.edxLinks.business": "edX for Business",
|
||||
"footer.edxLinks.affiliates": "Affiliates",
|
||||
"footer.edxLinks.openEdx": "Open edX",
|
||||
"footer.edxLinks.careers": "Careers",
|
||||
"footer.edxLinks.news": "News",
|
||||
"footer.legalLinks.heading": "Legal",
|
||||
"footer.legalLinks.termsOfService": "Terms of Service & Honor Code",
|
||||
"footer.legalLinks.privacyPolicy": "Privacy Policy",
|
||||
"footer.legalLinks.a11yPolicy": "Accessibility Policy",
|
||||
"footer.legalLinks.trademarkPolicy": "Trademark Policy",
|
||||
"footer.legalLinks.sitemap": "Sitemap",
|
||||
"footer.connectLinks.heading": "Connect",
|
||||
"footer.connectLinks.blog": "Blog",
|
||||
"footer.connectLinks.contact": "Contact Us",
|
||||
"footer.connectLinks.help": "Help Center",
|
||||
"footer.connectLinks.mediaKit": "Media Kit",
|
||||
"footer.connectLinks.donate": "Donate",
|
||||
"footer.mobileApp.apple": "Download the edX mobile app from the Apple App Store",
|
||||
"footer.mobileApp.google": "Download the edX mobile app from Google Play",
|
||||
"footer.logo.altText": "Powered by Open edX",
|
||||
"footer.logo.ariaLabel": "edX Home",
|
||||
"footer.ariaLabel": "Page Footer"
|
||||
}
|
||||
{}
|
||||
@@ -1,32 +1 @@
|
||||
{
|
||||
"footer.socialLinks.srText.facebook": "Like edX on Facebook",
|
||||
"footer.socialLinks.srText.twitter": "Follow edX on Twitter",
|
||||
"footer.socialLinks.srText.youtube": "Subscribe to the edX YouTube channel",
|
||||
"footer.socialLinks.srText.linkedin": "Follow edX on LinkedIn",
|
||||
"footer.socialLinks.srText.reddit": "Subscribe to the edX subreddit",
|
||||
"footer.languageForm.select.label": "Choose Language",
|
||||
"footer.languageForm.submit.label": "Apply",
|
||||
"footer.edxLinks.about": "About",
|
||||
"footer.edxLinks.business": "edX for Business",
|
||||
"footer.edxLinks.affiliates": "Affiliates",
|
||||
"footer.edxLinks.openEdx": "Open edX",
|
||||
"footer.edxLinks.careers": "Careers",
|
||||
"footer.edxLinks.news": "News",
|
||||
"footer.legalLinks.heading": "Legal",
|
||||
"footer.legalLinks.termsOfService": "Terms of Service & Honor Code",
|
||||
"footer.legalLinks.privacyPolicy": "Privacy Policy",
|
||||
"footer.legalLinks.a11yPolicy": "Accessibility Policy",
|
||||
"footer.legalLinks.trademarkPolicy": "Trademark Policy",
|
||||
"footer.legalLinks.sitemap": "Sitemap",
|
||||
"footer.connectLinks.heading": "Connect",
|
||||
"footer.connectLinks.blog": "Blog",
|
||||
"footer.connectLinks.contact": "Contact Us",
|
||||
"footer.connectLinks.help": "Help Center",
|
||||
"footer.connectLinks.mediaKit": "Media Kit",
|
||||
"footer.connectLinks.donate": "Donate",
|
||||
"footer.mobileApp.apple": "Download the edX mobile app from the Apple App Store",
|
||||
"footer.mobileApp.google": "Download the edX mobile app from Google Play",
|
||||
"footer.logo.altText": "Powered by Open edX",
|
||||
"footer.logo.ariaLabel": "edX Home",
|
||||
"footer.ariaLabel": "Page Footer"
|
||||
}
|
||||
{}
|
||||
1
src/i18n/messages/pt_PT.json
Normal file
1
src/i18n/messages/pt_PT.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -1,32 +1 @@
|
||||
{
|
||||
"footer.socialLinks.srText.facebook": "Like edX on Facebook",
|
||||
"footer.socialLinks.srText.twitter": "Follow edX on Twitter",
|
||||
"footer.socialLinks.srText.youtube": "Subscribe to the edX YouTube channel",
|
||||
"footer.socialLinks.srText.linkedin": "Follow edX on LinkedIn",
|
||||
"footer.socialLinks.srText.reddit": "Subscribe to the edX subreddit",
|
||||
"footer.languageForm.select.label": "Choose Language",
|
||||
"footer.languageForm.submit.label": "Apply",
|
||||
"footer.edxLinks.about": "About",
|
||||
"footer.edxLinks.business": "edX for Business",
|
||||
"footer.edxLinks.affiliates": "Affiliates",
|
||||
"footer.edxLinks.openEdx": "Open edX",
|
||||
"footer.edxLinks.careers": "Careers",
|
||||
"footer.edxLinks.news": "News",
|
||||
"footer.legalLinks.heading": "Legal",
|
||||
"footer.legalLinks.termsOfService": "Terms of Service & Honor Code",
|
||||
"footer.legalLinks.privacyPolicy": "Privacy Policy",
|
||||
"footer.legalLinks.a11yPolicy": "Accessibility Policy",
|
||||
"footer.legalLinks.trademarkPolicy": "Trademark Policy",
|
||||
"footer.legalLinks.sitemap": "Sitemap",
|
||||
"footer.connectLinks.heading": "Connect",
|
||||
"footer.connectLinks.blog": "Blog",
|
||||
"footer.connectLinks.contact": "Contact Us",
|
||||
"footer.connectLinks.help": "Help Center",
|
||||
"footer.connectLinks.mediaKit": "Media Kit",
|
||||
"footer.connectLinks.donate": "Donate",
|
||||
"footer.mobileApp.apple": "Download the edX mobile app from the Apple App Store",
|
||||
"footer.mobileApp.google": "Download the edX mobile app from Google Play",
|
||||
"footer.logo.altText": "Powered by Open edX",
|
||||
"footer.logo.ariaLabel": "edX Home",
|
||||
"footer.ariaLabel": "Page Footer"
|
||||
}
|
||||
{}
|
||||
Reference in New Issue
Block a user