-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56e025a
commit d507d68
Showing
44 changed files
with
991 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# TODO: This file is temporary and will be removed after testing | ||
|
||
log() { | ||
echo "=============================== $1 ===============================" | ||
} | ||
|
||
run_command() { | ||
echo "\$ $1" | ||
eval $1 | ||
} | ||
|
||
log "Starting deployment script" | ||
run_command "pwd" | ||
|
||
# frontend-component-header | ||
log "Processing frontend-component-header" | ||
run_command "cd node_modules/@edx/" || exit | ||
log "Current directory: $(pwd)" | ||
run_command "rm -rf frontend-component-header" | ||
run_command "mkdir frontend-component-header" || exit | ||
run_command "git clone -b Peter_Kulko/use-SPA-functionality --single-branch https://github.com/raccoongang/frontend-component-header.git frontend-component-header-temp" | ||
run_command "cd frontend-component-header-temp" || exit | ||
log "Current directory: $(pwd)" | ||
run_command "npm ci" || exit | ||
run_command "npm run build" || exit | ||
run_command "cp -r dist ../frontend-component-header/" || exit | ||
run_command "cp -r package.json ../frontend-component-header/" || exit | ||
run_command "cd .." | ||
run_command "rm -rf frontend-component-header-temp" | ||
run_command "cd ../.." || exit | ||
log "Current directory: $(pwd)" | ||
|
||
# webpack | ||
log "Running webpack" | ||
run_command "fedx-scripts webpack" | ||
|
||
log "Deployment script finished." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
125 changes: 75 additions & 50 deletions
125
src/course-checklist/ChecklistSection/ChecklistItemBody.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,95 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { injectIntl, intlShape, FormattedMessage } from '@edx/frontend-platform/i18n'; | ||
import { | ||
ActionRow, | ||
Button, | ||
Hyperlink, | ||
Icon, | ||
} from '@openedx/paragon'; | ||
import { Link } from 'react-router-dom'; | ||
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n'; | ||
import { ActionRow, Button, Icon } from '@openedx/paragon'; | ||
import { useSelector } from 'react-redux'; | ||
import { CheckCircle, RadioButtonUnchecked } from '@openedx/paragon/icons'; | ||
import { getConfig } from '@edx/frontend-platform'; | ||
|
||
import { getWaffleFlags } from '../../data/selectors'; | ||
import messages from './messages'; | ||
|
||
const getUpdateLinks = (courseId, waffleFlags) => { | ||
const baseUrl = getConfig().STUDIO_BASE_URL; | ||
const isLegacyGradingUrl = !waffleFlags.useNewGradingPage; | ||
const isLegacyCertificateUrl = !waffleFlags.useNewCertificatesPage; | ||
const isLegacyCourseDatesUrl = !waffleFlags.useNewScheduleDetailsPage; | ||
const isLegacyOutlineUrl = !waffleFlags.useNewCourseOutlinePage; | ||
|
||
return { | ||
welcomeMessage: `/course/${courseId}/course_info`, | ||
gradingPolicy: isLegacyGradingUrl | ||
? `${baseUrl}/settings/grading/${courseId}` : `/course/${courseId}/settings/grading`, | ||
certificate: isLegacyCertificateUrl | ||
? `${baseUrl}/certificates/${courseId}` : `/course/${courseId}/certificates`, | ||
courseDates: isLegacyCourseDatesUrl | ||
? `${baseUrl}/settings/details/${courseId}#schedule` : `/course/${courseId}/settings/details/#schedule`, | ||
proctoringEmail: `${baseUrl}/pages-and-resources/proctoring/settings`, | ||
outline: isLegacyOutlineUrl ? `${baseUrl}/course/${courseId}` : `/course/${courseId}`, | ||
}; | ||
}; | ||
|
||
const ChecklistItemBody = ({ | ||
courseId, | ||
checkId, | ||
isCompleted, | ||
updateLink, | ||
// injected | ||
intl, | ||
}) => ( | ||
<ActionRow> | ||
<div className="mr-3" id={`icon-${checkId}`} data-testid={`icon-${checkId}`}> | ||
{isCompleted ? ( | ||
<Icon | ||
data-testid="completed-icon" | ||
src={CheckCircle} | ||
className="text-success" | ||
style={{ height: '32px', width: '32px' }} | ||
screenReaderText={intl.formatMessage(messages.completedItemLabel)} | ||
/> | ||
) : ( | ||
<Icon | ||
data-testid="uncompleted-icon" | ||
src={RadioButtonUnchecked} | ||
style={{ height: '32px', width: '32px' }} | ||
screenReaderText={intl.formatMessage(messages.uncompletedItemLabel)} | ||
/> | ||
)} | ||
</div> | ||
<div> | ||
<div> | ||
<FormattedMessage {...messages[`${checkId}ShortDescription`]} /> | ||
}) => { | ||
const intl = useIntl(); | ||
const waffleFlags = useSelector(getWaffleFlags); | ||
const updateLinks = getUpdateLinks(courseId, waffleFlags); | ||
|
||
return ( | ||
<ActionRow> | ||
<div className="mr-3" id={`icon-${checkId}`} data-testid={`icon-${checkId}`}> | ||
{isCompleted ? ( | ||
<Icon | ||
data-testid="completed-icon" | ||
src={CheckCircle} | ||
className="text-success" | ||
style={{ height: '32px', width: '32px' }} | ||
screenReaderText={intl.formatMessage(messages.completedItemLabel)} | ||
/> | ||
) : ( | ||
<Icon | ||
data-testid="uncompleted-icon" | ||
src={RadioButtonUnchecked} | ||
style={{ height: '32px', width: '32px' }} | ||
screenReaderText={intl.formatMessage(messages.uncompletedItemLabel)} | ||
/> | ||
)} | ||
</div> | ||
<div className="small"> | ||
<FormattedMessage {...messages[`${checkId}LongDescription`]} /> | ||
<div> | ||
<div> | ||
<FormattedMessage {...messages[`${checkId}ShortDescription`]} /> | ||
</div> | ||
<div className="small"> | ||
<FormattedMessage {...messages[`${checkId}LongDescription`]} /> | ||
</div> | ||
</div> | ||
</div> | ||
<ActionRow.Spacer /> | ||
{updateLink && ( | ||
<Hyperlink destination={updateLink} data-testid="update-hyperlink"> | ||
<Button size="sm"> | ||
<FormattedMessage {...messages.updateLinkLabel} /> | ||
</Button> | ||
</Hyperlink> | ||
)} | ||
</ActionRow> | ||
); | ||
<ActionRow.Spacer /> | ||
{updateLinks?.[checkId] && ( | ||
<Link | ||
to={updateLinks[checkId]} | ||
data-testid="update-link" | ||
> | ||
<Button size="sm"> | ||
<FormattedMessage {...messages.updateLinkLabel} /> | ||
</Button> | ||
</Link> | ||
)} | ||
</ActionRow> | ||
); | ||
}; | ||
|
||
ChecklistItemBody.defaultProps = { | ||
updateLink: null, | ||
}; | ||
|
||
ChecklistItemBody.propTypes = { | ||
courseId: PropTypes.string.isRequired, | ||
checkId: PropTypes.string.isRequired, | ||
isCompleted: PropTypes.bool.isRequired, | ||
updateLink: PropTypes.string, | ||
// injected | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
export default injectIntl(ChecklistItemBody); | ||
export default ChecklistItemBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.