Fixing linting errors.

This commit is contained in:
David Joy
2020-01-30 18:14:47 -05:00
parent dc2971870f
commit 437f50b261
8 changed files with 38 additions and 19 deletions

View File

@@ -9,11 +9,11 @@ export default function CourseBreadcrumb({ url, label, last }) {
<li className="list-inline-item">
{last ? label : (<a href={url}>{label}</a>)}
</li>
{!last &&
{!last && (
<li className="list-inline-item" role="presentation" aria-label="spacer">
<FontAwesomeIcon icon={faChevronRight} />
</li>
}
)}
</React.Fragment>
);
}

View File

@@ -27,7 +27,7 @@ export default function CourseBreadcrumbs({
<ol className="list-inline">
{links.map(({ id, url, label }, i) => (
<CourseBreadcrumb key={id} url={url} label={label} last={i === links.length - 1} />
))}
))}
</ol>
</nav>
);

View File

@@ -103,9 +103,12 @@ function Sequence({
showCompletion={showCompletion}
/>
{isGated && (
<Suspense fallback={<PageLoading
srMessage={intl.formatMessage(messages['learn.loading.content.lock'])}
/>}
<Suspense
fallback={(
<PageLoading
srMessage={intl.formatMessage(messages['learn.loading.content.lock'])}
/>
)}
>
<ContentLock
courseUsageKey={courseUsageKey}

View File

@@ -1,7 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faFilm, faBook, faPencilAlt, faTasks, faLock } from '@fortawesome/free-solid-svg-icons';
import {
faFilm, faBook, faPencilAlt, faTasks, faLock,
} from '@fortawesome/free-solid-svg-icons';
export default function UnitIcon({ type }) {
let icon = null;

View File

@@ -3,8 +3,7 @@ import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
/* eslint-disable import/prefer-default-export */
const getSequenceXModuleHandlerUrl = (courseUsageKey, sequenceId) =>
`${getConfig().LMS_BASE_URL}/courses/${courseUsageKey}/xblock/${sequenceId}/handler/xmodule_handler`;
const getSequenceXModuleHandlerUrl = (courseUsageKey, sequenceId) => `${getConfig().LMS_BASE_URL}/courses/${courseUsageKey}/xblock/${sequenceId}/handler/xmodule_handler`;
export async function saveSequencePosition(courseUsageKey, sequenceId, position) {

View File

@@ -1,4 +1,5 @@
import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faLock } from '@fortawesome/free-solid-svg-icons';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
@@ -17,13 +18,15 @@ function ContentLock({
return (
<>
<h3>
<FontAwesomeIcon icon={faLock} />{' '}
<FontAwesomeIcon icon={faLock} />
{' '}
{sectionName}
</h3>
<h4>{intl.formatMessage(messages['learn.contentLock.content.locked'])}</h4>
<p>{intl.formatMessage(messages['learn.contentLock.complete.prerequisite'], {
prereqSectionName,
})}
<p>
{intl.formatMessage(messages['learn.contentLock.complete.prerequisite'], {
prereqSectionName,
})}
</p>
<p>
<Button className="btn-primary" onClick={handleClick}>{intl.formatMessage(messages['learn.contentLock.goToSection'])}</Button>
@@ -33,5 +36,9 @@ function ContentLock({
}
ContentLock.propTypes = {
intl: intlShape.isRequired,
courseUsageKey: PropTypes.string.isRequired,
prereqSectionName: PropTypes.string.isRequired,
prereqId: PropTypes.string.isRequired,
sectionName: PropTypes.string.isRequired,
};
export default injectIntl(ContentLock);

View File

@@ -1,7 +1,9 @@
import 'core-js/stable';
import 'regenerator-runtime/runtime';
import { APP_INIT_ERROR, APP_READY, subscribe, initialize } from '@edx/frontend-platform';
import {
APP_INIT_ERROR, APP_READY, subscribe, initialize,
} from '@edx/frontend-platform';
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
import React from 'react';
import ReactDOM from 'react-dom';

View File

@@ -1,16 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { faExclamationTriangle, faInfoCircle, faCheckCircle, faMinusCircle, faTimes } from '@fortawesome/free-solid-svg-icons';
import {
faExclamationTriangle, faInfoCircle, faCheckCircle, faMinusCircle, faTimes,
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Button } from '@edx/paragon';
function getAlertClass(type) {
if (type === 'error') {
return 'alert-warning';
} else if (type === 'danger') {
}
if (type === 'danger') {
return 'alert-danger';
} else if (type === 'success') {
}
if (type === 'success') {
return 'alert-success';
}
return 'alert-info';
@@ -19,9 +23,11 @@ function getAlertClass(type) {
function getAlertIcon(type) {
if (type === 'error') {
return faExclamationTriangle;
} else if (type === 'danger') {
}
if (type === 'danger') {
return faMinusCircle;
} else if (type === 'success') {
}
if (type === 'success') {
return faCheckCircle;
}
return faInfoCircle;