Skip to content

Commit

Permalink
fix: translation for header of course filter form (course status) (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
FatemeKhodayari authored Feb 26, 2024
1 parent 99815e8 commit e8660b9
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/containers/CourseFilterControls/components/FilterForm.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useIntl } from '@edx/frontend-platform/i18n';

import { FilterKeys } from 'data/constants/app';

import { Form } from '@edx/paragon';

import Checkbox from './Checkbox';
import messages from '../messages';

export const filterOrder = [
FilterKeys.inProgress,
Expand All @@ -18,20 +20,23 @@ export const filterOrder = [
export const FilterForm = ({
filters,
handleFilterChange,
}) => (
<Form.Group>
<div className="filter-form-heading mb-1">Course Status</div>
<Form.CheckboxSet
name="course-status-filters"
onChange={handleFilterChange}
value={filters}
>
{filterOrder.map(filterKey => (
<Checkbox filterKey={filterKey} key={filterKey} />
))}
</Form.CheckboxSet>
</Form.Group>
);
}) => {
const { formatMessage } = useIntl();
return (
<Form.Group>
<div className="filter-form-heading mb-1">{formatMessage(messages.courseStatus)}</div>
<Form.CheckboxSet
name="course-status-filters"
onChange={handleFilterChange}
value={filters}
>
{filterOrder.map(filterKey => (
<Checkbox filterKey={filterKey} key={filterKey} />
))}
</Form.CheckboxSet>
</Form.Group>
);
};
FilterForm.propTypes = {
filters: PropTypes.arrayOf(PropTypes.string).isRequired,
handleFilterChange: PropTypes.func.isRequired,
Expand Down
5 changes: 5 additions & 0 deletions src/containers/CourseFilterControls/messages.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { defineMessages } from '@edx/frontend-platform/i18n';

const messages = defineMessages({
courseStatus: {
id: 'learner-dash.courseListFilters.courseStatus',
description: 'course status filter form heading',
defaultMessage: 'Course Status',
},
inProgress: {
id: 'learner-dash.courseListFilters.inProgress',
description: 'in-progress filter checkbox label for course list filters',
Expand Down

0 comments on commit e8660b9

Please sign in to comment.