replace use of underscore shim in wiki pages

Change-Id: I2c203127168870f7b82edfd33fa19c2eaa2f94f9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/336055
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Michael Hulse <michael.hulse@instructure.com>
QA-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Aaron Shafovaloff <ashafovaloff@instructure.com>
This commit is contained in:
Aaron Shafovaloff 2023-12-30 08:33:24 -05:00
parent a3b0701c8e
commit 7f189d47c4
4 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU Affero General Public License along
// with this program. If not, see <http://www.gnu.org/licenses/>.
import _ from 'underscore'
import {extend, pick} from 'lodash'
import PaginatedCollection from '@canvas/pagination/backbone/collections/PaginatedCollection'
import WikiPageRevision from '@canvas/wiki/backbone/models/WikiPageRevision'
@ -28,7 +28,7 @@ export default class WikiPageRevisionsCollection extends PaginatedCollection {
initialize(models, options) {
super.initialize(...arguments)
_.extend(this, _.pick(options || {}, revisionOptions))
extend(this, pick(options || {}, revisionOptions))
if (this.parentModel) {
const collection = this

View File

@ -16,7 +16,7 @@
// with this program. If not, see <http://www.gnu.org/licenses/>.
import $ from 'jquery'
import _ from 'underscore'
import {clone} from 'lodash'
import Backbone from '@canvas/backbone'
import template from '../../jst/WikiPageContent.handlebars'
import {publish} from 'jquery-tinypubsub'
@ -90,7 +90,7 @@ export default class WikiPageContentView extends Backbone.View {
json.CAN.ACCESS_GEAR_MENU
if (json.lock_info) {
json.lock_info = _.clone(json.lock_info)
json.lock_info = clone(json.lock_info)
}
if (json.lock_info != null ? json.lock_info.unlock_at : undefined) {
json.lock_info.unlock_at =

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU Affero General Public License along
// with this program. If not, see <http://www.gnu.org/licenses/>.
import _ from 'underscore'
import {each} from 'lodash'
import CollectionView from '@canvas/backbone-collection-view'
import WikiPageRevisionView from './WikiPageRevisionView'
import template from '../../jst/WikiPageRevisions.handlebars'
@ -70,7 +70,7 @@ export default class WikiPageRevisionsView extends CollectionView {
remove() {
if (this.floatingSticky) {
_.each(this.floatingSticky, sticky => sticky.remove())
each(this.floatingSticky, sticky => sticky.remove())
this.floatingSticky = null
}
@ -126,7 +126,7 @@ export default class WikiPageRevisionsView extends CollectionView {
reposition() {
if (this.floatingSticky) {
return _.each(this.floatingSticky, sticky => sticky.reposition())
each(this.floatingSticky, sticky => sticky.reposition())
}
}

View File

@ -20,7 +20,7 @@ import ReactDOM from 'react-dom'
import $ from 'jquery'
import 'jquery-scroll-to-visible'
import * as tz from '@canvas/datetime'
import _ from 'underscore'
import {clone, each} from 'lodash'
import Backbone from '@canvas/backbone'
import template from '../../jst/WikiPage.handlebars'
import StickyHeaderMixin from '@canvas/wiki/backbone/views/StickyHeaderMixin'
@ -307,7 +307,7 @@ export default class WikiPageView extends Backbone.View {
json.explicit_latex_typesetting = !!ENV.FEATURES?.explicit_latex_typesetting
if (json.lock_info) {
json.lock_info = _.clone(json.lock_info)
json.lock_info = clone(json.lock_info)
}
if (json.lock_info != null ? json.lock_info.unlock_at : undefined) {
json.lock_info.unlock_at =
@ -322,7 +322,7 @@ export default class WikiPageView extends Backbone.View {
}
json.wiki_page_menu_tools = ENV.wiki_page_menu_tools
_.each(json.wiki_page_menu_tools, tool => {
each(json.wiki_page_menu_tools, tool => {
tool.url = `${tool.base_url}&pages[]=${this.model.get('page_id')}`
})
json.frontPageText = ENV.K5_SUBJECT_COURSE ? I18n.t('Subject Home') : I18n.t('Front Page')