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
76be25d5
Commit
76be25d5
authored
3 years ago
by
Timothee P
Browse files
Options
Downloads
Patches
Plain Diff
prevent customForm being added twice at edit
parent
51afea7e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!138
REDMINE_ISSUE-12426
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/feature_type/Feature_type_edit.vue
+8
-0
8 additions, 0 deletions
src/views/feature_type/Feature_type_edit.vue
with
8 additions
and
0 deletions
src/views/feature_type/Feature_type_edit.vue
+
8
−
0
View file @
76be25d5
...
@@ -340,11 +340,19 @@ export default {
...
@@ -340,11 +340,19 @@ export default {
},
},
addCustomForm
(
customForm
)
{
addCustomForm
(
customForm
)
{
if
(
customForm
&&
this
.
customForms
.
some
((
cf
)
=>
cf
.
name
===
customForm
.
name
)
)
{
//* abort if customForm already exists (because watcher can update again)
return
;
}
this
.
dataKey
+=
1
;
// * increment counter for key in v-for
this
.
dataKey
+=
1
;
// * increment counter for key in v-for
let
newCustomForm
=
{
let
newCustomForm
=
{
dataKey
:
this
.
dataKey
,
dataKey
:
this
.
dataKey
,
};
};
if
(
customForm
)
{
if
(
customForm
)
{
//* if adding an existing customForm -> add its property to newCustomForm containing only dataKey
newCustomForm
=
{
...
newCustomForm
,
...
customForm
};
newCustomForm
=
{
...
newCustomForm
,
...
customForm
};
}
}
this
.
$store
.
commit
(
"
feature_type/ADD_CUSTOM_FORM
"
,
newCustomForm
);
// * create an object with the counter in store
this
.
$store
.
commit
(
"
feature_type/ADD_CUSTOM_FORM
"
,
newCustomForm
);
// * create an object with the counter in store
...
...
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