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
b23e490a
Commit
b23e490a
authored
6 years ago
by
esikkala
Browse files
Options
Downloads
Patches
Plain Diff
Update facet values only after a succesful request
parent
21d2426d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/client/components/Tree.js
+1
-1
1 addition, 1 deletion
src/client/components/Tree.js
src/client/reducers/manuscriptsFacets.js
+9
-10
9 additions, 10 deletions
src/client/reducers/manuscriptsFacets.js
with
10 additions
and
11 deletions
src/client/components/Tree.js
+
1
−
1
View file @
b23e490a
...
...
@@ -86,7 +86,7 @@ class Tree extends Component {
treeData
:
this
.
props
.
data
});
}
if
(
this
.
props
.
updatedFacet
!==
''
&&
this
.
props
.
updatedFacet
!==
this
.
props
.
property
&&
prevProps
.
facetFilters
!=
this
.
props
.
facetFilters
)
{
if
(
this
.
props
.
updatedFacet
!==
null
&&
this
.
props
.
updatedFacet
!==
this
.
props
.
property
&&
prevProps
.
facetFilters
!=
this
.
props
.
facetFilters
)
{
// console.log(`fetching new values for ${this.props.property}`)
this
.
props
.
fetchFacet
(
this
.
props
.
resultClass
,
this
.
props
.
property
,
this
.
props
.
sortBy
,
this
.
props
.
sortDirection
);
}
...
...
This diff is collapsed.
Click to expand it.
src/client/reducers/manuscriptsFacets.js
+
9
−
10
View file @
b23e490a
...
...
@@ -63,8 +63,7 @@ export const INITIAL_STATE = {
source
:
new
Set
(),
language
:
new
Set
(),
},
updatedFacet
:
''
,
fetching
:
false
updatedFacet
:
null
,
};
const
manuscriptsFacets
=
(
state
=
INITIAL_STATE
,
action
)
=>
{
...
...
@@ -81,16 +80,10 @@ const manuscriptsFacets = (state = INITIAL_STATE, action) => {
case
FETCH_FACET
:
return
{
...
state
,
fetching
:
true
,
facets
:
{
...
state
.
facets
,
[
action
.
id
]:
{
...
state
.
facets
[
action
.
id
],
distinctValueCount
:
0
,
values
:
[],
flatValues
:
[],
sortBy
:
action
.
sortBy
,
sortDirection
:
action
.
sortDirection
,
isFetching
:
true
}
}
...
...
@@ -104,12 +97,18 @@ const manuscriptsFacets = (state = INITIAL_STATE, action) => {
...
state
.
facets
[
action
.
id
],
isFetching
:
false
,
}
}
},
filters
:
{
productionPlace
:
new
Set
(),
author
:
new
Set
(),
source
:
new
Set
(),
language
:
new
Set
(),
},
updatedFacet
:
''
,
};
case
UPDATE_FACET
:
return
{
...
state
,
fetching
:
false
,
facets
:
{
...
state
.
facets
,
[
action
.
id
]:
{
...
...
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