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

fix: eslint errors in admin quick actions #6218

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { updateCourse } from '@actions/course_actions.js';
// Helper Functions
const DetailsText = ({ flags }) => (
<p>
Last Reviewed:&nbsp;
{I18n.t('courses.last_reviewed')}:&nbsp;
<strong>
{flags.last_reviewed.username}
</strong>&nbsp;on
</strong>&nbsp;{I18n.t('courses.on')}
<br />
<strong>
{format(toDate(parseISO(flags.last_reviewed.timestamp)), 'PPPP p')}
Expand All @@ -26,8 +26,7 @@ const isCourseClosed = flags => !!(flags && flags.closed_date);

const NoDetailsText = () => (
<p>
This course has not yet been marked as having been reviewed by a staff member.
Click below to mark it as reviewed!
{I18n.t('courses.no_details')}
</p>
);

Expand All @@ -49,7 +48,7 @@ export const AdminQuickActions = ({ course, current_user, persistCourse, greetSt
{isCourseClosed(course.flags) && (
<div style={{ marginBottom: '15px' }}>
<p>
<strong>This course was closed on:</strong>&nbsp;
<strong>{I18n.t('courses.closed_on')}:</strong>&nbsp;
{format(toDate(parseISO(course.flags.closed_date)), 'PPPP')}.
</p>
</div>
Expand All @@ -74,7 +73,7 @@ export const AdminQuickActions = ({ course, current_user, persistCourse, greetSt
persistCourse(course.slug);
}}
>
Mark as Reviewed
{I18n.t('courses.mark_as_reviewed')}
</button>
<br />
<br />
Expand Down
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ en:
Your course has been cloned, including the elements of the timeline
(weeks and blocks). Be sure to add the dates, which are not carried over.
Has anything else about your course changed? Feel free to update it now.
closed_on: This course was closed on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only use complete messages in the locale files, rather than fragments like this that interact grammatically with other content before or after. (These are "lego" messages which need to be assembled from pieces, and they cause problems for translators.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we won't fix this, we would get into this:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a lot of these extant in the codebase. Fixing them is good when it's convenient and makes sense, but I think we need to find a pattern for disabling the linting rule when using i18n is not needed... which is true for any feature that is admin-facing and is only used in Wiki Education mode (like this one).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...need to find an alternative

copy_successful_details: >
Your course has been copied, including the elements of the timeline
(weeks and blocks). Be sure to add the dates, which are not carried over.
Expand Down Expand Up @@ -719,10 +720,12 @@ en:
invalid_sync: Enrollment in this event is controlled by Wikimedia Event Center. It cannot be joined from the Dashboard.
join_details: To join this course, you need to get the passcode — or an enrollment link that includes the passcode — from the instructor. If you haven't received this, contact your instructor.
join_no_passcode: Are you sure you want to join this course?
last_reviewed: Last Reviewed
launch_wizard: Launch the Wizard
leave_confirmation: Are you sure you want to leave this course?
leave_course: Leave course
loading: Loading…
mark_as_reviewed: Mark as Reviewed
milestones_none: This course does not currently have any milestones.
my_articles: My Articles
my_articles_wikidata: My Items
Expand Down Expand Up @@ -751,6 +754,7 @@ en:
new_account_submitted_admin: >
Your request for an account has been created. Please inform your students to check
their email inbox to get their new password
no_details: This course has not yet been marked as having been reviewed by a staff member. Click below to mark it as reviewed!
no_campaign: To make this program active and allow users to join, it must be added to a campaign. If you're unsure of which campaign to add, use 'Miscellanea'.
nocourses: You are not participating in any courses.
nocourse: has not participated in any courses.
Expand All @@ -760,6 +764,7 @@ en:
This will post a reminder on the talk pages for all students who overdue
for completing assigned training modules. Are you sure you want to do this?
no_available_actions: No available actions
on: on
online_volunteers_enabled: Online Volunteers enabled
online_volunteers_tooltip: Enabling Online Volunteers allows user editors to join as a volunteer. Their edits will not be tracked.
ores_plot: ORES
Expand Down
Loading