Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Géocontrib Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
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
externe Matthieu
Géocontrib Frontend
Commits
08b9e66f
Commit
08b9e66f
authored
2 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
fix errors if no custom field was selected
parent
54a010dc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/services/map-service.js
+13
-7
13 additions, 7 deletions
src/services/map-service.js
with
13 additions
and
7 deletions
src/services/map-service.js
+
13
−
7
View file @
08b9e66f
...
@@ -335,13 +335,19 @@ const mapService = {
...
@@ -335,13 +335,19 @@ const mapService = {
if
(
colors_style
&&
colors_style
.
custom_field_name
&&
customfield_set
)
{
if
(
colors_style
&&
colors_style
.
custom_field_name
&&
customfield_set
)
{
const
fieldType
=
customfield_set
.
find
((
el
)
=>
el
.
name
===
colors_style
.
custom_field_name
).
field_type
;
const
fieldType
=
customfield_set
.
find
((
el
)
=>
el
.
name
===
colors_style
.
custom_field_name
).
field_type
;
const
currentValue
=
properties
[
colors_style
.
custom_field_name
];
const
currentValue
=
properties
[
colors_style
.
custom_field_name
];
if
(
fieldType
===
'
list
'
)
{
color
=
colors_style
.
colors
[
currentValue
];
if
(
currentValue
)
{
opacity
=
colors_style
.
opacities
[
currentValue
];
switch
(
fieldType
)
{
}
else
if
(
fieldType
===
'
char
'
)
{
//* if the custom field is supposed to be a string
case
'
list
'
:
//* check if its current value is empty or not, to select a color | https://redmine.neogeo.fr/issues/14048
color
=
colors_style
.
colors
[
currentValue
];
color
=
colors_style
.
value
.
colors
[
currentValue
?
'
Non vide
'
:
'
Vide
'
];
opacity
=
colors_style
.
opacities
[
currentValue
];
opacity
=
colors_style
.
value
.
opacities
[
currentValue
?
'
Non vide
'
:
'
Vide
'
];
break
;
case
'
char
'
:
//* if the custom field is supposed to be a string
//* check if its current value is empty or not, to select a color | https://redmine.neogeo.fr/issues/14048
color
=
colors_style
.
value
.
colors
[
currentValue
?
'
Non vide
'
:
'
Vide
'
];
opacity
=
colors_style
.
value
.
opacities
[
currentValue
?
'
Non vide
'
:
'
Vide
'
];
break
;
}
}
}
}
}
return
{
color
,
opacity
};
return
{
color
,
opacity
};
...
...
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