Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Frontend V2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
GraphPolaris
Frontend V2
Commits
df71e8c3
Verified
Commit
df71e8c3
authored
7 months ago
by
Dennis Collaris
Browse files
Options
Downloads
Patches
Plain Diff
fix: backwards compatibility with old settings format preventing crash on launch
parent
b5b078d1
Branches
fix/sharelink
No related tags found
1 merge request
!189
feat(mapvis): refactor of config logic and choropleth
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/shared/lib/vis/visualizations/mapvis/components/MapSettings.tsx
+12
-0
12 additions, 0 deletions
.../lib/vis/visualizations/mapvis/components/MapSettings.tsx
with
12 additions
and
0 deletions
libs/shared/lib/vis/visualizations/mapvis/components/MapSettings.tsx
+
12
−
0
View file @
df71e8c3
...
...
@@ -7,6 +7,18 @@ import { MapProps } from '../mapvis';
import
{
LayerSettingsType
}
from
'
../mapvis.types
'
;
export
const
MapSettings
=
({
settings
,
graphMetadata
,
updateSettings
}:
VisualizationSettingsPropTypes
<
MapProps
>
)
=>
{
// For backwards compatibility with older saveStates, we migrate information from settings.nodes to settings.location
// FIXME: this can be removed once all systems have updated their saveStates.
if
(
!
(
'
location
'
in
settings
))
{
settings
=
JSON
.
parse
(
JSON
.
stringify
(
settings
));
// Undo Object.preventExtensions()
settings
.
location
=
Object
.
entries
(
settings
.
nodes
)
.
map
(([
k
,
v
])
=>
[
k
,
{
lat
:
(
v
as
any
).
lat
,
lon
:
(
v
as
any
).
lon
}])
.
reduce
((
obj
,
[
k
,
v
])
=>
({...
obj
,
[
k
as
string
]:
v
}),
{});
}
const
DataLayerSettings
=
settings
.
layer
&&
layerSettings
?.[
settings
.
layer
];
const
updateLayerSettings
=
(
updatedKeyValue
:
Partial
<
LayerSettingsType
>
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
Dennis Collaris
@decode
mentioned in merge request
!172 (merged)
·
6 months ago
mentioned in merge request
!172 (merged)
mentioned in merge request !172
Toggle commit list
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