Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xpub-epmc
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Literature-services
public-projects
xpub-epmc
Commits
a4e53b1b
Commit
a4e53b1b
authored
6 years ago
by
Zhan Huang
Browse files
Options
Downloads
Patches
Plain Diff
465
parent
a3c79c26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!111
Shared data model
,
!113
Dev
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/components/dashboard/SearchBoxes.jsx
+19
-3
19 additions, 3 deletions
app/components/dashboard/SearchBoxes.jsx
with
19 additions
and
3 deletions
app/components/dashboard/SearchBoxes.jsx
+
19
−
3
View file @
a4e53b1b
...
...
@@ -27,6 +27,9 @@ const SearchArea = styled.div`
flex-wrap: wrap;
}
`
let
errorTimer
class
SearchBoxes
extends
React
.
Component
{
state
=
{
id
:
SearchBoxes
.
id
?
SearchBoxes
.
id
:
''
,
...
...
@@ -34,19 +37,32 @@ class SearchBoxes extends React.Component {
errors
:
[],
}
componentDidUpdate
()
{
if
(
this
.
state
.
errors
&&
this
.
area
)
{
setTimeout
(()
=>
{
const
{
errors
}
=
this
.
state
if
(
errorTimer
)
{
clearTimeout
(
errorTimer
)
}
if
(
errors
&&
this
.
area
)
{
errorTimer
=
setTimeout
(()
=>
{
this
.
setState
({
errors
:
[]
})
},
10000
)
}
}
componentWillUnmount
()
{
clearTimeout
(
errorTimer
)
}
static
id
=
''
static
search
=
''
setRef
=
area
=>
{
this
.
area
=
area
}
onSearchValChanged
=
e
=>
{
this
.
setState
({
[
e
.
target
.
name
]:
e
.
target
.
value
})
this
.
setState
({
[
e
.
target
.
name
]:
e
.
target
.
value
,
errors
:
[],
})
SearchBoxes
[
e
.
target
.
name
]
=
e
.
target
.
value
}
onSearchValSubmitted
=
(
where
,
e
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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