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

🐛(frontend) fix Enroll now translation #2246

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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Switch from setup.cfg to pyproject.toml

### Fixed

- Fix frontend translation of Enroll now for external LMS backend

## [2.25.0-beta.1]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import CourseRunEnrollment from '../CourseRunEnrollment';
import CourseProductItem from '../CourseProductItem';

const messages = defineMessages({
enroll: {
id: 'components.SyllabusCourseRun.enroll',
description: 'CTA for users to enroll in the course run for external LMS backend.',
defaultMessage: 'Enroll now',
},
enrollment: {
id: 'components.SyllabusCourseRun.enrollment',
description: 'Title of the enrollment dates section of an opened course run block',
Expand Down Expand Up @@ -84,7 +89,7 @@ const OpenedCourseRun = ({ courseRun }: { courseRun: CourseRun }) => {
<CourseRunEnrollment courseRun={courseRun} />
) : (
<a className="course-run-enrollment__cta" href={courseRun.resource_link}>
{StringHelper.capitalizeFirst(courseRun.state.call_to_action)}
<FormattedMessage {...messages.enroll} />
</a>
)}
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import JoanieApiProvider from 'contexts/JoanieApiContext';
import { CourseProductRelation } from 'types/Joanie';
import { CourseLightFactory, CourseProductRelationFactory } from 'utils/test/factories/joanie';
import { DEFAULT_DATE_FORMAT } from 'hooks/useDateFormat';
import { StringHelper } from 'utils/StringHelper';
import { computeStates } from 'utils/CourseRuns';
import { User } from 'types/User';
import { Nullable } from 'types/utils';
Expand Down Expand Up @@ -138,7 +137,7 @@ describe('<SyllabusCourseRunsList/>', () => {

expect(languagesContainer.nextSibling).toBeNull();
getByRole(runContainer, 'link', {
name: StringHelper.capitalizeFirst(courseRun.state.call_to_action)!,
name: 'Enroll now',
});
};

Expand Down