Update course link icons

Pages -> documents icon
Navigaion -> no icon

closes CORE-2872

test plan
  - open /courses/:course_id/assignments/new in a course with some pages
  - select Links > Course Links from the RCE toolbar
  - expand the Pages section in the tray
  > expect the document icon
  - expand the Navigation section in the tray
  > expect no icon, but the items are lined up correctly because
    the space is properly taken up by a blank icon

Change-Id: I92265f017249aac64271f14e5439989f6e59a33a
Reviewed-on: https://gerrit.instructure.com/196704
Tested-by: Jenkins
Reviewed-by: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
Product-Review: Ed Schiebel <eschiebel@instructure.com>
This commit is contained in:
Ed Schiebel 2019-06-06 10:31:53 -04:00
parent 1cdde9a40a
commit fa06c7614a
2 changed files with 21 additions and 9 deletions

View File

@ -26,6 +26,7 @@ import dragHtml from "../../../../sidebar/dragHtml";
import {AccessibleContent} from '@instructure/ui-a11y'
import {Flex, View} from '@instructure/ui-layout'
import {Text} from '@instructure/ui-elements'
import {SVGIcon} from '@instructure/ui-svg-images'
import {
IconDragHandleLine,
IconAssignmentLine,
@ -35,9 +36,17 @@ import {
IconAnnouncementLine,
IconPublishSolid,
IconUnpublishedSolid,
IconQuestionLine
IconDocumentLine
} from '@instructure/ui-icons'
function IconBlank() {
return (
<SVGIcon name="IconBlank" viewBox="0 0 1920 1920">
<g role="presentation"></g>
</SVGIcon>
)
}
function getIcon(type) {
switch(type) {
case 'assignments':
@ -50,9 +59,12 @@ function getIcon(type) {
return IconQuizLine
case 'announcements':
return IconAnnouncementLine
case 'wikiPages': // waiting on an answer from design
case 'wikiPages':
return IconDocumentLine
case 'navigation':
return IconBlank
default:
return IconQuestionLine
return IconDocumentLine
}
}

View File

@ -45,8 +45,8 @@ describe('RCE "Links" Plugin > Link', () => {
{type: 'modules', icon: 'IconModule'},
{type: 'quizzes', icon: 'IconQuiz'},
{type: 'announcements', icon: 'IconAnnouncement'},
{type: 'wikiPages', icon: 'IconQuestion'},
{type: 'navigation', icon: 'IconQuestion'},
{type: 'wikiPages', icon: 'IconDocument'},
{type: 'navigation', icon: 'IconBlank'},
]
linkTypes.forEach(lt => {
@ -57,12 +57,12 @@ describe('RCE "Links" Plugin > Link', () => {
published: true
}
const {container, getByText} = renderComponent({type: lt.type, link})
expect(getByText(link.title)).toBeInTheDocument()
expect(queryIconByName(container, 'IconPublish')).toBeInTheDocument()
expect(queryIconByName(container, lt.icon)).toBeInTheDocument()
})
it(`renders unpublished ${lt.type}`, () => {
const link = {
href: 'the_url',
@ -70,7 +70,7 @@ describe('RCE "Links" Plugin > Link', () => {
published: false
}
const {container, getByText} = renderComponent({type: lt.type, link})
expect(getByText(link.title)).toBeInTheDocument()
expect(queryIconByName(container, 'IconUnpublished')).toBeInTheDocument()
expect(queryIconByName(container, lt.icon)).toBeInTheDocument()
@ -80,7 +80,7 @@ describe('RCE "Links" Plugin > Link', () => {
describe('date variant', () => {
const value = '2019-04-24T13:00:00Z'
const formattedValue = formatMessage.date(Date.parse(value), 'long')
it('renders muliple due dates', () => {
const link = {
href: 'the_url',