Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nos Hs2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Språksamlingane
stadnamn
Nos Hs2023
Commits
98b0b2c6
Commit
98b0b2c6
authored
6 years ago
by
Esko Ikkala
Browse files
Options
Downloads
Patches
Plain Diff
Show spinner when fetching results
parent
a934529b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/IntegrationAutosuggest.js
+2
-2
2 additions, 2 deletions
src/components/IntegrationAutosuggest.js
src/reducers/search.js
+7
-2
7 additions, 2 deletions
src/reducers/search.js
with
9 additions
and
4 deletions
src/components/IntegrationAutosuggest.js
+
2
−
2
View file @
98b0b2c6
...
@@ -124,7 +124,7 @@ const IntegrationAutosuggest = (props) => {
...
@@ -124,7 +124,7 @@ const IntegrationAutosuggest = (props) => {
};
};
const
shouldRenderSuggestions
=
(
value
)
=>
{
const
shouldRenderSuggestions
=
(
value
)
=>
{
return
value
.
trim
().
length
>
3
;
return
value
.
trim
().
length
>
2
;
};
};
const
handleOnSuggestionsClearRequested
=
()
=>
{
const
handleOnSuggestionsClearRequested
=
()
=>
{
...
@@ -136,7 +136,7 @@ const IntegrationAutosuggest = (props) => {
...
@@ -136,7 +136,7 @@ const IntegrationAutosuggest = (props) => {
//console.log('IntegrationAutosuggest', props.search.suggestions);
//console.log('IntegrationAutosuggest', props.search.suggestions);
let
adornment
=
null
;
let
adornment
=
null
;
if
(
props
.
search
.
fetchingSuggestions
)
{
if
(
props
.
search
.
fetchingSuggestions
||
props
.
search
.
fetchingResults
)
{
adornment
=
<
InputAdornment
position
=
"
end
"
><
CircularProgress
size
=
{
20
}
/></
InputAdornment
>
;
adornment
=
<
InputAdornment
position
=
"
end
"
><
CircularProgress
size
=
{
20
}
/></
InputAdornment
>
;
}
else
{
}
else
{
adornment
=
<
SearchIcon
className
=
{
classes
.
icon
}
/>
;
adornment
=
<
SearchIcon
className
=
{
classes
.
icon
}
/>
;
...
...
This diff is collapsed.
Click to expand it.
src/reducers/search.js
+
7
−
2
View file @
98b0b2c6
...
@@ -2,6 +2,7 @@ import {
...
@@ -2,6 +2,7 @@ import {
UPDATE_QUERY
,
UPDATE_QUERY
,
UPDATE_DATASETS
,
UPDATE_DATASETS
,
FETCH_SUGGESTIONS
,
FETCH_SUGGESTIONS
,
FETCH_RESULTS
,
UPDATE_SUGGESTIONS
,
UPDATE_SUGGESTIONS
,
CLEAR_SUGGESTIONS
,
CLEAR_SUGGESTIONS
,
UPDATE_RESULTS
,
UPDATE_RESULTS
,
...
@@ -18,7 +19,7 @@ export const INITIAL_STATE = {
...
@@ -18,7 +19,7 @@ export const INITIAL_STATE = {
fetchingSuggestions
:
false
,
fetchingSuggestions
:
false
,
results
:
[],
results
:
[],
resultsQuery
:
''
,
resultsQuery
:
''
,
fetchingResults
:
tru
e
,
fetchingResults
:
fals
e
,
};
};
const
search
=
(
state
=
INITIAL_STATE
,
action
)
=>
{
const
search
=
(
state
=
INITIAL_STATE
,
action
)
=>
{
...
@@ -29,6 +30,8 @@ const search = (state = INITIAL_STATE, action) => {
...
@@ -29,6 +30,8 @@ const search = (state = INITIAL_STATE, action) => {
return
{
...
state
,
datasets
:
action
.
datasets
||
[]
};
return
{
...
state
,
datasets
:
action
.
datasets
||
[]
};
case
FETCH_SUGGESTIONS
:
case
FETCH_SUGGESTIONS
:
return
{
...
state
,
fetchingSuggestions
:
true
};
return
{
...
state
,
fetchingSuggestions
:
true
};
case
FETCH_RESULTS
:
return
{
...
state
,
fetchingResults
:
true
};
case
CLEAR_SUGGESTIONS
:
case
CLEAR_SUGGESTIONS
:
return
{
return
{
...
state
,
...
state
,
...
@@ -48,12 +51,14 @@ const search = (state = INITIAL_STATE, action) => {
...
@@ -48,12 +51,14 @@ const search = (state = INITIAL_STATE, action) => {
...
state
,
...
state
,
results
:
[],
results
:
[],
resultsQuery
:
''
,
resultsQuery
:
''
,
fetchingResults
:
false
};
};
case
UPDATE_RESULTS
:
case
UPDATE_RESULTS
:
return
{
return
{
...
state
,
...
state
,
results
:
results
(
state
.
results
,
action
),
results
:
results
(
state
.
results
,
action
),
resultsQuery
:
state
.
query
resultsQuery
:
state
.
query
,
fetchingResults
:
false
};
};
default
:
default
:
return
state
;
return
state
;
...
...
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