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
Merge requests
!233
REDMINE_ISSUE-12378
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
REDMINE_ISSUE-12378
redmine-issues/12378
into
develop
Overview
0
Commits
22
Pipelines
0
Changes
2
Merged
Timothee P
requested to merge
redmine-issues/12378
into
develop
3 years ago
Overview
0
Commits
22
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
8802d017
Prev
Next
Show latest version
2 files
+
9
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
8802d017
fix features import in projects without moderation(undefined value without error log)
· 8802d017
Timothee P
authored
3 years ago
src/store/modules/feature_type.js
+
2
−
4
Options
@@ -167,13 +167,12 @@ const feature_type = {
let
{
feature_type_slug
,
geojson
}
=
payload
;
//* check if geojson then build a file
if
(
!
geojson
&&
!
state
.
fileToImport
&&
state
.
fileToImport
.
size
===
0
)
return
let
formData
=
new
FormData
();
let
fileToImport
;
const
{
name
,
type
}
=
geojson
||
state
.
fileToImport
;
if
(
!
rootGetters
.
project
.
moderation
)
{
if
(
state
.
fileToImport
.
size
>
0
)
{
//* if data in a binary file, read it as text
if
(
state
.
fileToImport
&&
state
.
fileToImport
.
size
>
0
)
{
//* if data in a binary file, read it as text
const
textFile
=
await
state
.
fileToImport
.
text
();
geojson
=
JSON
.
parse
(
textFile
);
}
@@ -183,7 +182,7 @@ const feature_type = {
};
}
fileToImport
=
new
File
([
JSON
.
stringify
(
geojson
)],
name
,
{
type
});
formData
.
append
(
'
json_file
'
,
geojson
?
fileToImport
:
state
.
fileToImport
);
formData
.
append
(
'
feature_type_slug
'
,
feature_type_slug
);
let
url
=
@@ -206,7 +205,6 @@ const feature_type = {
.
catch
((
error
)
=>
{
throw
(
error
);
});
// }
},
GET_IMPORTS
({
commit
},
{
project_slug
,
feature_type
})
{
Loading