Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
condenser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
condenser
Commits
7a947659
Commit
7a947659
authored
4 years ago
by
Quoc Huy Nguyen Dinh
Browse files
Options
Downloads
Patches
Plain Diff
Search page should not show an error by default
parent
a9ec8c24
No related branches found
Branches containing commit
No related tags found
2 merge requests
!239
- fix search results not appearing
,
!230
Fix search results not showing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/components/pages/SearchIndex.jsx
+10
-5
10 additions, 5 deletions
src/app/components/pages/SearchIndex.jsx
with
10 additions
and
5 deletions
src/app/components/pages/SearchIndex.jsx
+
10
−
5
View file @
7a947659
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
tt
from
'
counterpart
'
;
import
_
from
'
lodash
'
;
import
{
search
}
from
'
app/redux/SearchReducer
'
;
import
{
search
}
from
'
app/redux/SearchReducer
'
;
import
Callout
from
'
app/components/elements/Callout
'
;
import
Callout
from
'
app/components/elements/Callout
'
;
import
ElasticSearchInput
from
'
app/components/elements/ElasticSearchInput
'
;
import
ElasticSearchInput
from
'
app/components/elements/ElasticSearchInput
'
;
import
PostsList
from
'
app/components/cards/PostsList
'
;
import
PostsList
from
'
app/components/cards/PostsList
'
;
import
{
List
,
Map
,
fromJS
}
from
'
immutable
'
;
import
{
fromJS
}
from
'
immutable
'
;
class
SearchIndex
extends
React
.
Component
{
class
SearchIndex
extends
React
.
Component
{
static
propTypes
=
{
static
propTypes
=
{
...
@@ -68,6 +68,7 @@ class SearchIndex extends React.Component {
...
@@ -68,6 +68,7 @@ class SearchIndex extends React.Component {
render
()
{
render
()
{
const
{
result
,
loading
,
params
,
performSearch
,
error
}
=
this
.
props
;
const
{
result
,
loading
,
params
,
performSearch
,
error
}
=
this
.
props
;
const
errorMessage
=
_
.
get
(
error
,
'
message
'
,
undefined
);
const
searchResults
=
(
const
searchResults
=
(
<
PostsList
ref
=
"list"
posts
=
{
fromJS
(
result
)
}
loading
=
{
loading
}
loadMore
=
{
this
.
fetchMoreResults
}
/>
<
PostsList
ref
=
"list"
posts
=
{
fromJS
(
result
)
}
loading
=
{
loading
}
loadMore
=
{
this
.
fetchMoreResults
}
/>
...
@@ -89,11 +90,15 @@ class SearchIndex extends React.Component {
...
@@ -89,11 +90,15 @@ class SearchIndex extends React.Component {
/>
/>
</
div
>
</
div
>
</
div
>
</
div
>
{
!
loading
&&
!
error
&&
result
.
length
===
0
?
<
Callout
>
Nothing was found.
</
Callout
>
:
searchResults
}
{
!
loading
&&
!
errorMessage
&&
result
.
length
===
0
?
(
<
Callout
>
Nothing was found.
</
Callout
>
)
:
(
searchResults
)
}
{
!
loading
&&
{
!
loading
&&
error
&&
(
error
Message
&&
(
<
Callout
title
=
"There was an error"
type
=
"alert"
>
<
Callout
title
=
"There was an error"
type
=
"alert"
>
{
error
.
m
essage
}
{
error
M
essage
}
</
Callout
>
</
Callout
>
)
}
)
}
</
article
>
</
article
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment