[instui 3->4] upgrade ToDoSidebar
Closes: CORE-755 this is the result of running these code mods: http://instructure.github.io/instructure-ui/#ui-codemods against these files to upgrade them from instui 3 to 4. Test plan: * if this passes Jenkins, you can probably merge this as-is * but first have the devs on your team give it a code-review * and have QA manually click around and make sure these pages/components still work * if it doesn’t pass Jenkins. You, or someone on the team that “owns” this part of the code needs to check out this commit and push new patchsets until it does pass. Please do so ASAP Change-Id: I7f7d2c1444ae5b303f93d2b19906c33813e2dd94 Reviewed-on: https://gerrit.instructure.com/135359 Reviewed-by: Clay Diffrient <cdiffrient@instructure.com> Tested-by: Jenkins QA-Review: Deepeeca Soundarrajan <dsoundarrajan@instructure.com> Product-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
parent
8703baf26d
commit
efde166019
|
@ -17,11 +17,11 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import Button from 'instructure-ui/lib/components/Button';
|
||||
import Link from 'instructure-ui/lib/components/Link';
|
||||
import Typography from 'instructure-ui/lib/components/Typography';
|
||||
import List from 'instructure-ui/lib/components/List';
|
||||
import ListItem from 'instructure-ui/lib/components/List/ListItem';
|
||||
import Button from '@instructure/ui-core/lib/components/Button';
|
||||
import Link from '@instructure/ui-core/lib/components/Link';
|
||||
import Text from '@instructure/ui-core/lib/components/Text';
|
||||
import List from '@instructure/ui-core/lib/components/List';
|
||||
import ListItem from '@instructure/ui-core/lib/components/List/ListItem';
|
||||
import AssignmentIcon from 'instructure-icons/lib/Line/IconAssignmentLine';
|
||||
import QuizIcon from 'instructure-icons/lib/Line/IconQuizLine';
|
||||
import AnnouncementIcon from 'instructure-icons/lib/Line/IconAnnouncementLine';
|
||||
|
@ -80,11 +80,11 @@ const getInformationRow = (dueAt, points) => {
|
|||
}
|
||||
|
||||
export default function ToDoItem (props) {
|
||||
const title = <Typography size="small" lineHeight="fit">{props.title}</Typography>
|
||||
const title = <Text size="small" lineHeight="fit">{props.title}</Text>
|
||||
const titleComponent = props.href ? (
|
||||
<Link href={props.href}>{title}</Link>
|
||||
) : (
|
||||
<Typography>{title}</Typography>
|
||||
<Text>{title}</Text>
|
||||
);
|
||||
|
||||
const handleClick = () => {
|
||||
|
@ -98,9 +98,9 @@ export default function ToDoItem (props) {
|
|||
<div className="ToDoSidebarItem__Title">
|
||||
{titleComponent}
|
||||
</div>
|
||||
<Typography color="secondary" size="small" weight="bold" lineHeight="fit">
|
||||
<Text color="secondary" size="small" weight="bold" lineHeight="fit">
|
||||
{getContextShortName(props.courses, props.courseId)}
|
||||
</Typography>
|
||||
</Text>
|
||||
<List variant="pipe">
|
||||
{getInformationRow(props.dueAt, props.points)}
|
||||
</List>
|
||||
|
|
|
@ -22,12 +22,12 @@ import { func, arrayOf, object, bool, string } from 'prop-types';
|
|||
import moment from 'moment-timezone';
|
||||
|
||||
import I18n from 'i18n!todo_sidebar';
|
||||
import Heading from 'instructure-ui/lib/components/Heading';
|
||||
import List from 'instructure-ui/lib/components/List';
|
||||
import ListItem from 'instructure-ui/lib/components/List/ListItem';
|
||||
import Container from 'instructure-ui/lib/components/Container';
|
||||
import Spinner from 'instructure-ui/lib/components/Spinner';
|
||||
import ButtonLink from 'instructure-ui/lib/components/Link';
|
||||
import Heading from '@instructure/ui-core/lib/components/Heading';
|
||||
import List from '@instructure/ui-core/lib/components/List';
|
||||
import ListItem from '@instructure/ui-core/lib/components/List/ListItem';
|
||||
import Container from '@instructure/ui-core/lib/components/Container';
|
||||
import Spinner from '@instructure/ui-core/lib/components/Spinner';
|
||||
import ButtonLink from '@instructure/ui-core/lib/components/Link';
|
||||
|
||||
import { loadInitialItems, completeItem } from './actions';
|
||||
import ToDoItem from './ToDoItem';
|
||||
|
|
|
@ -121,11 +121,11 @@ test('renders the title as a Link when given an href prop', () => {
|
|||
equal(link.text(), 'Introduction to Board Games');
|
||||
});
|
||||
|
||||
test('renders out the title as a Typography when not given an href prop', () => {
|
||||
test('renders out the title as a Text when not given an href prop', () => {
|
||||
const wrapper = mount(
|
||||
<ToDoItem {...getDefaultProps()} />
|
||||
);
|
||||
const title = wrapper.find('.ToDoSidebarItem__Title').find('Typography').first();
|
||||
const title = wrapper.find('.ToDoSidebarItem__Title').find('Text').first();
|
||||
ok(title.exists());
|
||||
equal(title.text(), 'Introduction to Board Games');
|
||||
});
|
||||
|
|
|
@ -20,7 +20,7 @@ import { ToDoSidebar } from 'jsx/dashboard/ToDoSidebar';
|
|||
import { shallow, mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
|
||||
import ButtonLink from 'instructure-ui/lib/components/Link';
|
||||
import ButtonLink from '@instructure/ui-core/lib/components/Link';
|
||||
|
||||
QUnit.module('ToDoSidebar Index');
|
||||
|
||||
|
|
Loading…
Reference in New Issue