From cbe28672818c6091acc9e95fbc0ab989c3ef15af Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 22 Mar 2017 16:53:16 +0200 Subject: [PATCH 1/2] Consider default_view as view by default. --- lib/view.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/view.js b/lib/view.js index 4d840657..9cfd8c3f 100644 --- a/lib/view.js +++ b/lib/view.js @@ -37,7 +37,10 @@ export function extractViews(entities) { Object.keys(entities).forEach((entityId) => { const entity = entities[entityId]; - if (entity.attributes.view) { + // Entity is a view if it has the 'view' attribute set. + // Consider default_view as view by default. + if (entity.attributes.view || + (entity.entity_id === DEFAULT_VIEW_ENTITY_ID && entity.attributes.view !== false)) { views.push(entity); } }); From 97e5975e1cee3df911d4b9e6d2c23cb5998d9b6a Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 23 Mar 2017 17:15:20 +0200 Subject: [PATCH 2/2] Remove extra check --- lib/view.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/view.js b/lib/view.js index 9cfd8c3f..be6f02bf 100644 --- a/lib/view.js +++ b/lib/view.js @@ -39,8 +39,7 @@ export function extractViews(entities) { const entity = entities[entityId]; // Entity is a view if it has the 'view' attribute set. // Consider default_view as view by default. - if (entity.attributes.view || - (entity.entity_id === DEFAULT_VIEW_ENTITY_ID && entity.attributes.view !== false)) { + if (entity.attributes.view || entity.entity_id === DEFAULT_VIEW_ENTITY_ID) { views.push(entity); } });