From 6e86ef5a8c14d5c3c0a67d782b7be4358991cd21 Mon Sep 17 00:00:00 2001 From: Pat Renner Date: Fri, 1 May 2020 10:45:59 -0500 Subject: [PATCH] Change copy from 'drafts' to 'courses' for unpublished courses closes OUT-3664 Test-plan: - Ensure `unpublished_courses` FF is enabled - Open user dashboard as a user with at least one teacher enrollment - Ensure the Unpublished section is titled `Unpublished Courses` rather than `Unpublished Drafts` - Confirm the same text change in the course tray Change-Id: I37210a0c7b32da013c1e28245104606d86bf32dd Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235949 Tested-by: Service Cloud Jenkins Reviewed-by: Davis Hyer QA-Review: Davis Hyer Product-Review: Jody Sailor --- app/jsx/dashboard_card/DashboardCardBox.js | 8 ++++---- app/jsx/navigation_header/trays/CoursesTray.js | 2 +- .../navigation_header/trays/__tests__/CoursesTray.test.js | 6 +++--- .../jsx/dashboard_card/DashboardCardBoxSpec.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/jsx/dashboard_card/DashboardCardBox.js b/app/jsx/dashboard_card/DashboardCardBox.js index bd44bba070c..811353ff31c 100644 --- a/app/jsx/dashboard_card/DashboardCardBox.js +++ b/app/jsx/dashboard_card/DashboardCardBox.js @@ -164,7 +164,7 @@ export default class DashboardCardBox extends React.Component { .filter(card => card.published) .map(card => this.renderCard(card)) - const unpublishedDrafts = courseCards + const unpublishedCourses = courseCards .filter(card => !card.published) .map(card => this.renderCard(card)) @@ -182,11 +182,11 @@ export default class DashboardCardBox extends React.Component {

- {I18n.t(`Unpublished Drafts (%{count})`, { - count: I18n.n(unpublishedDrafts.length) + {I18n.t(`Unpublished Courses (%{count})`, { + count: I18n.n(unpublishedCourses.length) })}

- {unpublishedDrafts.length > 0 ? unpublishedDrafts : emptyEl} + {unpublishedCourses.length > 0 ? unpublishedCourses : emptyEl}
) diff --git a/app/jsx/navigation_header/trays/CoursesTray.js b/app/jsx/navigation_header/trays/CoursesTray.js index c5652711e45..f7435ebcaa3 100644 --- a/app/jsx/navigation_header/trays/CoursesTray.js +++ b/app/jsx/navigation_header/trays/CoursesTray.js @@ -44,7 +44,7 @@ export default function CoursesTray({courses, hasLoaded}) { {unpublished.length > 0 && ( - {I18n.t('Unpublished Drafts')} + {I18n.t('Unpublished Courses')} )} diff --git a/app/jsx/navigation_header/trays/__tests__/CoursesTray.test.js b/app/jsx/navigation_header/trays/__tests__/CoursesTray.test.js index 1c9714f6ac9..61e98944f16 100644 --- a/app/jsx/navigation_header/trays/__tests__/CoursesTray.test.js +++ b/app/jsx/navigation_header/trays/__tests__/CoursesTray.test.js @@ -82,14 +82,14 @@ describe('CoursesTray', () => { it('does not render a split dashboard for non teachers', () => { const {queryByText} = render() expect(queryByText('Published Courses')).not.toBeInTheDocument() - expect(queryByText('Unpublished Drafts')).not.toBeInTheDocument() + expect(queryByText('Unpublished Courses')).not.toBeInTheDocument() }) it('does render a split dashboard for teachers with appropriate headers', () => { window.ENV = {...window.ENV, current_user_roles: ['teacher']} const {getByText} = render() getByText('Published Courses') - getByText('Unpublished Drafts') + getByText('Unpublished Courses') }) }) @@ -105,7 +105,7 @@ describe('CoursesTray', () => { it('does not render a split dashboard for teachers', () => { const {queryByText} = render() expect(queryByText('Published Courses')).not.toBeInTheDocument() - expect(queryByText('Unpublished Drafts')).not.toBeInTheDocument() + expect(queryByText('Unpublished Courses')).not.toBeInTheDocument() }) }) }) diff --git a/spec/coffeescripts/jsx/dashboard_card/DashboardCardBoxSpec.js b/spec/coffeescripts/jsx/dashboard_card/DashboardCardBoxSpec.js index bb9b313736e..69b2e276809 100644 --- a/spec/coffeescripts/jsx/dashboard_card/DashboardCardBoxSpec.js +++ b/spec/coffeescripts/jsx/dashboard_card/DashboardCardBoxSpec.js @@ -153,7 +153,7 @@ QUnit.module('DashboardCardBox', suiteHooks => { mountComponent() const headers = getDashboardBoxHeaders() ok(headers[0].textContent.includes('Published Courses (1)')) - ok(headers[1].textContent.includes('Unpublished Drafts (1)')) + ok(headers[1].textContent.includes('Unpublished Courses (1)')) }) test('correctly renders empty headers in split view', () => {