fix references to renamed JS imports
fixes ADMIN-2256 test plan: - In a course, create 2 modules and add some items to each - use "Move Module" and "Move Contents" a few times - use "Move To" to be sure it still works too - When a module is empty (no contents), clicking 'Move Contents' option doesn't throw a JS console error. (it did before). Change-Id: Ia0ad37fdd4076e74501f64023a6da3558af9c913 Reviewed-on: https://gerrit.instructure.com/172920 Tested-by: Jenkins Reviewed-by: Ed Schiebel <eschiebel@instructure.com> QA-Review: Anju Reddy <areddy@instructure.com> Product-Review: Carl Kibler <ckibler@instructure.com>
This commit is contained in:
parent
4c884e548e
commit
ae4251d48a
|
@ -179,8 +179,8 @@ export default class MoveSelect extends React.Component {
|
|||
I18n.t('Place') :
|
||||
I18n.t('Place "%{title}"', { title: this.props.items[0].title })
|
||||
return (
|
||||
<Text paragraphMargin="medium 0" weight="bold">{title}</Text>
|
||||
);
|
||||
<Text weight='bold'>{title}</Text>
|
||||
)
|
||||
}
|
||||
|
||||
render () {
|
||||
|
@ -188,7 +188,7 @@ export default class MoveSelect extends React.Component {
|
|||
return (
|
||||
<div className="move-select">
|
||||
{this.props.moveOptions.groupsLabel &&
|
||||
<Text paragraphMargin="medium 0" weight="bold">{this.props.moveOptions.groupsLabel}</Text>}
|
||||
<Text weight='bold'>{this.props.moveOptions.groupsLabel}</Text>}
|
||||
{groups
|
||||
? this.renderSelectGroup()
|
||||
: this.renderSelectPosition(siblings)}
|
||||
|
|
|
@ -1305,13 +1305,13 @@ function scrollTo ($thing, time = 500) {
|
|||
formatSaveUrl: () => `${ENV.CONTEXT_URL_ROOT}/modules/reorder`,
|
||||
onMoveSuccess: res => {
|
||||
const container = document.querySelector('#context_modules.ui-sortable')
|
||||
MoveItem.reorderElements(res.data.map(item => item.context_module.id), container, (id) => `#context_module_${id}`)
|
||||
reorderElements(res.data.map(item => item.context_module.id), container, (id) => `#context_module_${id}`)
|
||||
$(container).sortable('refresh')
|
||||
},
|
||||
focusOnExit: () => currentModule.querySelector('.al-trigger'),
|
||||
}
|
||||
|
||||
MoveItem.renderTray(moveTrayProps, document.getElementById('not_right_side'))
|
||||
renderTray(moveTrayProps, document.getElementById('not_right_side'))
|
||||
})
|
||||
|
||||
$('.move_module_contents_link').on('click keyclick', function (event) {
|
||||
|
@ -1334,6 +1334,9 @@ function scrollTo ($thing, time = 500) {
|
|||
id: item.getAttribute('id').substring('context_module_item_'.length),
|
||||
title: item.querySelector('.title').textContent.trim(),
|
||||
}))
|
||||
if (items.length === 0) {
|
||||
return
|
||||
}
|
||||
items[0].groupId = currentModule.getAttribute('id').substring('context_module_'.length)
|
||||
|
||||
const moveTrayProps = {
|
||||
|
@ -1355,14 +1358,14 @@ function scrollTo ($thing, time = 500) {
|
|||
})
|
||||
|
||||
const order = data.context_module.content_tags.map(item => item.content_tag.id)
|
||||
MoveItem.reorderElements(order, $container[0], id => `#context_module_item_${id}`)
|
||||
reorderElements(order, $container[0], id => `#context_module_item_${id}`)
|
||||
|
||||
$container.sortable('enable').sortable('refresh')
|
||||
},
|
||||
focusOnExit: () => currentModule.querySelector('.al-trigger'),
|
||||
}
|
||||
|
||||
MoveItem.renderTray(moveTrayProps, document.getElementById('not_right_side'))
|
||||
renderTray(moveTrayProps, document.getElementById('not_right_side'))
|
||||
})
|
||||
|
||||
$('.drag_and_drop_warning').on('focus', function (event) {
|
||||
|
|
Loading…
Reference in New Issue