()
| 49 | } |
| 50 | |
| 51 | render() { |
| 52 | const { |
| 53 | query, |
| 54 | result, |
| 55 | intl, |
| 56 | className, |
| 57 | columns, |
| 58 | showPreview, |
| 59 | updateSelection, |
| 60 | selection, |
| 61 | emptyComponent, |
| 62 | collection, |
| 63 | writeable, |
| 64 | } = this.props; |
| 65 | const isEmpty = !query.hasQuery(); |
| 66 | |
| 67 | return ( |
| 68 | <div className={c('EntitySearch', className)}> |
| 69 | {result.total === 0 && ( |
| 70 | <section className="PartialError"> |
| 71 | {!isEmpty && ( |
| 72 | <ErrorSection |
| 73 | icon="search" |
| 74 | title={intl.formatMessage(messages.no_results_title)} |
| 75 | description={intl.formatMessage( |
| 76 | messages.no_results_description |
| 77 | )} |
| 78 | /> |
| 79 | )} |
| 80 | {isEmpty && emptyComponent} |
| 81 | </section> |
| 82 | )} |
| 83 | <EntitySearchResults |
| 84 | query={query} |
| 85 | result={result} |
| 86 | showPreview={showPreview} |
| 87 | updateQuery={this.updateQuery} |
| 88 | updateSelection={updateSelection} |
| 89 | selection={selection} |
| 90 | collection={collection} |
| 91 | writeable={writeable} |
| 92 | columns={[getGroupField('caption'), ...columns]} |
| 93 | /> |
| 94 | <QueryInfiniteLoad |
| 95 | query={query} |
| 96 | result={result} |
| 97 | fetch={this.props.queryEntities} |
| 98 | /> |
| 99 | </div> |
| 100 | ); |
| 101 | } |
| 102 | } |
| 103 | const mapStateToProps = (state, ownProps) => { |
| 104 | const { query } = ownProps; |
nothing calls this directly
no test coverage detected