diff --git a/client/app/bundles/course/assessment/components/ConvertMcqMrqButton/index.tsx b/client/app/bundles/course/assessment/components/ConvertMcqMrqButton/index.tsx index b04f6f115bf..27ab31343e5 100644 --- a/client/app/bundles/course/assessment/components/ConvertMcqMrqButton/index.tsx +++ b/client/app/bundles/course/assessment/components/ConvertMcqMrqButton/index.tsx @@ -32,8 +32,8 @@ const ConvertMcqMrqButton = (props: ConvertMcqMrqButtonProps): JSX.Element => { variant="outlined" > {question.mcqMrqType === 'mcq' - ? t(translations.changeToMrqFull) - : t(translations.changeToMcqFull)} + ? t(translations.changeToMrq) + : t(translations.changeToMcq)} {!props.new && ( diff --git a/client/app/bundles/course/assessment/pages/AssessmentShow/Question.tsx b/client/app/bundles/course/assessment/pages/AssessmentShow/Question.tsx index 3033ae73834..899bf9e4969 100644 --- a/client/app/bundles/course/assessment/pages/AssessmentShow/Question.tsx +++ b/client/app/bundles/course/assessment/pages/AssessmentShow/Question.tsx @@ -142,7 +142,7 @@ const Question = (props: QuestionProps): JSX.Element => { -
+
{question.description && ( + @@ -380,7 +381,7 @@ export default class SubmissionsTable extends Component { {this.renderRowUsers()}
{this.renderRowTooltips()} - +
); } } diff --git a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/translations.js b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/translations.js index d52ff83cc5e..1d3791d44d1 100644 --- a/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/translations.js +++ b/client/app/bundles/course/assessment/submission/pages/SubmissionsIndex/translations.js @@ -13,7 +13,7 @@ const translations = defineMessages({ }, submissionStatus: { id: 'course.assessment.submission.SubmissionsIndex.submissionStatus', - defaultMessage: 'Submission Status', + defaultMessage: 'Status', }, grade: { id: 'course.assessment.submission.SubmissionsIndex.grade', @@ -21,7 +21,7 @@ const translations = defineMessages({ }, experiencePoints: { id: 'course.assessment.submission.SubmissionsIndex.experiencePoints', - defaultMessage: 'Experience Points Awarded', + defaultMessage: 'EXP Awarded', }, dateSubmitted: { id: 'course.assessment.submission.SubmissionsIndex.dateSubmitted', diff --git a/client/app/bundles/course/assessment/submission/translations.ts b/client/app/bundles/course/assessment/submission/translations.ts index 8162014d5cc..4b9efe1874a 100644 --- a/client/app/bundles/course/assessment/submission/translations.ts +++ b/client/app/bundles/course/assessment/submission/translations.ts @@ -112,7 +112,7 @@ const translations = defineMessages({ }, expAwarded: { id: 'course.assessment.submission.expAwarded', - defaultMessage: 'Experience Points Awarded', + defaultMessage: 'EXP Awarded', }, grader: { id: 'course.assessment.submission.grader', diff --git a/client/app/bundles/course/assessment/translations.ts b/client/app/bundles/course/assessment/translations.ts index 07bd69afe9b..c531d4fcfb3 100644 --- a/client/app/bundles/course/assessment/translations.ts +++ b/client/app/bundles/course/assessment/translations.ts @@ -396,14 +396,6 @@ const translations = defineMessages({ id: 'course.assessment.show.showOptions', defaultMessage: 'Show options', }, - changeToMrqFull: { - id: 'course.assessment.show.changeToMrqFull', - defaultMessage: 'Convert to Multiple Response (MRQ)', - }, - changeToMcqFull: { - id: 'course.assessment.show.changeToMcqFull', - defaultMessage: 'Convert to Multiple Choice (MCQ)', - }, multipleChoice: { id: 'course.assessment.show.multipleChoice', defaultMessage: 'Multiple Choice (MCQ)', diff --git a/client/app/bundles/course/lesson-plan/containers/ColumnVisibilityDropdown/index.jsx b/client/app/bundles/course/lesson-plan/containers/ColumnVisibilityDropdown/index.jsx index c37a2db4a92..d347680f3e0 100644 --- a/client/app/bundles/course/lesson-plan/containers/ColumnVisibilityDropdown/index.jsx +++ b/client/app/bundles/course/lesson-plan/containers/ColumnVisibilityDropdown/index.jsx @@ -19,13 +19,6 @@ const translations = defineMessages({ }, }); -const styles = { - dropdown: { - display: 'inline-block', - marginLeft: 16, - }, -}; - class ColumnVisibilityDropdown extends Component { constructor(props) { super(props); @@ -55,7 +48,7 @@ class ColumnVisibilityDropdown extends Component { const { dispatch, columnsVisible } = this.props; return ( -
+ <> + -
+ ); } } diff --git a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/EnterEditModeButton.jsx b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/EnterEditModeButton.jsx index 5b8ada381b8..0441c9bcbdc 100644 --- a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/EnterEditModeButton.jsx +++ b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/EnterEditModeButton.jsx @@ -7,7 +7,7 @@ import { getCourseId } from 'lib/helpers/url-helpers'; const translations = defineMessages({ enterEditMode: { id: 'course.lessonPlan.LessonPlanLayout.EnterEditModeButton.enterEditMode', - defaultMessage: 'Enter Edit Mode', + defaultMessage: 'Edit Mode', }, }); @@ -16,7 +16,6 @@ const EnterEditModeButton = () => { const courseId = getCourseId(); return ( - ); -}; - -export default ExitEditModeButton; diff --git a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewEventButton.jsx b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewEventButton.jsx index b592bc9229d..4d73eb9ec52 100644 --- a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewEventButton.jsx +++ b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewEventButton.jsx @@ -1,6 +1,7 @@ import { Component } from 'react'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { Add } from '@mui/icons-material'; import { Button } from '@mui/material'; import PropTypes from 'prop-types'; @@ -10,7 +11,7 @@ import { actions } from '../../store'; const translations = defineMessages({ newEvent: { id: 'course.lessonPlan.LessonPlanLayout.NewEventButton.newEvent', - defaultMessage: 'New Event', + defaultMessage: 'Event', }, success: { id: 'course.lessonPlan.LessonPlanLayout.NewEventButton.success', @@ -50,12 +51,10 @@ class NewEventButton extends Component { }; render() { - if (!this.props.canManageLessonPlan) { - return
; - } + if (!this.props.canManageLessonPlan) return null; return ( - ); diff --git a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewMilestoneButton.jsx b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewMilestoneButton.jsx index f4a17751507..6000f8e31e5 100644 --- a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewMilestoneButton.jsx +++ b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/NewMilestoneButton.jsx @@ -1,6 +1,7 @@ import { Component } from 'react'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; +import { Add } from '@mui/icons-material'; import { Button } from '@mui/material'; import PropTypes from 'prop-types'; @@ -10,7 +11,7 @@ import { actions } from '../../store'; const translations = defineMessages({ newMilestone: { id: 'course.lessonPlan.LessonPlanLayout.NewMilestoneButton.newMilestone', - defaultMessage: 'New Milestone', + defaultMessage: 'Milestone', }, success: { id: 'course.lessonPlan.LessonPlanLayout.NewMilestoneButton.success', @@ -22,12 +23,6 @@ const translations = defineMessages({ }, }); -const styles = { - button: { - marginRight: 16, - }, -}; - class NewMilestoneButton extends Component { createMilestoneHandler = (data, setError) => { const { dispatch } = this.props; @@ -55,12 +50,7 @@ class NewMilestoneButton extends Component { } return ( - ); diff --git a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewEventButton.test.jsx b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewEventButton.test.jsx index 22c0df52d35..0966561b365 100644 --- a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewEventButton.test.jsx +++ b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewEventButton.test.jsx @@ -33,7 +33,7 @@ describe('', () => { { state }, ); - fireEvent.click(page.getByRole('button', { name: 'New Event' })); + fireEvent.click(page.getByRole('button', { name: 'Event' })); fireEvent.change(page.getByLabelText('Title', { exact: false }), { target: { value: eventData.title }, diff --git a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewMilestoneButton.test.jsx b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewMilestoneButton.test.jsx index 9e1bb2697e4..a49f1c12a54 100644 --- a/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewMilestoneButton.test.jsx +++ b/client/app/bundles/course/lesson-plan/containers/LessonPlanLayout/__test__/NewMilestoneButton.test.jsx @@ -29,7 +29,7 @@ describe('', () => { { state }, ); - fireEvent.click(page.getByRole('button', { name: 'New Milestone' })); + fireEvent.click(page.getByRole('button', { name: 'Milestone' })); fireEvent.change(page.getByLabelText('Title', { exact: false }), { target: { value: milestoneData.title }, diff --git a/client/app/bundles/course/lesson-plan/pages/LessonPlanEdit/index.jsx b/client/app/bundles/course/lesson-plan/pages/LessonPlanEdit/index.jsx index 580248d3978..b5bec7bb962 100644 --- a/client/app/bundles/course/lesson-plan/pages/LessonPlanEdit/index.jsx +++ b/client/app/bundles/course/lesson-plan/pages/LessonPlanEdit/index.jsx @@ -4,11 +4,11 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import Page from 'lib/components/core/layouts/Page'; +import { getCourseId } from 'lib/helpers/url-helpers'; import { lessonPlanTypesGroups } from 'lib/types'; import { fields } from '../../constants'; import ColumnVisibilityDropdown from '../../containers/ColumnVisibilityDropdown'; -import ExitEditModeButton from '../../containers/LessonPlanLayout/ExitEditModeButton'; import NewEventButton from '../../containers/LessonPlanLayout/NewEventButton'; import NewMilestoneButton from '../../containers/LessonPlanLayout/NewMilestoneButton'; import translations from '../../translations'; @@ -78,20 +78,21 @@ export class LessonPlanEdit extends Component { render() { const { groups } = this.props; + const courseId = getCourseId(); return ( - +
- +
) } - title={} + backTo={`/courses/${courseId}/lesson_plan`} + title={} >
diff --git a/client/app/bundles/course/lesson-plan/pages/LessonPlanShow/index.jsx b/client/app/bundles/course/lesson-plan/pages/LessonPlanShow/index.jsx index 9e968ee3b35..03b9724167e 100644 --- a/client/app/bundles/course/lesson-plan/pages/LessonPlanShow/index.jsx +++ b/client/app/bundles/course/lesson-plan/pages/LessonPlanShow/index.jsx @@ -85,11 +85,11 @@ export class LessonPlanShow extends Component { +
- +
) } title={} diff --git a/client/app/bundles/course/lesson-plan/translations.ts b/client/app/bundles/course/lesson-plan/translations.ts index 5b909cc404c..8d557f8fff7 100644 --- a/client/app/bundles/course/lesson-plan/translations.ts +++ b/client/app/bundles/course/lesson-plan/translations.ts @@ -55,6 +55,10 @@ const translations = defineMessages({ id: 'course.lessonPlan.LessonPlanLayout.lessonPlan', defaultMessage: 'Lesson Plan', }, + editLessonPlan: { + id: 'course.lessonPlan.LessonPlanLayout.editLessonPlan', + defaultMessage: 'Edit Lesson Plan', + }, empty: { id: 'course.lessonPlan.LessonPlanLayout.empty', defaultMessage: 'The lesson plan is empty.', diff --git a/client/app/bundles/user/AccountSettings/AccountSettingsForm.tsx b/client/app/bundles/user/AccountSettings/AccountSettingsForm.tsx index 5a22e6dea25..1538625a1c1 100644 --- a/client/app/bundles/user/AccountSettings/AccountSettingsForm.tsx +++ b/client/app/bundles/user/AccountSettings/AccountSettingsForm.tsx @@ -262,7 +262,6 @@ const AccountSettingsForm = (props: AccountSettingsFormProps): JSX.Element => { fullWidth inputProps={{ autoComplete: 'off' }} label={t(translations.currentPassword)} - showPasswordVisibilityHint type="password" variant="filled" /> @@ -284,8 +283,9 @@ const AccountSettingsForm = (props: AccountSettingsFormProps): JSX.Element => { fullWidth inputProps={{ autoComplete: 'new-password' }} label={t(translations.newPassword)} - onChangePasswordVisibility={setRequirePasswordConfirmation} - showPasswordVisibilityHint + onChangePasswordVisibility={(visible): void => + setRequirePasswordConfirmation(!visible) + } type="password" variant="filled" /> diff --git a/client/app/bundles/users/pages/UserShow/index.tsx b/client/app/bundles/users/pages/UserShow.tsx similarity index 93% rename from client/app/bundles/users/pages/UserShow/index.tsx rename to client/app/bundles/users/pages/UserShow.tsx index abb809a3a1f..c2fdd1381d5 100644 --- a/client/app/bundles/users/pages/UserShow/index.tsx +++ b/client/app/bundles/users/pages/UserShow.tsx @@ -6,15 +6,15 @@ import { Avatar, Grid, Typography } from '@mui/material'; import LoadingIndicator from 'lib/components/core/LoadingIndicator'; import { useAppDispatch, useAppSelector } from 'lib/hooks/store'; -import CoursesTable from '../../components/tables/CoursesTable'; -import InstancesTable from '../../components/tables/InstancesTable'; -import { fetchUser } from '../../operations'; +import CoursesTable from '../components/tables/CoursesTable'; +import InstancesTable from '../components/tables/InstancesTable'; +import { fetchUser } from '../operations'; import { getAllCompletedCourseMiniEntities, getAllCurrentCourseMiniEntities, getAllInstanceMiniEntities, getUserEntity, -} from '../../selectors'; +} from '../selectors'; interface Props extends WrappedComponentProps {} diff --git a/client/app/lib/components/core/buttons/Checkbox.tsx b/client/app/lib/components/core/buttons/Checkbox.tsx index 55d316b9d6b..643af4f5533 100644 --- a/client/app/lib/components/core/buttons/Checkbox.tsx +++ b/client/app/lib/components/core/buttons/Checkbox.tsx @@ -69,11 +69,18 @@ const Checkbox = forwardRef( } /> -
+
{description && ( {description} diff --git a/client/app/lib/components/core/fields/PasswordTextField.tsx b/client/app/lib/components/core/fields/PasswordTextField.tsx index 73ac0d20f69..f5841ad3b8d 100644 --- a/client/app/lib/components/core/fields/PasswordTextField.tsx +++ b/client/app/lib/components/core/fields/PasswordTextField.tsx @@ -1,15 +1,11 @@ import { ComponentProps, forwardRef, useState } from 'react'; import { Visibility, VisibilityOff } from '@mui/icons-material'; -import { IconButton, InputAdornment, Typography } from '@mui/material'; - -import useTranslation from 'lib/hooks/useTranslation'; -import messagesTranslations from 'lib/translations/messages'; +import { IconButton, InputAdornment } from '@mui/material'; import TextField from './TextField'; type PasswordTextFieldProps = ComponentProps & { onChangePasswordVisibility?: (visibility: boolean) => void; - showPasswordVisibilityHint?: boolean; disablePasswordVisibilitySwitch?: boolean; }; @@ -17,12 +13,10 @@ const PasswordTextField = forwardRef( (props, ref): JSX.Element => { const { onChangePasswordVisibility, - showPasswordVisibilityHint, disablePasswordVisibilitySwitch, ...textFieldProps } = props; - const { t } = useTranslation(); const [showPassword, setShowPassword] = useState(false); const handleChangePasswordVisibility = (): void => @@ -31,7 +25,7 @@ const PasswordTextField = forwardRef( return !state; }); - const textField = ( + return ( ( })} /> ); - - if (showPasswordVisibilityHint && showPassword) - return ( -
- {textField} - -
- - - - {t(messagesTranslations.passwordIsVisible)} - -
-
- ); - - return textField; }, ); diff --git a/client/app/lib/components/core/layouts/Footer.tsx b/client/app/lib/components/core/layouts/Footer.tsx index 4db4d33fcf1..7bf7d55cca2 100644 --- a/client/app/lib/components/core/layouts/Footer.tsx +++ b/client/app/lib/components/core/layouts/Footer.tsx @@ -32,28 +32,34 @@ const translations = defineMessages({ }, }); -/** - * TODO: Populate with appropriate links when pages are ready. - */ const Footer = (): JSX.Element => { const { t } = useTranslation(); return (
-
- +
+ {t(translations.termsOfService)} - + {t(translations.privacyPolicy)} - + {t(translations.contactUs)} { {
{(props.title || props.actions) && (
-
+
{props.title && (
{route && ( @@ -45,7 +45,9 @@ const Page = (props: PageProps): JSX.Element => { )} {props.actions && ( -
{props.actions}
+
+ {props.actions} +
)}
diff --git a/client/app/lib/translations/messages.ts b/client/app/lib/translations/messages.ts index 06a234c912a..fe53fa38b4d 100644 --- a/client/app/lib/translations/messages.ts +++ b/client/app/lib/translations/messages.ts @@ -16,11 +16,6 @@ const messagesTranslations = defineMessages({ defaultMessage: 'An error occurred when saving your changes. You may reload and try again.', }, - passwordIsVisible: { - id: 'lib.translations.messages.passwordIsVisible', - defaultMessage: - 'Your password is visible! Watch out for eyes behind you...', - }, }); export default messagesTranslations; diff --git a/config/initializers/rack_mini_profiler.rb b/config/initializers/rack_mini_profiler.rb new file mode 100644 index 00000000000..f8f27e8950e --- /dev/null +++ b/config/initializers/rack_mini_profiler.rb @@ -0,0 +1,3 @@ +# frozen_string_literal: true +# TODO: Remove this once fully SPA +Rack::MiniProfiler.config.position = 'top-right' diff --git a/spec/features/course/assessment/question/multiple_response_management_spec.rb b/spec/features/course/assessment/question/multiple_response_management_spec.rb index b5aca955da8..585db80e1ad 100644 --- a/spec/features/course/assessment/question/multiple_response_management_spec.rb +++ b/spec/features/course/assessment/question/multiple_response_management_spec.rb @@ -18,10 +18,10 @@ new_mcq_page = window_opened_by { click_link 'Multiple Choice (MCQ)' } within_window new_mcq_page do - click_on 'Convert to Multiple Response (MRQ)' + click_on 'Convert to MRQ' expect(page).to have_text('Responses') - click_on 'Convert to Multiple Choice (MCQ)' + click_on 'Convert to MCQ' expect(page).to have_text('Choices') end end @@ -32,10 +32,10 @@ new_mrq_page = window_opened_by { click_link 'Multiple Response (MRQ)' } within_window new_mrq_page do - click_on 'Convert to Multiple Choice (MCQ)' + click_on 'Convert to MCQ' expect(page).to have_text('Choices') - click_on 'Convert to Multiple Response (MRQ)' + click_on 'Convert to MRQ' expect(page).to have_text('Responses') end end @@ -163,14 +163,14 @@ # Switching in edit page # Switch MRQ to MCQ visit edit_path - click_button 'Convert to Multiple Choice (MCQ)' click_button 'Convert to MCQ' + find_all('button', text: 'Convert to MCQ').last.click wait_for_page # Switch MCQ to MRQ - click_button 'Convert to Multiple Response (MRQ)' click_button 'Convert to MRQ' + find_all('button', text: 'Convert to MRQ').last.click wait_for_page @@ -178,13 +178,13 @@ visit course_assessment_path(course, assessment) # Switch MRQ to MCQ - click_button 'Convert to Multiple Choice (MCQ)' click_button 'Convert to MCQ' + find_all('button', text: 'Convert to MCQ').last.click expect_toastify('Question type successfully changed.') expect(page).to have_text( I18n.t('course.assessment.question.multiple_responses.question_type.multiple_choice') ) - expect(page).to have_button('Convert to Multiple Response (MRQ)') + expect(page).to have_button('Convert to MRQ') # Delete all MCQ options visit edit_path