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
GéoContrib
Géocontrib Frontend
Commits
9587ca3f
Commit
9587ca3f
authored
1 year ago
by
Timothee P
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into redmine-issues/18348
parents
563aea67
ca1d1678
No related branches found
No related tags found
1 merge request
!669
REDMINE_ISSUE-18348 | import geojson avec champ pre_recorded_list
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/index.js
+9
-4
9 additions, 4 deletions
src/utils/index.js
with
9 additions
and
4 deletions
src/utils/index.js
+
9
−
4
View file @
9587ca3f
import
featureAPI
from
'
@/services/feature-api
'
;
import
{
isNil
}
from
'
lodash
'
;
export
function
formatStringDate
(
stringDate
)
{
const
date
=
new
Date
(
stringDate
);
if
(
date
instanceof
Date
&&
!
isNaN
(
date
.
valueOf
()))
{
...
...
@@ -202,12 +202,17 @@ export function isXtraFormActive(extraForms, config) { // return true if no conf
const
{
conditionField
,
conditionValue
}
=
config
;
// get the customForm which activates conditional field
const
conditioningXForm
=
extraForms
.
find
((
xForm
)
=>
xForm
.
name
===
conditionField
);
// check if
its
value match the condition value
// check if
the conditioning extraform
value match the condition value
if
(
conditioningXForm
)
{
if
(
Array
.
isArray
(
conditionValue
)
&&
conditioningXForm
.
value
)
{
// if the values to compare are null or undefined the field can't be activated
if
(
isNil
(
conditioningXForm
.
value
)
||
isNil
(
conditionValue
))
{
return
false
;
}
else
if
(
Array
.
isArray
(
conditionValue
)
&&
Array
.
isArray
(
conditioningXForm
.
value
))
{
// case of multiple list or prerecorded values list
return
conditioningXForm
.
value
.
some
((
value
)
=>
conditionValue
.
includes
(
value
));
}
else
if
(
typeof
conditioningXForm
.
value
===
'
object
'
&&
conditioningXForm
.
value
.
label
)
{
// case of simple list
return
conditioningXForm
.
value
.
label
===
conditionValue
.
label
;
}
else
{
return
conditioningXForm
.
value
===
conditionValue
;
return
conditioningXForm
.
value
===
conditionValue
;
// more simple case of other fields
}
}
}
...
...
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