Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bower, upgrade lodash v3 to v4 #296

Merged
merged 31 commits into from
Jan 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0687788
angular bower->npm
cheapsteak Dec 22, 2016
e15de84
move more things out from bower
cheapsteak Dec 22, 2016
3d5961d
remove app/develop
cheapsteak Dec 22, 2016
339e64d
remove more things from bower
cheapsteak Dec 22, 2016
d7791fc
use npm for angular-drag-and-drop-lists
cheapsteak Jan 3, 2017
5faf4ef
remove angular-lodash (we don’t seem to be using this)
cheapsteak Jan 3, 2017
d0f6253
angular toaster css import resolution
cheapsteak Jan 3, 2017
66f977f
remove angular-underscore (doesn’t seem to be used anywhere)
cheapsteak Jan 3, 2017
9910247
move bower_components out of app/
cheapsteak Jan 3, 2017
da23ec6
remove angular-scenario from bower
cheapsteak Jan 3, 2017
acbe44a
bower Blob -> npm blob
cheapsteak Jan 3, 2017
eaf8dff
remove dep angular-lodash
cheapsteak Jan 3, 2017
8bb81d8
ui.scrollfix -> ui.scrollpoint
cheapsteak Jan 3, 2017
9e0754f
bower x2js -> npm x2js
cheapsteak Jan 3, 2017
89b250e
lodash v3 -> v4
cheapsteak Jan 3, 2017
296c3fe
remove bower
cheapsteak Jan 3, 2017
1de2e3d
remove bower from readme
cheapsteak Jan 3, 2017
f8fa7d7
fix: remove bower paths from webpack config
cheapsteak Jan 3, 2017
7dc174a
Merge branch 'develop' of github.com:icgc-dcc/dcc-portal into feature…
cheapsteak Jan 5, 2017
b682200
lodash upgrade: sortByOrder -> orderBy
cheapsteak Jan 5, 2017
dd1718a
add lodash-migrate
cheapsteak Jan 5, 2017
c1c37f1
Merge branch 'develop' of github.com:icgc-dcc/dcc-portal into feature…
cheapsteak Jan 5, 2017
f1c4fa0
make lodash-migrate work
cheapsteak Jan 5, 2017
820ecf8
have lodash-migrate logs print stack trace
cheapsteak Jan 5, 2017
4ef2bc4
lodash: sum -> sumBy, max -> maxBy
cheapsteak Jan 5, 2017
284b8be
lodash-migrate: ignore false positives from restangular
cheapsteak Jan 5, 2017
525cab9
Merge branch 'develop' into feature/dccprtl-99-debowerize
SidSyrus Jan 9, 2017
0eaa1b0
some method name changes
SidSyrus Jan 9, 2017
6007b9f
Build fix for PhantomJS failing
SidSyrus Jan 9, 2017
4a53469
Merge branch 'feature/dccprtl-99-debowerize' into feature/DCCPRTL-99-…
SidSyrus Jan 10, 2017
c1d6c6e
Merge pull request #317 from icgc-dcc/feature/DCCPRTL-99-debowerize-s…
btiernay Jan 10, 2017
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
7 changes: 0 additions & 7 deletions dcc-portal-ui/.bowerrc

This file was deleted.

3 changes: 1 addition & 2 deletions dcc-portal-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ nvm install 6
nvm use 6
```

Next, install `npm` and `bower` dependencies:
Next, install `npm` dependencies:

```shell
yarn
npm run bower
```

## Running
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/UI.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Add your ```helloworld``` module dependency to the ```scripts/app/js/app.js``` f

// angular plugins
'restangular',
'ui.scrollfix',
'ui.scrollpoint',

// More modules included here ...
'helloworld' // <--- Define your module here!
Expand Down
1 change: 0 additions & 1 deletion dcc-portal-ui/app/develop/html/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions dcc-portal-ui/app/develop/scripts/config.js

This file was deleted.

1 change: 1 addition & 0 deletions dcc-portal-ui/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,6 @@ <h1><span class="t_badge t_badge_icon" style="background: #dc322f"><i class="ico
</script>
<portal-settings></portal-settings>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://cdn.rawgit.com/lodash/lodash-migrate/master/dist/lodash-migrate.min.js"></script>
</body>
</html>
18 changes: 9 additions & 9 deletions dcc-portal-ui/app/scripts/advanced/js/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ angular.module('icgc.advanced.controllers', [
facets: facets
});
_ASDonorService.barDataTypes = HighchartsService.bar({
hits: _.map(_.sortByOrder(_ASDonorService.pieDataTypes, 'y', false), (dataType) => ({
hits: _.map(_.orderBy(_ASDonorService.pieDataTypes, 'y', false), (dataType) => ({
y: dataType.y,
name: $filter('trans')(dataType.name, 'availableDataTypes'),
term: dataType.name,
Expand All @@ -652,7 +652,7 @@ angular.module('icgc.advanced.controllers', [
facets: facets
});
_ASDonorService.barAnalysisTypes = HighchartsService.bar({
hits: _.map(_.sortByOrder(_ASDonorService.pieAnalysisTypes, 'y', false), (analysisType) => ({
hits: _.map(_.orderBy(_ASDonorService.pieAnalysisTypes, 'y', false), (analysisType) => ({
y: analysisType.y,
name: $filter('trans')(analysisType.name, 'analysisTypes'),
term: analysisType.name,
Expand All @@ -675,7 +675,7 @@ angular.module('icgc.advanced.controllers', [
delete filters.donor.id;
}
Donors
.one(_.pluck(_ASDonorService.donors.hits, 'id').join(','))
.one(_.map(_ASDonorService.donors.hits, 'id').join(','))
.handler
.one('mutations', 'counts')
.get({filters: filters})
Expand Down Expand Up @@ -802,7 +802,7 @@ angular.module('icgc.advanced.controllers', [

_ASGeneService.mutationCounts = null;

var geneIds = _.pluck(_ASGeneService.genes.hits, 'id').join(',');
var geneIds = _.map(_ASGeneService.genes.hits, 'id').join(',');
var projectCachePromise = ProjectCache.getData();


Expand Down Expand Up @@ -980,7 +980,7 @@ angular.module('icgc.advanced.controllers', [

const summarizeData = (items) => {
const count = _.size(items);
const firstItem = _.first(items);
const firstItem = _.head(items);

if (count < 2) {
return items;
Expand All @@ -989,7 +989,7 @@ angular.module('icgc.advanced.controllers', [
return {
name: `Others (${count} Consequence Types)`,
color: '#999',
y: _.sum(items, 'y'),
y: _.sumBy(items, 'y'),
type: firstItem.type,
facet: firstItem.facet,
term: _.map(items, 'name')
Expand All @@ -1001,13 +1001,13 @@ angular.module('icgc.advanced.controllers', [
return [];
}

const max = _.max (data, (item) => item.y);
const max = _.maxBy (data, (item) => item.y);
const isBelowGroupPercent = (item) => (item.y / max.y) < (2 / 100);
const separated = _.partition (data, isBelowGroupPercent);
const belowGroupPercent = _.first(separated);
const belowGroupPercent = _.head(separated);
const regular = _.last(separated);

return _.sortByOrder(regular.concat(summarizeData(belowGroupPercent)), 'y', false);
return _.orderBy(regular.concat(summarizeData(belowGroupPercent)), 'y', false);
};

function _initFacets(facets) {
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/advanced/views/advanced.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 data-ui-scrollfix=79><span class="t_badge t_badge_icon t_badge__advanced"><i class="icon-search"></i></span><translate>Advanced Search</translate></h1>
<h1 data-ui-scrollpoint=79><span class="t_badge t_badge_icon t_badge__advanced"><i class="icon-search"></i></span><translate>Advanced Search</translate></h1>
<aside class="t_sidebar">
<div class="t_tabs">
<div class="t_tabs__tab t_tabs__tab__donor" data-ng-click="AdvancedCtrl.state.setFacetTab('donor')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ <h3><translate>Mutation Occurrences</translate>
<td>{{occurrence.donorId}}</td>
<td>{{occurrence.projectId}}</td>
<td>chr{{occurrence.chromosome}}:g.{{occurrence.start}}{{occurrence.mutation}}</td>
<td>{{ (occurrence.observations | pluck:'icgcSampleId').join(',') }}</td>
<td>{{ (occurrence.observations | pluck:'matchedICGCSampleId').join(',') }}</td>
<td>{{ (occurrence.observations | pluck:'platform').join(',') }}</td>
<td>{{ (occurrence.observations | pluck:'verificationStatus').join(',') }}</td>
<td>{{ (occurrence.observations | _:"map":'icgcSampleId').join(',') }}</td>
<td>{{ (occurrence.observations | _:"map":'matchedICGCSampleId').join(',') }}</td>
<td>{{ (occurrence.observations | _:"map":'platform').join(',') }}</td>
<td>{{ (occurrence.observations | _:"map":'verificationStatus').join(',') }}</td>
</tr>
</tbody>
</table>
Expand Down
8 changes: 4 additions & 4 deletions dcc-portal-ui/app/scripts/analysis/js/analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@
* Add analysis to local storage
*/
this.addAnalysis = function(analysis, type) {
var ids = _.pluck(analysisList, 'id');
if (_.contains(ids, analysis.id) === true) {
var ids = _.map(analysisList, 'id');
if (_.includes(ids, analysis.id) === true) {
return;
}

Expand Down Expand Up @@ -303,9 +303,9 @@
};

this.remove = function(id) {
var ids = _.pluck(analysisList, 'id');
var ids = _.map(analysisList, 'id');

if (_.contains(ids, id)) {
if (_.includes(ids, id)) {
var index = ids.indexOf(id);
analysisList.splice(index, 1);
localStorageService.set(ANALYSIS_ENTITY, analysisList);
Expand Down
4 changes: 2 additions & 2 deletions dcc-portal-ui/app/scripts/analysis/js/analysisSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
return set.state !== 'FINISHED';
});
if (toRemove.length > 0) {
SetService.removeSeveral(_.pluck(toRemove, 'id'));
SetService.removeSeveral(_.map(toRemove, 'id'));
_this.checkAll = false; // reset
}
};
Expand All @@ -116,7 +116,7 @@

var toRemove = _this.selectedSets;
if (toRemove.length > 0) {
SetService.removeSeveral(_.pluck(toRemove, 'id'));
SetService.removeSeveral(_.map(toRemove, 'id'));
_this.checkAll = false; // reset
}
};
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/analysis/views/analysis.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="h1-wrap">
<h1 data-ui-scrollfix=79>
<h1 data-ui-scrollpoint=79>
<i class="t_badge t_badge_icon t_badge__analysis"><i class="icon-beaker"></i></i><translate>Data Analysis</translate>
</h1>
</div>
Expand Down
3 changes: 1 addition & 2 deletions dcc-portal-ui/app/scripts/app/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@

// angular plugins
'restangular',
'ui.scrollfix',
'ui.scrollpoint',
'ui.bootstrap.modal',
'ui.bootstrap.position',
'ui.bootstrap.pagination',
Expand All @@ -202,7 +202,6 @@
'template/pagination/pagination.html',
'ui.router',
'infinite-scroll',
'angular-lodash',
'angularytics',
'angular-loading-bar',
'hc.marked',
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/beacon/views/beacon.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="h1-wrap">
<h1 data-ui-scrollfix="79" class="sticky-scrollfix">
<h1 data-ui-scrollpoint="79" class="sticky-scrollfix">
<i class="t_badge t_badge_icon t_badge__search"><i class="icon-fire"></i></i><translate>ICGC GA4GH Beacon</translate>
</h1>
</div>
Expand Down
8 changes: 4 additions & 4 deletions dcc-portal-ui/app/scripts/common/js/abridger.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@

var tokens = [keyword2].concat (words (keyword2));
var matchKeyword = _(tokens)
.unique()
.uniq()
.find (function (token) {
return _.contains (sentence2, token);
return _.includes (sentence2, token);
});

return _.isUndefined (matchKeyword) ? {} : {
Expand Down Expand Up @@ -114,7 +114,7 @@
};

this.processLeftAndRight = function (newElements) {
var left = _.first (newElements);
var left = _.head (newElements);
var right = _.last (newElements);

if (withinLimit (newElements)) {
Expand Down Expand Up @@ -147,7 +147,7 @@
};

this.processLeftOnly = function (newElements) {
var left = _.first (newElements);
var left = _.head (newElements);

if (withinLimit (left)) {
_this.resultArray = [left].concat (_this.resultArray);
Expand Down
5 changes: 3 additions & 2 deletions dcc-portal-ui/app/scripts/common/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ require('../components');
return function (items, param) {
var ret = null;
if (angular.isArray(items)) {
ret = _.reduce(_.pluck(items, param), function (sum, num) {
ret = _.reduce(_.map(items, param), function (sum, num) {
return sum + num;
});
}
Expand All @@ -79,6 +79,7 @@ require('../components');
var input = arguments[0];
var method = arguments[1];
invariant(_.isString(method), 'The first argument must be a string that specifies a lodash method name');
invariant(_[method], `_.${method} does not exist`);
var args = Array.prototype.slice.call(arguments, 2);
return _[method].apply(null, [input].concat(args));
};
Expand Down Expand Up @@ -187,7 +188,7 @@ require('../components');
selfLoadState.isLoading = val;
},
addContributingLoadState: function (loadState) {
if (_.contains(contributingLoadStates, loadState)) {
if (_.includes(contributingLoadStates, loadState)) {
console.warn('load state is already in contributing loadStates, this shouldnt happen');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/common/js/consequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@


this.precedence = function() {
return _.pluck(dataOrdered, 'id');
return _.map(dataOrdered, 'id');
};

this.translate = function(id) {
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/common/js/datatype.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
};

this.precedence = function() {
return _.pluck(data, 'id');
return _.map(data, 'id');
};

this.translate = function(id) {
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/common/js/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
uiTerm = predefinedCurated.name;
isPredefined = true;
}
} else if (_.contains(['study', 'donorStudy', 'studies'], facetKey)) {
} else if (_.includes(['study', 'donorStudy', 'studies'], facetKey)) {
if (term === '_missing') {
uiTerm = 'None';
}
Expand Down
4 changes: 2 additions & 2 deletions dcc-portal-ui/app/scripts/common/js/ensure-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export const partiallyContainsIgnoringCase = (phrase, keyword) => {

const tokens = [capitalizedKeyword].concat (words(capitalizedKeyword));
const matchKeyword = _(tokens)
.unique()
.uniq()
.find (function (token) {
return _.contains(capitalizedPhrase, token);
return _.includes(capitalizedPhrase, token);
});

return !_.isUndefined(matchKeyword);
Expand Down
2 changes: 1 addition & 1 deletion dcc-portal-ui/app/scripts/common/js/pcawg.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
};

this.precedence = function() {
return _.pluck(data, 'id');
return _.map(data, 'id');
};


Expand Down
Loading