instUI5 upgrade: account_course_user_search stuff

refs: CORE-1437

This commit just upgrades these components to use instUI 5 instead of
getting them from ui-core in instUI 4.

It is mostly just path renaming.

Test plan:
* verify these components still work as they used to and tests pass

Change-Id: I80372c8e4bb733064f06ef6ee7199cac6870ae65
Reviewed-on: https://gerrit.instructure.com/151767
Tested-by: Jenkins
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Product-Review: Ryan Shaw <ryan@instructure.com>
QA-Review: Ryan Shaw <ryan@instructure.com>
This commit is contained in:
Ryan Shaw 2018-05-07 13:20:07 -06:00
parent f9676125bb
commit 39129a7496
17 changed files with 44 additions and 47 deletions

View File

@ -21,8 +21,8 @@ import {string, shape, arrayOf, func} from 'prop-types'
import I18n from 'i18n!account_course_user_search'
import CoursesListRow from './CoursesListRow'
import CoursesListHeader from './CoursesListHeader'
import Table from '@instructure/ui-core/lib/components/Table'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import Table from '@instructure/ui-elements/lib/components/Table'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
export default function CoursesList(props) {
// The 'sis_course_id' field is only included in the api response if the user has

View File

@ -18,9 +18,9 @@
import IconMiniArrowUp from '@instructure/ui-icons/lib/Solid/IconMiniArrowUp'
import IconMiniArrowDown from '@instructure/ui-icons/lib/Solid/IconMiniArrowDown'
import ApplyTheme from '@instructure/ui-core/lib/components/ApplyTheme'
import Link from '@instructure/ui-core/lib/components/Link'
import Tooltip from '@instructure/ui-core/lib/components/Tooltip'
import ApplyTheme from '@instructure/ui-themeable/lib/components/ApplyTheme'
import Link from '@instructure/ui-elements/lib/components/Link'
import Tooltip from '@instructure/ui-overlays/lib/components/Tooltip'
import React from 'react'
import {string} from 'prop-types'
import {pick} from 'lodash'

View File

@ -18,9 +18,9 @@
import React from 'react'
import {number, string, shape, arrayOf, bool} from 'prop-types'
import Button from '@instructure/ui-core/lib/components/Button'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import Tooltip from '@instructure/ui-core/lib/components/Tooltip'
import Button from '@instructure/ui-buttons/lib/components/Button'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import Tooltip from '@instructure/ui-overlays/lib/components/Tooltip'
import IconBlueprintLine from '@instructure/ui-icons/lib/Line/IconBlueprint'
import IconPlusLine from '@instructure/ui-icons/lib/Line/IconPlus'
import IconSettingsLine from '@instructure/ui-icons/lib/Line/IconSettings'

View File

@ -20,7 +20,7 @@ import React from 'react'
import {shape, arrayOf, string, func} from 'prop-types'
import {debounce} from 'underscore'
import I18n from 'i18n!account_course_user_search'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import CoursesStore from '../store/CoursesStore'
import TermsStore from '../store/TermsStore'
import AccountsTreeStore from '../store/AccountsTreeStore'

View File

@ -20,12 +20,12 @@ import React from 'react'
import {arrayOf, string, bool, func, shape, oneOf} from 'prop-types'
import {isEqual, groupBy, map} from 'lodash'
import IconPlusLine from '@instructure/ui-icons/lib/Line/IconPlus'
import Button from '@instructure/ui-core/lib/components/Button'
import Checkbox from '@instructure/ui-core/lib/components/Checkbox'
import Grid, {GridCol, GridRow} from '@instructure/ui-core/lib/components/Grid'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import Button from '@instructure/ui-buttons/lib/components/Button'
import Checkbox from '@instructure/ui-forms/lib/components/Checkbox'
import Grid, {GridCol, GridRow} from '@instructure/ui-layout/lib/components/Grid'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import Select from '@instructure/ui-core/lib/components/Select'
import TextInput from '@instructure/ui-core/lib/components/TextInput'
import TextInput from '@instructure/ui-forms/lib/components/TextInput'
import I18n from 'i18n!account_course_user_search'
import preventDefault from 'compiled/fn/preventDefault'
import {propType as termsPropType} from '../store/TermsStore'

View File

@ -18,9 +18,9 @@
import React from 'react'
import {node} from 'prop-types'
import Button from '@instructure/ui-core/lib/components/Button'
import FormFieldGroup from '@instructure/ui-core/lib/components/FormFieldGroup'
import TextInput from '@instructure/ui-core/lib/components/TextInput'
import Button from '@instructure/ui-buttons/lib/components/Button'
import FormFieldGroup from '@instructure/ui-forms/lib/components/FormFieldGroup'
import TextInput from '@instructure/ui-forms/lib/components/TextInput'
import Select from '@instructure/ui-core/lib/components/Select'
import InstuiModal, {ModalBody, ModalFooter} from '../../shared/components/InstuiModal'

View File

@ -17,8 +17,8 @@
*/
import React, { Component } from 'react'
import Pagination, {PaginationButton} from '@instructure/ui-core/lib/components/Pagination'
import Spinner from '@instructure/ui-core/lib/components/Spinner'
import Pagination, {PaginationButton} from '@instructure/ui-pagination/lib/components/Pagination'
import Spinner from '@instructure/ui-elements/lib/components/Spinner'
import { array, func, string, shape, oneOf } from 'prop-types'
import I18n from 'i18n!account_course_user_search'
import Alert from '@instructure/ui-alerts/lib/components/Alert'
@ -140,6 +140,7 @@ export default class SearchMessage extends Component {
<div>
{this.renderSearchDoneAlert(collection.loading, resultsFoundMessage)}
<Pagination
as="nav"
variant="compact"
labelNext={I18n.t('Next Page')}
labelPrev={I18n.t('Previous Page')}

View File

@ -17,8 +17,8 @@
*/
import React from 'react'
import Avatar from '@instructure/ui-core/lib/components/Avatar'
import Link from '@instructure/ui-core/lib/components/Link'
import Avatar from '@instructure/ui-elements/lib/components/Avatar'
import Link from '@instructure/ui-elements/lib/components/Link'
export default function UserLink({size, avatar_url, name, ...propsToPassOnToLink}) {
return (

View File

@ -16,8 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import Table from '@instructure/ui-core/lib/components/Table'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import Table from '@instructure/ui-elements/lib/components/Table'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import React from 'react'
import {arrayOf, string, object, func} from 'prop-types'
import I18n from 'i18n!account_course_user_search'

View File

@ -18,11 +18,11 @@
import React from 'react'
import { string, func, shape } from 'prop-types'
import ApplyTheme from '@instructure/ui-core/lib/components/ApplyTheme'
import Tooltip from '@instructure/ui-core/lib/components/Tooltip'
import ApplyTheme from '@instructure/ui-themeable/lib/components/ApplyTheme'
import Tooltip from '@instructure/ui-overlays/lib/components/Tooltip'
import IconMiniArrowUp from '@instructure/ui-icons/lib/Solid/IconMiniArrowUp'
import IconMiniArrowDown from '@instructure/ui-icons/lib/Solid/IconMiniArrowDown'
import Link from '@instructure/ui-core/lib/components/Link'
import Link from '@instructure/ui-elements/lib/components/Link'
import preventDefault from 'compiled/fn/preventDefault'
export default function UsersListHeader(props) {

View File

@ -18,8 +18,8 @@
import React from 'react'
import {string, func, shape, bool} from 'prop-types'
import Button from '@instructure/ui-core/lib/components/Button'
import Tooltip from '@instructure/ui-core/lib/components/Tooltip'
import Button from '@instructure/ui-buttons/lib/components/Button'
import Tooltip from '@instructure/ui-overlays/lib/components/Tooltip'
import IconMasqueradeLine from '@instructure/ui-icons/lib/Line/IconMasquerade'
import IconMessageLine from '@instructure/ui-icons/lib/Line/IconMessage'
import IconEditLine from '@instructure/ui-icons/lib/Line/IconEdit'
@ -46,7 +46,7 @@ export default function UsersListRow({accountId, user, permissions, handleSubmit
{permissions.can_masquerade && (
<Tooltip tip={I18n.t('Act as %{name}', {name: user.name})}>
<Button variant="icon" size="small" href={`/users/${user.id}/masquerade`}>
<IconMasqueradeLine height="1.5em" title={I18n.t('Act as %{name}', {name: user.name})} />
<IconMasqueradeLine title={I18n.t('Act as %{name}', {name: user.name})} />
</Button>
</Tooltip>
)}
@ -57,7 +57,7 @@ export default function UsersListRow({accountId, user, permissions, handleSubmit
size="small"
href={`/conversations?user_name=${user.name}&user_id=${user.id}`}
>
<IconMessageLine height="1.5em" title={I18n.t('Send message to %{name}', {name: user.name})} />
<IconMessageLine title={I18n.t('Send message to %{name}', {name: user.name})} />
</Button>
</Tooltip>
)}

View File

@ -20,7 +20,7 @@ import React from 'react'
import {shape, func, arrayOf, string} from 'prop-types'
import I18n from 'i18n!account_course_user_search'
import _ from 'underscore'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import UsersList from './UsersList'
import UsersToolbar from './UsersToolbar'
import SearchMessage from './SearchMessage'

View File

@ -23,14 +23,14 @@ import IconMoreLine from '@instructure/ui-icons/lib/Line/IconMore'
import IconPlusLine from '@instructure/ui-icons/lib/Line/IconPlus'
import IconStudentViewLine from '@instructure/ui-icons/lib/Line/IconStudentView'
import Button from '@instructure/ui-core/lib/components/Button'
import FormFieldGroup from '@instructure/ui-core/lib/components/FormFieldGroup'
import {GridCol} from '@instructure/ui-core/lib/components/Grid'
import Button from '@instructure/ui-buttons/lib/components/Button'
import FormFieldGroup from '@instructure/ui-forms/lib/components/FormFieldGroup'
import {GridCol} from '@instructure/ui-layout/lib/components/Grid'
import Menu, { MenuItem } from '@instructure/ui-menu/lib/components/Menu'
import ScreenReaderContent from '@instructure/ui-core/lib/components/ScreenReaderContent'
import ScreenReaderContent from '@instructure/ui-a11y/lib/components/ScreenReaderContent'
import Select from '@instructure/ui-core/lib/components/Select'
import TextInput from '@instructure/ui-core/lib/components/TextInput'
import TextInput from '@instructure/ui-forms/lib/components/TextInput'
import I18n from 'i18n!account_course_user_search'
import preventDefault from 'compiled/fn/preventDefault'

View File

@ -132,14 +132,14 @@ describe('Account Course User Search CoursesList Sorting', () => {
expect(wrapper.find('IconMiniArrowUp')).toHaveLength(0)
const downArrow = wrapper.find('IconMiniArrowDown')
expect(downArrow).toHaveLength(1)
const header = downArrow.closest('th')
const header = downArrow.closest('CourseListHeader')
const expectedTip = {
course_name: 'Click to sort by name descending',
total_students: 'Click to sort by number of students descending'
}[columnID] || `Click to sort by ${label} descending`
expect(header.text()).toMatch(RegExp(expectedTip, 'i'))
expect(header.find('Tooltip').prop('tip')).toMatch(RegExp(expectedTip, 'i'))
expect(header.text()).toMatch(label)
})
@ -153,14 +153,14 @@ describe('Account Course User Search CoursesList Sorting', () => {
expect(wrapper.find('IconMiniArrowDown')).toHaveLength(0)
const upArrow = wrapper.find('IconMiniArrowUp')
expect(upArrow).toHaveLength(1)
const header = upArrow.closest('th')
const header = upArrow.closest('CourseListHeader')
const expectedTip = {
course_name: 'Click to sort by name ascending',
total_students: 'Click to sort by number of students ascending'
}[columnID] || `Click to sort by ${label} ascending`
expect(header.text()).toMatch(RegExp(expectedTip, 'i'))
expect(header.find('Tooltip').prop('tip')).toMatch(RegExp(expectedTip, 'i'))
expect(header.text()).toMatch(label)
})

View File

@ -102,7 +102,7 @@ Object.entries({
const icons = wrapper.find(`IconMiniArrow${expectedArrow}`)
equal(icons.length, 1, `only one ${expectedArrow} arrow`)
const header = icons.closest('UsersListHeader')
ok(header.find('ScreenReaderContent').text().match(RegExp(expectedTip, 'i')), 'has right tooltip')
ok(header.find('Tooltip').prop('tip').match(RegExp(expectedTip, 'i')), 'has right tooltip')
ok(header.text().includes(label), `${label} is the one that has the ${expectedArrow} arrow`)
})

View File

@ -76,13 +76,11 @@ describe "new account course search" do
expect(f('[data-automation="courses list"]')).not_to include_text("course 16")
expect(f("#content")).not_to contain_css('button[title="Previous Page"]')
f('button[title="Next Page"]').click
fj('nav button:contains("2")').click
wait_for_ajaximations
expect(get_rows.count).to eq 1
expect(get_rows.first).to include_text("course 16")
expect(f("#content")).to contain_css('button[title="Previous Page"]')
expect(f("#content")).not_to contain_css('button[title="Next Page"]')
end
it "should search by term", test_id: 3454772, priority: 1 do

View File

@ -156,15 +156,13 @@ describe "new account user search" do
expect(f("[data-automation='users list']")).to_not include_text("Test User O")
expect(f("#content")).not_to contain_css('button[title="Previous Page"]')
f('button[title="Next Page"]').click
fj('nav button:contains("2")').click
wait_for_ajaximations
expect(get_rows.count).to eq 12
expect(get_rows.first).to include_text("Test User O")
expect(get_rows.last).to include_text("Test User Z")
expect(f("[data-automation='users list']")).not_to include_text("Test User A")
expect(f("#content")).to contain_css('button[title="Previous Page"]')
expect(f("#content")).not_to contain_css('button[title="Next Page"]')
end
it "should search by name" do