Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply getPath to PUBLIC_PATH to allow use with CDN #10

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LOGOUT_URL='http://localhost:18000/logout'
LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
LOGO_POWERED_BY_OPEN_EDX_URL_SVG=https://edx-cdn.org/v3/stage/open-edx-tag.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
Expand Down
1 change: 0 additions & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LOGOUT_URL='http://localhost:18000/logout'
LOGO_URL=https://edx-cdn.org/v3/default/logo.svg
LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
LOGO_POWERED_BY_OPEN_EDX_URL_SVG=https://edx-cdn.org/v3/stage/open-edx-tag.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
CSRF_TOKEN_API_PATH='/csrf/api/v1/token'
REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ jobs:
run: npm run build

- name: Run Coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

- name: Send failure notification
if: ${{ failure() }}
Expand Down
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ to the `relevant tutor-mfe documentation`_ to get started using it.

.. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development

Plugins
=======
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.

The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.

Developing
==========

Expand Down
2 changes: 1 addition & 1 deletion catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ metadata:
title: "Stage Site"
icon: "Web"
spec:
owner: ~
owner: "group:openedx-unmaintained"
type: 'website'
lifecycle: 'production'
19,256 changes: 7,849 additions & 11,407 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
},
"dependencies": {
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.2",
"@edx/frontend-component-footer": "13.0.2",
"@edx/frontend-component-header": "5.0.2",
"@edx/frontend-platform": "7.1.0",
"@edx/frontend-component-header": "5.3.0",
"@edx/frontend-platform": "8.0.0",
"@edx/openedx-atlas": "^0.6.0",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-brands-svg-icons": "^5.15.4",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.2.0",
"@openedx/frontend-slot-footer": "^1.0.2",
"@openedx/paragon": "21.11.3",
"@redux-beacon/segment": "^1.1.0",
"@reduxjs/toolkit": "^1.6.1",
Expand Down Expand Up @@ -73,16 +73,17 @@
},
"devDependencies": {
"@edx/browserslist-config": "^1.2.0",
"@edx/react-unit-test-utils": "2.0.0",
"@edx/react-unit-test-utils": "3.0.0",
"@edx/reactifex": "^2.1.1",
"@openedx/frontend-build": "13.0.28",
"@openedx/frontend-build": "14.0.3",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "12.1.5",
"axios-mock-adapter": "^1.20.0",
"fetch-mock": "^9.11.0",
"husky": "^7.0.0",
"identity-obj-proxy": "^3.0.0",
"jest": "29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-expect-message": "^1.0.2",
"react-dev-utils": "^12.0.1",
"react-test-renderer": "^17.0.2",
Expand Down
4 changes: 2 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { BrowserRouter as Router } from 'react-router-dom';

import Footer from '@edx/frontend-component-footer';
import FooterSlot from '@openedx/frontend-slot-footer';
import { LearningHeader as Header } from '@edx/frontend-component-header';

import { selectors } from 'data/redux';
Expand Down Expand Up @@ -32,7 +32,7 @@ export const App = ({ courseMetadata, isEnabled }) => (
<main data-testid="main">
<ListView />
</main>
<Footer logo={process.env.LOGO_POWERED_BY_OPEN_EDX_URL_SVG} data-testid="footer" />
<FooterSlot />
</div>
</Router>
);
Expand Down
7 changes: 1 addition & 6 deletions src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ jest.mock('data/redux', () => ({
jest.mock('@edx/frontend-component-header', () => ({
LearningHeader: 'Header',
}));
jest.mock('@edx/frontend-component-footer', () => 'Footer');
jest.mock('@edx/frontend-component-footer', () => ({ FooterSlot: 'Footer' }));

jest.mock('containers/DemoWarning', () => 'DemoWarning');
jest.mock('containers/CTA', () => 'CTA');
jest.mock('containers/ListView', () => 'ListView');
jest.mock('components/Head', () => 'Head');

const logo = 'fakeLogo.png';
let el;

describe('App router component', () => {
Expand All @@ -42,7 +41,6 @@ describe('App router component', () => {
});
describe('component', () => {
beforeEach(() => {
process.env.LOGO_POWERED_BY_OPEN_EDX_URL_SVG = logo;
el = shallow(<App {...props} />);
});
describe('Router', () => {
Expand All @@ -51,9 +49,6 @@ describe('App router component', () => {
expect(el.instance.findByTestId('main')[0].children[0].type).toBe('ListView');
});
});
test('Footer logo drawn from env variable', () => {
expect(el.instance.findByTestId('footer')[0].props.logo).toEqual(logo);
});

test('Header to use courseMetadata props', () => {
const {
Expand Down
10 changes: 2 additions & 8 deletions src/__snapshots__/App.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ exports[`App router component snapshot: disabled (show demo warning) 1`] = `
>
<ListView />
</main>
<Footer
data-testid="footer"
logo="https://edx-cdn.org/v3/stage/open-edx-tag.svg"
/>
<FooterSlot />
</div>
</BrowserRouter>
`;
Expand All @@ -43,10 +40,7 @@ exports[`App router component snapshot: enabled 1`] = `
>
<ListView />
</main>
<Footer
data-testid="footer"
logo="https://edx-cdn.org/v3/stage/open-edx-tag.svg"
/>
<FooterSlot />
</div>
</BrowserRouter>
`;
2 changes: 1 addition & 1 deletion src/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports[`app registry subscribe: APP_INIT_ERROR. snapshot: displays an ErrorPag
exports[`app registry subscribe: APP_READY. links App to root element 1`] = `
<AppProvider
store={
Object {
{
"dispatch": [Function],
"getState": [Function],
"replaceReducer": [Function],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Error Banner component snapshot 1`] = `
<Alert
actions={
Array [
[
<Button
onClick={[MockFunction action1.onClick]}
variant="outline-primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`PDF Renderer Component snapshots first page, prev is disabled 1`] = `
<div
className="page-wrapper"
style={
Object {
{
"height": 200,
}
}
Expand Down Expand Up @@ -80,7 +80,7 @@ exports[`PDF Renderer Component snapshots on last page, next is disabled 1`] = `
<div
className="page-wrapper"
style={
Object {
{
"height": 200,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`FileRenderer component snapshot is not loading, with error 1`] = `
<FileCard
file={
Object {
{
"downloadUrl": "file download url",
"name": "filename.txt",
}
Expand All @@ -19,7 +19,7 @@ exports[`FileRenderer component snapshot is not loading, with error 1`] = `
exports[`FileRenderer component snapshot isLoading, no Error 1`] = `
<FileCard
file={
Object {
{
"downloadUrl": "file download url",
"name": "filename.txt",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`Review Crition Container snapshot 1`] = `
description="criterion option point value display"
id="ora-grading.RadioCriterion.optionPoints"
values={
Object {
{
"points": 1,
}
}
Expand Down Expand Up @@ -54,7 +54,7 @@ exports[`Review Crition Container snapshot 1`] = `
description="criterion option point value display"
id="ora-grading.RadioCriterion.optionPoints"
values={
Object {
{
"points": 2,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/ListView/__snapshots__/ListError.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`ListError component component render tests snapshot 1`] = `
<Alert
actions={
Array [
[
<Button
onClick={[MockFunction]}
>
Expand All @@ -30,7 +30,7 @@ exports[`ListError component component render tests snapshot 1`] = `
description="Initialization failure alert message line 2"
id="ora-grading.ListView.loadErrorMessage1"
values={
Object {
{
"backToResponses": <Hyperlink
destination="api/openResponse/test-course-id"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exports[`SelectedBulkAction component snapshots 1`] = `
description="Button text to load selected responses for review/grading"
id="ora-grading.ListView.viewSelectedResponses"
values={
Object {
{
"value": 2,
}
}
Expand Down
Loading
Loading