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
4d98dbb0
Commit
4d98dbb0
authored
1 year ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
fix regression in function isXtraFormActive
parent
4fb363a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!611
REDMINE_ISSUE-17999 | Regression : l'affichage des champs conditionnels ne marche plus à la création d'un signalement
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/index.js
+4
-2
4 additions, 2 deletions
src/utils/index.js
with
4 additions
and
2 deletions
src/utils/index.js
+
4
−
2
View file @
4d98dbb0
...
...
@@ -130,11 +130,13 @@ export function findCurrentValue(feature, customField) {
export
function
isXtraFormActive
(
extraForms
,
config
)
{
// return true if no config or if the condition is fullfilled
if
(
config
)
{
// if conditional field configuration is not null
// get name and value in condition
const
[
conditionFieldName
,
conditionFieldValue
]
=
Object
.
entries
(
config
)[
0
];
// get the customForm which activates conditional field
const
conditioningXForm
=
extraForms
.
find
((
xForm
)
=>
xForm
.
name
===
config
.
conditionField
);
const
conditioningXForm
=
extraForms
.
find
((
xForm
)
=>
xForm
.
name
===
conditionField
Name
);
// check if its value match the condition value
if
(
conditioningXForm
)
{
// use JSON.stringify() to compare arrays (works with other field type too)
return
JSON
.
stringify
(
conditioningXForm
.
value
)
===
JSON
.
stringify
(
config
.
conditionValue
);
return
JSON
.
stringify
(
conditioningXForm
.
value
)
===
JSON
.
stringify
(
condition
Field
Value
);
}
}
return
true
;
...
...
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