Skip to content

Commit

Permalink
Remove getPagesForMenuCreation, use always full model instead
Browse files Browse the repository at this point in the history
  • Loading branch information
vithar committed Mar 30, 2016
1 parent 0db4535 commit 3205da7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 1 addition & 10 deletions src/tasks/template/full-bem.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ module.exports = function(model, options) {
return page.bundle === options.bundle;
}

/**
* Receives pages for menu
* Pick only url, title and site fields from each of model pages
* @returns {Object[]}
*/
function getPagesDataForMenuCreation() {
return model.getPages().map(page => _.pick(page, ['url', 'site', 'title', 'type']));
}

/**
* Loads page content
* @param {Object} page
Expand Down Expand Up @@ -119,7 +110,7 @@ module.exports = function(model, options) {
* @returns {Function}
*/
function createProcessPageFunc() {
const pages = getPagesDataForMenuCreation();
const pages = model.getPages();

return (model, page) => {
return Q(page)
Expand Down
5 changes: 4 additions & 1 deletion test/src/tasks/template/full-bem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ describe('tasks/template/full-bem', () => {
url: '/url1/'
},
pages: [{
url: '/url1/',
site: '/url1/',
title: 'some title 1',
url: '/url1/'
contentFile: '/url1/index.html',
bundle: 'index',
content: 'some-content'
}]
}
});
Expand Down

0 comments on commit 3205da7

Please sign in to comment.