Skip to content

Commit

Permalink
Merge pull request #105 from KleeGroup/search-no-result
Browse files Browse the repository at this point in the history
[search] Empty result.
  • Loading branch information
pierr committed Jun 13, 2015
2 parents f5a2c72 + 7df90e2 commit ffcab54
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions page/search/common/group-by-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ let ListSelection = require('../../../list/selection').list.component;
// Mixins

let i18nMixin = require('../../../common/i18n/mixin');

//Empty Result component to be mututalized.
let EmptyComponent = React.createClass({
mixins: [i18nMixin],
render(){
return (
<div data-focus='empty-result'>
{this.i18n('search.empty')}
</div>
);
}
})
/**
* Mixin used in order to create a block.
* @type {Object}
Expand All @@ -31,11 +41,7 @@ let GroupByMixin = {
lineComponentMapper() {
throw new ArgumentNullException('Please provide a inferLineComponentFromList(list) function.');
},
emptyComponent: (
<div data-focus='empty-result'>
{this.i18n('search.empty')}
</div>
)
emptyComponent: EmptyComponent
});
},
/**
Expand Down Expand Up @@ -78,7 +84,7 @@ let GroupByMixin = {
},
_getSingleTypeResultList(groupKey, list, maxRows) {
if (list.length === 0) {
return this.emptyComponent;
return <this.emptyComponent />;
}
if (maxRows) {
list = list.slice(0, maxRows);
Expand Down

0 comments on commit ffcab54

Please sign in to comment.