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 <svc.cloudjenkins@instructure.com> Reviewed-by: Davis Hyer <dhyer@instructure.com> QA-Review: Davis Hyer <dhyer@instructure.com> Product-Review: Jody Sailor
This commit is contained in:
parent
356ae103c7
commit
6e86ef5a8c
|
@ -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 {
|
|||
</div>
|
||||
<div className="ic-DashboardCard__box">
|
||||
<h2 size="large" className="ic-DashboardCard__box__header">
|
||||
{I18n.t(`Unpublished Drafts (%{count})`, {
|
||||
count: I18n.n(unpublishedDrafts.length)
|
||||
{I18n.t(`Unpublished Courses (%{count})`, {
|
||||
count: I18n.n(unpublishedCourses.length)
|
||||
})}
|
||||
</h2>
|
||||
{unpublishedDrafts.length > 0 ? unpublishedDrafts : emptyEl}
|
||||
{unpublishedCourses.length > 0 ? unpublishedCourses : emptyEl}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -44,7 +44,7 @@ export default function CoursesTray({courses, hasLoaded}) {
|
|||
</List>
|
||||
{unpublished.length > 0 && (
|
||||
<Heading level="h4" as="h3" key="unpublished_courses">
|
||||
{I18n.t('Unpublished Drafts')}
|
||||
{I18n.t('Unpublished Courses')}
|
||||
</Heading>
|
||||
)}
|
||||
<List key="unpublished" variant="unstyled" margin="small small" itemSpacing="small">
|
||||
|
|
|
@ -82,14 +82,14 @@ describe('CoursesTray', () => {
|
|||
it('does not render a split dashboard for non teachers', () => {
|
||||
const {queryByText} = render(<CoursesTray {...makeProps()} />)
|
||||
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(<CoursesTray {...makeProps()} />)
|
||||
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(<CoursesTray {...makeProps()} />)
|
||||
expect(queryByText('Published Courses')).not.toBeInTheDocument()
|
||||
expect(queryByText('Unpublished Drafts')).not.toBeInTheDocument()
|
||||
expect(queryByText('Unpublished Courses')).not.toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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', () => {
|
||||
|
|
Loading…
Reference in New Issue