Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Application from '@ember/application';
import loadInitializers from 'ember-load-initializers';
import Resolver from 'ember-resolver';
import $ from 'jquery';
import _ from 'lodash';
import * as _ from 'lodash-es';
import config from './config/environment';

// export for others scripts to use
Expand Down
2 changes: 1 addition & 1 deletion app/components/answer-new.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ErrorHandlingComponent from './error-handling';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import isEqual from 'lodash/isEqual';
import isEqual from 'lodash-es/isEqual';
import { service } from '@ember/service';
import validate from 'validate.js';
import $ from 'jquery';
Expand Down
6 changes: 3 additions & 3 deletions app/components/bread-crumbs-item.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Component from '@glimmer/component';
import { action } from '@ember/object';
import moment from 'moment';
import isEqual from 'lodash/isEqual';
import isString from 'lodash/isString';
import isObject from 'lodash/isObject';
import isEqual from 'lodash-es/isEqual';
import isString from 'lodash-es/isString';
import isObject from 'lodash-es/isObject';

export default class BreadCumbsItemComponent extends Component {
get isSelected() {
Expand Down
18 changes: 10 additions & 8 deletions app/components/comment-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import { computed } from '@ember/object';
* TODO:
* - Test the hashtag stuff to see if that is still working.
*/
/*global _:false */
import { and, equal } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import { service } from '@ember/service';
import $ from 'jquery';
import moment from 'moment';
import isArray from 'lodash-es/isArray';
import isNaN from 'lodash-es/isNaN';
import random from 'lodash-es/random';
import ErrorHandlingMixin from '../mixins/error_handling_mixin';

export default Component.extend(ErrorHandlingMixin, {
Expand Down Expand Up @@ -119,8 +121,8 @@ export default Component.extend(ErrorHandlingMixin, {
let path = `labels.${newCommentLabel}.placeholder`;
let placeholder = this.get(path);

if (_.isArray(placeholder)) {
placeholder = placeholder[_.random(0, placeholder.length - 1)];
if (isArray(placeholder)) {
placeholder = placeholder[random(0, placeholder.length - 1)];
}
return placeholder;
}),
Expand Down Expand Up @@ -340,20 +342,20 @@ export default Component.extend(ErrorHandlingMixin, {
}
let month = split[0];
let monthInt = parseInt(month, 10);
if (_.isNaN(monthInt) || monthInt > 12 || monthInt < 1) {
if (isNaN(monthInt) || monthInt > 12 || monthInt < 1) {
return false;
}
let day = split[1];
let dayInt = parseInt(day, 10);

if (_.isNaN(dayInt) || dayInt < 1 || dayInt > 31) {
if (isNaN(dayInt) || dayInt < 1 || dayInt > 31) {
return false;
}

let year = split[2];
let yearInt = parseInt(year, 10);

if (_.isNaN(yearInt) || yearInt < 1000 || yearInt > 9999) {
if (isNaN(yearInt) || yearInt < 1000 || yearInt > 9999) {
return false;
}
return true;
Expand Down Expand Up @@ -599,7 +601,7 @@ export default Component.extend(ErrorHandlingMixin, {
let dateInput = this.sinceDate;
let parsedDate = Date.parse(dateInput);

if (_.isNaN(parsedDate)) {
if (isNaN(parsedDate)) {
return this.set('invalidDateError', 'Please enter a valid date');
}
options.sinceDate = dateInput;
Expand Down
6 changes: 3 additions & 3 deletions app/components/import-work-step1.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
/*global _:false */
import { inject as service } from '@ember/service';
import isNull from 'lodash-es/isNull';
import { service } from '@ember/service';

export default Component.extend({
elementId: 'import-work-step1',
Expand All @@ -21,7 +21,7 @@ export default Component.extend({
return;
}

const isRemoval = _.isNull($item);
const isRemoval = isNull($item);
if (isRemoval) {
this.set('selectedProblem', null);
return;
Expand Down
6 changes: 3 additions & 3 deletions app/components/import-work-step2.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
/*global _:false */
import { equal } from '@ember/object/computed';
import { inject as service } from '@ember/service';
import { service } from '@ember/service';
import isNull from 'lodash-es/isNull';

export default Component.extend({
elementId: 'import-work-step2',
Expand Down Expand Up @@ -46,7 +46,7 @@ export default Component.extend({
return;
}

const isRemoval = _.isNull($item);
const isRemoval = isNull($item);
if (isRemoval) {
this.set('selectedSection', null);
return;
Expand Down
6 changes: 3 additions & 3 deletions app/components/import-work-step4.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
/*global _:false */
import { inject as service } from '@ember/service';
import { service } from '@ember/service';
import map from 'lodash-es/map';

export default Component.extend({
elementId: 'import-work-step4',
Expand All @@ -19,7 +19,7 @@ export default Component.extend({
if (!this.studentMap) {
return [];
}
return _.map(this.studentMap, (val, key) => {
return map(this.studentMap, (val, key) => {
return val;
});
}),
Expand Down
6 changes: 3 additions & 3 deletions app/components/import-work-step5.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import { equal } from '@ember/object/computed';
/*global _:false */
import { inject as service } from '@ember/service';
import { service } from '@ember/service';
import isNull from 'lodash-es/isNull';

export default Component.extend({
elementId: 'import-work-step5',
Expand Down Expand Up @@ -132,7 +132,7 @@ export default Component.extend({
this.set('createAssignmentValue', val);
},
updateSelectizeSingle(val, $item, propToUpdate, model) {
if (_.isNull($item)) {
if (isNull($item)) {
this.set(propToUpdate, null);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions app/components/problem-info.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import _isEqual from 'lodash/isEqual';
import _isNull from 'lodash/isNull';
import _isEqual from 'lodash-es/isEqual';
import _isNull from 'lodash-es/isNull';
import { service } from '@ember/service';

export default class ProblemInfoComponent extends Component {
Expand Down
2 changes: 1 addition & 1 deletion app/components/problem-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { service } from '@ember/service';
import _isNull from 'lodash/isNull';
import _isNull from 'lodash-es/isNull';

export default class ProblemNewComponent extends Component {
@service('sweet-alert') alert;
Expand Down
17 changes: 2 additions & 15 deletions app/components/search-bar.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
/*global _:false */
import { alias } from '@ember/object/computed';
import debounce from 'lodash-es/debounce';
import validate from 'validate.js';

export default Component.extend({
Expand All @@ -23,10 +23,7 @@ export default Component.extend({
let doDebounce = this.doDebounce || false;
let debounceTime = this.debounceTime || 300;
if (doDebounce) {
this.set(
'debouncedSearch',
_.debounce(this.onChangeSearch, debounceTime)
);
this.set('debouncedSearch', debounce(this.onChangeSearch, debounceTime));
}
},

Expand Down Expand Up @@ -99,17 +96,7 @@ export default Component.extend({

actions: {
clearResults: function () {
// let textVal = this.get("inputValue");
// let isString = _.isString(textVal);
// if (!isString) {
// return;
// }
// let trimmed = textVal.trim();
// if (trimmed.length === 0) {
// just empty spaces, clear out search bar but dont bubble up and fetch
this.set('inputValue', null);
// return;
// }
this.clearSearchResults();
},

Expand Down
1 change: 0 additions & 1 deletion app/components/submission-viewer-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/*global _:false */
import Component from '@ember/component';
import { computed } from '@ember/object';
import $ from 'jquery';
Expand Down
Loading
Loading