Compare commits
4 Commits
refactor--
...
open-relea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ffe9bacb5 | ||
|
|
7424b60a90 | ||
|
|
1c0e6fd4b5 | ||
|
|
bc3faa4105 |
1
.env
1
.env
@@ -28,3 +28,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
|||||||
ENABLE_TEAM_TYPE_SETTING=false
|
ENABLE_TEAM_TYPE_SETTING=false
|
||||||
ENABLE_NEW_EDITOR_PAGES=true
|
ENABLE_NEW_EDITOR_PAGES=true
|
||||||
BBB_LEARN_MORE_URL=''
|
BBB_LEARN_MORE_URL=''
|
||||||
|
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false
|
||||||
|
|||||||
@@ -30,3 +30,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
|||||||
ENABLE_TEAM_TYPE_SETTING=false
|
ENABLE_TEAM_TYPE_SETTING=false
|
||||||
ENABLE_NEW_EDITOR_PAGES=true
|
ENABLE_NEW_EDITOR_PAGES=true
|
||||||
BBB_LEARN_MORE_URL=''
|
BBB_LEARN_MORE_URL=''
|
||||||
|
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=false
|
||||||
|
|||||||
@@ -29,3 +29,4 @@ ENABLE_PROGRESS_GRAPH_SETTINGS=false
|
|||||||
ENABLE_TEAM_TYPE_SETTING=false
|
ENABLE_TEAM_TYPE_SETTING=false
|
||||||
ENABLE_NEW_EDITOR_PAGES=true
|
ENABLE_NEW_EDITOR_PAGES=true
|
||||||
BBB_LEARN_MORE_URL=''
|
BBB_LEARN_MORE_URL=''
|
||||||
|
ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN=true
|
||||||
|
|||||||
2
.github/workflows/lockfileversion-check.yml
vendored
2
.github/workflows/lockfileversion-check.yml
vendored
@@ -10,4 +10,4 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
version-check:
|
version-check:
|
||||||
uses: openedx/.github/.github/workflows/lockfileversion-check.yml@master
|
uses: openedx/.github/.github/workflows/lockfileversion-check-v3.yml@master
|
||||||
|
|||||||
11
.github/workflows/validate.yml
vendored
11
.github/workflows/validate.yml
vendored
@@ -9,14 +9,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node: [16]
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v2
|
- name: Setup Nodejs Env
|
||||||
|
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ env.NODE_VER }}
|
||||||
- run: make validate.ci
|
- run: make validate.ci
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
|
|||||||
31311
package-lock.json
generated
31311
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@
|
|||||||
"@edx/frontend-component-footer": "11.1.1",
|
"@edx/frontend-component-footer": "11.1.1",
|
||||||
"@edx/frontend-lib-content-components": "^1.131.0",
|
"@edx/frontend-lib-content-components": "^1.131.0",
|
||||||
"@edx/frontend-platform": "2.5.1",
|
"@edx/frontend-platform": "2.5.1",
|
||||||
"@edx/paragon": "^20.28.0",
|
"@edx/paragon": "^20.38.0",
|
||||||
"@fortawesome/fontawesome-svg-core": "1.2.28",
|
"@fortawesome/fontawesome-svg-core": "1.2.28",
|
||||||
"@fortawesome/free-brands-svg-icons": "5.11.2",
|
"@fortawesome/free-brands-svg-icons": "5.11.2",
|
||||||
"@fortawesome/free-regular-svg-icons": "5.11.2",
|
"@fortawesome/free-regular-svg-icons": "5.11.2",
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@edx/browserslist-config": "1.0.0",
|
"@edx/browserslist-config": "1.0.0",
|
||||||
"@edx/frontend-build": "12.3.0",
|
"@edx/frontend-build": "12.8.38",
|
||||||
"@edx/reactifex": "^1.0.3",
|
"@edx/reactifex": "^1.0.3",
|
||||||
"@testing-library/jest-dom": "5.16.4",
|
"@testing-library/jest-dom": "5.16.4",
|
||||||
"@testing-library/react": "12.1.1",
|
"@testing-library/react": "12.1.1",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<title>Course Authoring | <%= process.env.SITE_NAME %></title>
|
<title>Course Authoring | <%= process.env.SITE_NAME %></title>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="shortcut icon" href="<%= process.env.FAVICON_URL %>" type="image/x-icon" />
|
<link rel="shortcut icon" href="<%=htmlWebpackPlugin.options.FAVICON_URL%>" type="image/x-icon" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import messages from './messages';
|
|||||||
|
|
||||||
const ProgressSettings = ({ intl, onClose }) => {
|
const ProgressSettings = ({ intl, onClose }) => {
|
||||||
const [disableProgressGraph, saveSetting] = useAppSetting('disableProgressGraph');
|
const [disableProgressGraph, saveSetting] = useAppSetting('disableProgressGraph');
|
||||||
const showProgressGraphSetting = getConfig().ENABLE_PROGRESS_GRAPH_SETTINGS.toLowerCase() === 'true';
|
const showProgressGraphSetting = getConfig().ENABLE_PROGRESS_GRAPH_SETTINGS.toString().toLowerCase() === 'true';
|
||||||
|
|
||||||
const handleSettingsSave = (values) => {
|
const handleSettingsSave = (values) => {
|
||||||
if (showProgressGraphSetting) { saveSetting(!values.enableProgressGraph); }
|
if (showProgressGraphSetting) { saveSetting(!values.enableProgressGraph); }
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ const Header = ({
|
|||||||
<div className="mb-1 small">
|
<div className="mb-1 small">
|
||||||
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/textbooks/${courseId}`}>{intl.formatMessage(messages['header.links.textbooks'])}</a>
|
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/textbooks/${courseId}`}>{intl.formatMessage(messages['header.links.textbooks'])}</a>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-1 small">
|
{process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN === 'true' && (
|
||||||
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/videos/${courseId}`}>{intl.formatMessage(messages['header.links.videoUploads'])}</a>
|
<div className="mb-1 small">
|
||||||
</div>
|
<a rel="noopener" href={`${config.STUDIO_BASE_URL}/videos/${courseId}`}>{intl.formatMessage(messages['header.links.videoUploads'])}</a>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { AppContext } from '@edx/frontend-platform/react';
|
|||||||
import { Context as ResponsiveContext } from 'react-responsive';
|
import { Context as ResponsiveContext } from 'react-responsive';
|
||||||
import {
|
import {
|
||||||
cleanup,
|
cleanup,
|
||||||
|
fireEvent,
|
||||||
render,
|
render,
|
||||||
screen,
|
screen,
|
||||||
} from '@testing-library/react';
|
} from '@testing-library/react';
|
||||||
@@ -104,6 +105,46 @@ describe('<Header />', () => {
|
|||||||
expect(screen.getByTestId('edx-header-logo'));
|
expect(screen.getByTestId('edx-header-logo'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders Video Uploads link', () => {
|
||||||
|
process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN = 'true';
|
||||||
|
|
||||||
|
const component = createComponent(
|
||||||
|
1280, (
|
||||||
|
<Header
|
||||||
|
courseId="course-v1:edX+DemoX+Demo_Course"
|
||||||
|
courseNumber="DemoX"
|
||||||
|
courseOrg="edX"
|
||||||
|
courseTitle="Demonstration Course"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
render(component);
|
||||||
|
fireEvent.click(screen.getByText('Content'));
|
||||||
|
|
||||||
|
expect(screen.getByText('Video Uploads')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not render Video Uploads link', () => {
|
||||||
|
process.env.ENABLE_VIDEO_UPLOAD_PAGE_LINK_IN_CONTENT_DROPDOWN = 'false';
|
||||||
|
|
||||||
|
const component = createComponent(
|
||||||
|
1280, (
|
||||||
|
<Header
|
||||||
|
courseId="course-v1:edX+DemoX+Demo_Course"
|
||||||
|
courseNumber="DemoX"
|
||||||
|
courseOrg="edX"
|
||||||
|
courseTitle="Demonstration Course"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
render(component);
|
||||||
|
fireEvent.click(screen.getByText('Content'));
|
||||||
|
|
||||||
|
expect(screen.queryByText('Video Uploads')).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
cleanup();
|
cleanup();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user