diff --git a/app/views/self_enrollments/_already_enrolled.html.erb b/app/views/self_enrollments/_already_enrolled.html.erb index d4d63e01de8..ed57c264d67 100644 --- a/app/views/self_enrollments/_already_enrolled.html.erb +++ b/app/views/self_enrollments/_already_enrolled.html.erb @@ -16,6 +16,8 @@ # with this program. If not, see . %> +<% go_to_course_text = @course.elementary_enabled? ? t("Go to Subject") : t("buttons.go_to_course", "Go to the Course") %> +

<%= mt :already_enrolled, "You are already enrolled in **%{course}**.", :course => @course.name %>

@@ -25,7 +27,7 @@ <% if @course.user_is_student?(@current_user) # i.e. *current* student, the course has started %> <%= t "buttons.go_to_dashboard", "Go to your Dashboard" %> - <%= t "buttons.go_to_course", "Go to the Course" %> + <%= go_to_course_text %> <% else %> <%= t "buttons.go_to_dashboard", "Go to your Dashboard" %> <% end %> diff --git a/app/views/self_enrollments/_authenticate.html.erb b/app/views/self_enrollments/_authenticate.html.erb index c030a9d06f3..cd45eab4e1e 100644 --- a/app/views/self_enrollments/_authenticate.html.erb +++ b/app/views/self_enrollments/_authenticate.html.erb @@ -16,6 +16,8 @@ # with this program. If not, see . %> +<% enrollment_cta_text = @course.elementary_enabled? ? t("Enroll in Subject") : t("buttons.enroll_in_course", "Enroll in Course") %> +
<%= registration_summary || content_tag(:div, mt(:getting_started, "You are enrolling in **%{course}**.", :course => @course.name)) %> @@ -38,7 +40,7 @@ <%= t '#site.view_privacy_policy', 'View Privacy Policy' %>
diff --git a/app/views/self_enrollments/_authenticate_or_register.html.erb b/app/views/self_enrollments/_authenticate_or_register.html.erb index 6b3b588a9f7..3d9144f193f 100644 --- a/app/views/self_enrollments/_authenticate_or_register.html.erb +++ b/app/views/self_enrollments/_authenticate_or_register.html.erb @@ -16,6 +16,8 @@ # with this program. If not, see . %> +<% enrollment_cta_text = @course.elementary_enabled? ? t("Enroll in Subject") : t("buttons.enroll_in_course", "Enroll in Course") %> + <%= registration_summary || content_tag(:div, mt(:getting_started, "You are enrolling in **%{course}**.", :course => @course.name)) %>

<%= t("Please enter your %{label_name}:", :label_name => @login_label_name) %>

@@ -71,7 +73,7 @@ <%= t '#site.view_privacy_policy', 'View Privacy Policy' %> diff --git a/app/views/self_enrollments/_confirm_enrollments.html.erb b/app/views/self_enrollments/_confirm_enrollments.html.erb index edd6ba24ac6..2ef87b75ef3 100644 --- a/app/views/self_enrollments/_confirm_enrollments.html.erb +++ b/app/views/self_enrollments/_confirm_enrollments.html.erb @@ -16,6 +16,8 @@ # with this program. If not, see . %> +<% enrollment_cta_text = @course.elementary_enabled? ? t("Enroll in Subject") : t("buttons.enroll_in_course", "Enroll in Course") %> +
<%= registration_summary || content_tag(:div, mt(:getting_started, "You are enrolling in **%{course}**", :course => @course.name)) %> @@ -27,7 +29,7 @@ diff --git a/app/views/self_enrollments/_successfully_enrolled.html.erb b/app/views/self_enrollments/_successfully_enrolled.html.erb index 92fac1cff63..9585fdcb809 100644 --- a/app/views/self_enrollments/_successfully_enrolled.html.erb +++ b/app/views/self_enrollments/_successfully_enrolled.html.erb @@ -16,6 +16,8 @@ # with this program. If not, see . %> +<% go_to_course_text = @course.elementary_enabled? ? t("Go to Subject") : t("buttons.go_to_course", "Go to the Course") %> +

<%= mt :already_enrolled, "You have successfully enrolled in **%{course}**.", :course => @course.name %>

@@ -27,7 +29,7 @@
diff --git a/ui/features/k5_course/react/K5Course.js b/ui/features/k5_course/react/K5Course.js index 1864c2ea8b1..4bee2d52e70 100644 --- a/ui/features/k5_course/react/K5Course.js +++ b/ui/features/k5_course/react/K5Course.js @@ -151,7 +151,7 @@ const ConfirmDropModal = ({isModalOpen, closeModal, courseName, dropLink}) => { closeModal() window.location.reload() }) - .catch(err => showFlashError(I18n.t('Unable to drop the course'))(err)) + .catch(err => showFlashError(I18n.t('Unable to drop the subject'))(err)) .finally(() => setPosting(false)) } @@ -165,7 +165,7 @@ const ConfirmDropModal = ({isModalOpen, closeModal, courseName, dropLink}) => { {isPosting ? ( - + ) : ( <> @@ -174,7 +174,7 @@ const ConfirmDropModal = ({isModalOpen, closeModal, courseName, dropLink}) => { {I18n.t( - 'Are you sure you want to unenroll in this course? You will no longer be able to see the course roster or communicate directly with the teachers, and you will no longer see course events in your stream and as notifications.' + 'Are you sure you want to unenroll in this subject? You will no longer be able to see the subject roster or communicate directly with the teachers, and you will no longer see subject events in your stream and as notifications.' )} @@ -194,7 +194,7 @@ const ConfirmDropModal = ({isModalOpen, closeModal, courseName, dropLink}) => { onClick={handleConfirm} interaction={!isPosting ? 'enabled' : 'disabled'} > - {I18n.t('Drop this Course')} + {I18n.t('Drop this Subject')} @@ -250,13 +250,13 @@ export const CourseHeaderHero = forwardRef( {selfEnrollment?.option === 'enroll' && ( )} {selfEnrollment?.option === 'unenroll' && ( <> { url: 'http://enroll_url/' } const {getByRole} = render() - const button = getByRole('link', {name: 'Join this Course'}) + const button = getByRole('link', {name: 'Join this Subject'}) expect(button).toBeInTheDocument() expect(button.href).toBe('http://enroll_url/') }) @@ -409,14 +409,14 @@ describe('K-5 Subject Course', () => { const {getByRole, getByText} = render( ) - const button = getByRole('button', {name: 'Drop this Course'}) + const button = getByRole('button', {name: 'Drop this Subject'}) expect(button).toBeInTheDocument() act(() => button.click()) expect(getByText('Drop Arts and Crafts')).toBeInTheDocument() expect(getByText('Confirm Unenrollment')).toBeInTheDocument() expect( getByText( - 'Are you sure you want to unenroll in this course? You will no longer be able to see the course roster or communicate directly with the teachers, and you will no longer see course events in your stream and as notifications.' + 'Are you sure you want to unenroll in this subject? You will no longer be able to see the subject roster or communicate directly with the teachers, and you will no longer see subject events in your stream and as notifications.' ) ).toBeInTheDocument() expect(getByRole('button', {name: 'Cancel'})).toBeInTheDocument() @@ -431,19 +431,19 @@ describe('K-5 Subject Course', () => { const {getByRole, getAllByRole, getByText} = render( ) - const openModalButton = getByRole('button', {name: 'Drop this Course'}) + const openModalButton = getByRole('button', {name: 'Drop this Subject'}) act(() => openModalButton.click()) - const dropButton = getAllByRole('button', {name: 'Drop this Course'})[1] + const dropButton = getAllByRole('button', {name: 'Drop this Subject'})[1] act(() => dropButton.click()) - expect(getByText('Dropping course')).toBeInTheDocument() + expect(getByText('Dropping subject')).toBeInTheDocument() expect(fetchMock.called(selfEnrollment.url)).toBeTruthy() }) it('renders neither if selfEnrollment is nil', () => { const {getByText, queryByText} = render() expect(getByText('Arts and Crafts')).toBeInTheDocument() - expect(queryByText('Join this Course')).not.toBeInTheDocument() - expect(queryByText('Drop this Course')).not.toBeInTheDocument() + expect(queryByText('Join this Subject')).not.toBeInTheDocument() + expect(queryByText('Drop this Subject')).not.toBeInTheDocument() }) })