Skip to content

Commit

Permalink
Jkmarx/update lodash dependency v2 (#3438)
Browse files Browse the repository at this point in the history
* Update how .has checks for keys.

* Remove migrate references.
  • Loading branch information
jkmarx committed Sep 3, 2019
1 parent ba35f44 commit 8b12cb3
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 28 deletions.
8 changes: 1 addition & 7 deletions refinery/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,10 @@
<script src="{% static "vendor/angular-file-model/angular-file-model.js" %}"></script>
<script src="{% static "vendor/angular-messages/angular-messages.min.js" %}"></script>
<script src="{% static "vendor/filesize/lib/filesize.js" %}"></script>
<script src="{% static "vendor/lodash/index.js" %}"></script>
<script src="{% static "vendor/lodash-migrate/dist/lodash-migrate.min.js" %}"></script>
<script src="{% static "vendor/lodash/lodash.js" %}"></script>
<script src="{% static "vendor/markdown/lib/markdown.js" %}"></script>
<script src="{% static "vendor/chart.js/dist/Chart.min.js" %}"></script>
<script src="https://www.youtube.com/iframe_api"></script>
<script type="text/javascript">
// Assign lodash v3.9.3 to a special variable so it doesn't conflict with
// lodash v2 or other libraries like underscore.
window.lodashLatest = _.noConflict();
</script>

<script src="{% static "vendor/d3/d3.min.js" %}"></script>
<script src="{% static "vendor/d3-tip/index.js" %}"></script>
Expand Down
4 changes: 0 additions & 4 deletions refinery/ui/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,6 @@ module.exports = function (grunt) {
pattern: 'node_modules/angular-mocks/angular-mocks.js',
watched: false
}],
[{
pattern: './karma.lodash.noConflict.js',
watched: false
}],
'node_modules/phantomjs-polyfill/bind-polyfill.js',
jsFilesByImportance(true),
config.basePath.ui.src + '/**/*.html'
Expand Down
3 changes: 1 addition & 2 deletions refinery/ui/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
"blueimp-file-upload/js/jquery.iframe-transport.js",
"blueimp-file-upload/js/jquery.fileupload-process.js",
"jquery-mousewheel/jquery.mousewheel.js",
"lodash/index.js",
"lodash-migrate/dist/lodash-migrate.min.js",
"lodash/lodash.js",
"angular-ui-grid/ui-grid.min.js",
"spark-md5/spark-md5.min.js",
"spectrum-colorpicker/spectrum.js",
Expand Down
5 changes: 2 additions & 3 deletions refinery/ui/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function(config) {

client: {
// Set to `true` if `console.log()` should be captured.
captureConsole: false
captureConsole: true
},

// frameworks to use
Expand All @@ -25,8 +25,7 @@ module.exports = function(config) {


// list of files to exclude
exclude: [
],
exclude: [],


// preprocess matching files before serving them to the browser
Expand Down
1 change: 0 additions & 1 deletion refinery/ui/karma.lodash.noConflict.js

This file was deleted.

9 changes: 4 additions & 5 deletions refinery/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"jquery": "2.1.1",
"blueimp-file-upload": "9.18.0",
"jquery-mousewheel": "3.1.13",
"lodash": "3.10.1",
"lodash-migrate": "0.2.6",
"lodash": "4.17.15",
"markdown": "0.5.0",
"ng-file-upload": "12.2.13",
"select2": "3.5.1",
Expand All @@ -70,15 +69,15 @@
"grunt-env": "0.4.4",
"grunt-eslint": "18.0.0",
"grunt-jsdoc": "2.2.0",
"grunt-karma": "1.0.0",
"grunt-karma": "3.0.2",
"grunt-newer": "1.2.0",
"grunt-ng-annotate": "2.0.1",
"hasbin": "1.1.1",
"isbinaryfile": "3.0.0",
"jasmine-core": "2.3.4",
"karma": "0.13.22",
"karma": "4.3.0",
"karma-chrome-launcher": "0.2.2",
"karma-coverage": "0.5.5",
"karma-coverage": "2.0.1",
"karma-firefox-launcher": "0.1.6",
"karma-jasmine": "0.3.6",
"karma-ng-html2js-preprocessor": "0.2.0",
Expand Down
5 changes: 2 additions & 3 deletions refinery/ui/source/js/globals/services/lodash-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
* Lodash Latest Constant
* @namespace refineryApp
* @desc Issue with adding the lodash-latest from the window object to the
* refinery-library due to script run time. Removable when we upgrade our
* lodash/underscore syntax.
* refinery-library due to script run time.
* @memberOf refineryApp.lodashLatest
*/
(function () {
'use strict';

angular
.module('lodashLatest', [])
.constant('_', window.lodashLatest);
.constant('_', window._);
})();
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
}
// checkbox selected
if (selectionObj[vm.currentGroup][inputTypeUuid][nodeUuid]) {
if (_.has(vm.groupCollection, vm.currentGroup) === false) {
if (_.has(vm.groupCollection, vm.currentGroup.toString()) === false) {
// intialize groupCollection[groupId]
vm.groupCollection[vm.currentGroup] = {};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,14 @@
function checkNeedMoreNodes () {
var moreFlag = false;
var groupType = fileService.currentTypes[fileService.currentTypes.length - 1];
if (!_.property(fileService.currentGroup)(fileService.groupCollection)) {
var groupCollectionKeys = _.keys(fileService.groupCollection);
var strCurrentGroup = fileService.currentGroup.toString();

if (groupCollectionKeys.indexOf(strCurrentGroup) < 0) {
moreFlag = true;
} else if (groupType === 'PAIR') {
// pair, requires 2 inputTypes
var inputLength = _.keys(fileService.groupCollection[fileService.currentGroup]).length;
var inputLength = _.keys(fileService.groupCollection[strCurrentGroup]).length;
if (inputLength > 1) {
moreFlag = areInputFileTypesEmpty();
} else {
Expand Down

0 comments on commit 8b12cb3

Please sign in to comment.