Skip to content

Commit

Permalink
import lodash wherever '_' is referenced
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Kong committed Dec 13, 2023
1 parent adef4ca commit 3463465
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { ArchivedButton, hashToCollection, } from '../../../Shared/index';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react'
import { connect } from 'react-redux'
import { ArchivedButton, hashToCollection, } from '../../../Shared/index'
import { QuestionList } from '../shared/questionList'
import _ from 'lodash';
import React from 'react';
import { connect } from 'react-redux';
import { ArchivedButton, hashToCollection, } from '../../../Shared/index';
import { QuestionList } from '../shared/questionList';

class SentenceFragments extends React.Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import C from '../constants';

const initialState = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import React from 'react';
import { FlagDropdown } from '../../../Shared/index';
import ConceptSelector from '../shared/conceptSelector.jsx';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'

import { ArchivedButton, hashToCollection, } from '../../../Shared/index'
import { QuestionList } from '../shared/questionList'
import _ from 'lodash';
import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { ArchivedButton, hashToCollection, } from '../../../Shared/index';
import { QuestionList } from '../shared/questionList';

class SentenceFragments extends React.Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import C from '../constants';

const initialState = {
selectedResponses: [],
numSelectedResponses: 0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ContentState, EditorState } from 'draft-js';
import _ from 'lodash';
import * as React from 'react';
import { connect } from 'react-redux';
import SelectSearch from 'react-select-search';

import { SortableList, TextEditor, hashToCollection, } from '../../../Shared/index';
import { Concept, Concepts } from '../../interfaces/grammarActivities';
import { Question } from '../../interfaces/questions';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import * as React from 'react';
import ConceptSelectorWithCheckbox from '../shared/conceptSelectorWithCheckbox';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash'
import * as React from 'react'
import { hashToCollection } from '../../../Shared/index'
import { Concept } from '../../interfaces/concepts'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _ from 'lodash';
import { Action } from "redux";
import { ActionTypes } from "../actions/actionTypes";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as React from 'react'
import * as React from 'react';

import useSnackbarMonitor from '../../../../Shared/hooks/useSnackbarMonitor'
import { Snackbar, defaultSnackbarTimeout, } from '../../../../Shared/index'

import { requestGet, requestPut, } from '../../../../../modules/request/index'
import CustomActivityPackPage from '../../../../Teacher/components/assignment_flow/create_unit/custom_activity_pack/index'
import _ from 'lodash';
import { requestGet, requestPut, } from '../../../../../modules/request/index';
import useSnackbarMonitor from '../../../../Shared/hooks/useSnackbarMonitor';
import { Snackbar, defaultSnackbarTimeout, } from '../../../../Shared/index';
import CustomActivityPackPage from '../../../../Teacher/components/assignment_flow/create_unit/custom_activity_pack/index';

const ActivityCategories = () => {
const [activityCategories, setActivityCategories] = React.useState([])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

import Units from './manage_units/units';

import _ from 'lodash';
import { requestGet, } from '../../../../modules/request';
import ItemDropdown from '../general_components/dropdown_selectors/item_dropdown';
import { PROGRESS_REPORTS_SELECTED_CLASSROOM_ID, } from '../progress_reports/progress_report_constants';
import LoadingIndicator from '../shared/loading_indicator';
import Units from './manage_units/units';

export default class ClassroomLessons extends React.Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import React from 'react';

import Stage1 from './select_activities_container';
import ShareToStudents from './share_activity_pack/shareToStudents';
import Stage2 from './stage2/Stage2';
import UnitAssignmentFollowup from './unit_assignment_followup.tsx';

import _ from 'lodash';
import { requestGet, requestPost, } from '../../../../../modules/request';
import {
ACTIVITY_IDS_ARRAY,
Expand All @@ -16,6 +12,10 @@ import {
UNIT_TEMPLATE_NAME
} from '../assignmentFlowConstants';
import parsedQueryParams from '../parsedQueryParams';
import Stage1 from './select_activities_container';
import ShareToStudents from './share_activity_pack/shareToStudents';
import Stage2 from './stage2/Stage2';
import UnitAssignmentFollowup from './unit_assignment_followup.tsx';

export default class CreateUnit extends React.Component {
constructor(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import _l from 'lodash'
import _ from 'lodash'
import React from 'react'
import { Link } from 'react-router-dom'
import _ from 'underscore'

import UnitTemplateMini from './unit_template_mini'
import UnitTemplateMinisTable from './unitTemplateMinisTable'
Expand Down Expand Up @@ -48,7 +47,7 @@ export default class UnitTemplateMinis extends React.Component {
if (models && models.length) {
models.push({id: 'createYourOwn', non_authenticated: non_authenticated, unit_template_category: null });
}
return _l.uniqBy(models, 'id');
return _.uniqBy(models, 'id');
}

generateCategoryOptions(gradeLevel, selectedTypeId) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _l from 'lodash'
import qs from 'qs'
import React from 'react'
import _ from 'underscore'
Expand Down Expand Up @@ -59,7 +58,7 @@ export default class UnitTemplatesManager extends React.Component {

setTeacher(data) {
this.setState({
signedInTeacher: !_l.isEmpty(data)
signedInTeacher: !_.isEmpty(data)
})
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import _ from 'lodash';
import React from 'react';
import TextInputGenerator from '../../modules/componentGenerators/text_input_generator.jsx';
import NestedResource from '../../modules/nested_resource.jsx';
import Server from '../../modules/server/server.jsx';
import CmsNestedResource from './nestedResource.jsx';

export default class Resource extends React.Component {
constructor(props, context) {
super(props, context);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import _l from 'lodash'
import React from 'react'
import { CSVLink } from 'react-csv'
import _ from 'underscore'
Expand Down Expand Up @@ -34,7 +33,7 @@ export class CSVDownloadForProgressReport extends React.Component {
getRidOfCamelCase(row){
const keys = Object.keys(row)
keys.forEach(oldKey=>{
const newKey = _l.startCase(oldKey)
const newKey = _.startCase(oldKey)
row[newKey] = row[oldKey];
delete row[oldKey];
})
Expand Down

0 comments on commit 3463465

Please sign in to comment.