Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
3ee99560
Unverified
Commit
3ee99560
authored
5 years ago
by
xgui3783
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #89 from FZJ-INM1-BDA/chore/fixLint
fix lint
parents
a31d1c02
cd911fa5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/services/state/ngViewerState.store.ts
+15
-68
15 additions, 68 deletions
src/services/state/ngViewerState.store.ts
with
15 additions
and
68 deletions
src/services/state/ngViewerState.store.ts
+
15
−
68
View file @
3ee99560
...
...
@@ -107,12 +107,13 @@ export const getStateStore = ({ state = defaultState } = {}) => (prevState: Stat
layers
:
prevState
.
layers
.
filter
(
l
=>
!
layerNameSet
.
has
(
l
.
name
)),
}
}
case
REMOVE_NG_LAYER
:
case
REMOVE_NG_LAYER
:
{
return
{
...
prevState
,
layers
:
prevState
.
layers
.
filter
(
l
=>
l
.
name
!==
action
.
layer
.
name
),
}
case
SHOW_NG_LAYER
:
}
case
SHOW_NG_LAYER
:
return
{
...
prevState
,
layers
:
prevState
.
layers
.
map
(
l
=>
l
.
name
===
action
.
layer
.
name
...
...
@@ -132,72 +133,18 @@ export const getStateStore = ({ state = defaultState } = {}) => (prevState: Stat
...
prevState
,
forceShowSegment
:
action
.
forceShowSegment
,
}
case
ADD_NG_LAYER
:
return
{
...
prevState
,
/* this configration hides the layer if a non mixable layer already present */
/* this configuration does not the addition of multiple non mixable layers */
// layers : action.layer.mixability === 'nonmixable' && prevState.layers.findIndex(l => l.mixability === 'nonmixable') >= 0
// ? prevState.layers
// : prevState.layers.concat(action.layer)
/* this configuration allows the addition of multiple non mixables */
// layers : prevState.layers.map(l => mapLayer(l, action.layer)).concat(action.layer)
layers
:
mixNgLayers
(
prevState
.
layers
,
action
.
layer
)
// action.layer.constructor === Array
// ? prevState.layers.concat(action.layer)
// : prevState.layers.concat({
// ...action.layer,
// ...( action.layer.mixability === 'nonmixable' && prevState.layers.findIndex(l => l.mixability === 'nonmixable') >= 0
// ? {visible: false}
// : {})
// })
}
case
REMOVE_NG_LAYERS
:
const
{
layers
}
=
action
const
layerNameSet
=
new
Set
(
layers
.
map
(
l
=>
l
.
name
))
return
{
...
prevState
,
layers
:
prevState
.
layers
.
filter
(
l
=>
!
layerNameSet
.
has
(
l
.
name
))
}
case
REMOVE_NG_LAYER
:
return
{
...
prevState
,
layers
:
prevState
.
layers
.
filter
(
l
=>
l
.
name
!==
action
.
layer
.
name
)
}
case
SHOW_NG_LAYER
:
return
{
...
prevState
,
layers
:
prevState
.
layers
.
map
(
l
=>
l
.
name
===
action
.
layer
.
name
?
{
...
l
,
visible
:
true
}
:
l
)
}
case
HIDE_NG_LAYER
:
return
{
...
prevState
,
layers
:
prevState
.
layers
.
map
(
l
=>
l
.
name
===
action
.
layer
.
name
?
{
...
l
,
visible
:
false
}
:
l
)
}
case
FORCE_SHOW_SEGMENT
:
return
{
...
prevState
,
forceShowSegment
:
action
.
forceShowSegment
}
case
NEHUBA_READY
:
const
{
nehubaReady
}
=
action
return
{
...
prevState
,
nehubaReady
}
case
GENERAL_ACTION_TYPES
.
APPLY_STATE
:
const
{
ngViewerState
}
=
(
action
as
any
).
state
return
ngViewerState
default
:
return
prevState
case
NEHUBA_READY
:
{
const
{
nehubaReady
}
=
action
return
{
...
prevState
,
nehubaReady
}
}
case
GENERAL_ACTION_TYPES
.
APPLY_STATE
:
{
const
{
ngViewerState
}
=
(
action
as
any
).
state
return
ngViewerState
}
default
:
return
prevState
}
}
...
...
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