Skip to content
Snippets Groups Projects
Commit fdb21e45 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Merge branch 'develop' into anom/redmine-ticket-11742-suppression-impossible-signal

parents 255327e9 d9e44d58
No related branches found
No related tags found
1 merge request!51display message if feature doesn't exist & wait response for redirect
This commit is part of merge request !51. Comments created here will be created in the context of that merge request.
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
Attention, si vous avez déjà saisi une géométrie, celle issue de Attention, si vous avez déjà saisi une géométrie, celle issue de
l'image importée l'écrasera. l'image importée l'écrasera.
</p> </p>
<div class="field"> <div class="field georef-btn">
<label>Image (png ou jpeg)</label> <label>Image (png ou jpeg)</label>
<label class="ui icon button" for="image_file"> <label class="ui icon button" for="image_file">
<i class="file icon"></i> <i class="file icon"></i>
<span class="label">Sélectionner une image ...</span> <span class="label">{{ geoRefFileLabel }}</span>
</label> </label>
<input <input
type="file" type="file"
...@@ -363,7 +363,13 @@ export default { ...@@ -363,7 +363,13 @@ export default {
(el) => el.feature_id === this.$route.params.slug_signal (el) => el.feature_id === this.$route.params.slug_signal
); );
}, },
geoRefFileLabel() {
if(this.file){
return this.file.name;
}
return "Sélectionner une image ...";
}
,
selected_status: { selected_status: {
get() { get() {
return this.form.status.value; return this.form.status.value;
...@@ -445,7 +451,6 @@ export default { ...@@ -445,7 +451,6 @@ export default {
handleFileUpload() { handleFileUpload() {
this.file = this.$refs.file.files[0]; this.file = this.$refs.file.files[0];
console.log(">>>> 1st element in files array >>>> ", this.file);
}, },
georeferencement() { georeferencement() {
...@@ -471,14 +476,14 @@ export default { ...@@ -471,14 +476,14 @@ export default {
type: "Feature", type: "Feature",
geometry: { geometry: {
type: "Point", type: "Point",
coordinates: [arr[1], arr[2]], coordinates: [parseFloat(arr[1]), parseFloat(arr[2])],
}, },
properties: {}, properties: {},
}; };
self.updateMap(self.map, json); self.updateMap(json);
self.updateGeomField(json); self.updateGeomField(json);
// Set Attachment // Set Attachment
//self.addAttachment(self.file) self.addAttachment({title:"Localisation",info:"",id:"loc",attachment_file:self.file.name,fileToImport: self.file})
} }
}) })
.catch(function (response) { .catch(function (response) {
...@@ -509,17 +514,21 @@ export default { ...@@ -509,17 +514,21 @@ export default {
}); // * create an object with the counter in store }); // * create an object with the counter in store
this.attachmentDataKey += 1; // * increment counter for key in v-for this.attachmentDataKey += 1; // * increment counter for key in v-for
}, },
addAttachment(attachment){
addExistingAttachementFormset(attachementFormset) { console.log(attachment);
for (const attachment of attachementFormset) { this.$store.commit("feature/ADD_ATTACHMENT_FORM", {
this.$store.commit("feature/ADD_ATTACHMENT_FORM", {
dataKey: this.attachmentDataKey, dataKey: this.attachmentDataKey,
title: attachment.title, title: attachment.title,
attachment_file: attachment.attachment_file, attachment_file: attachment.attachment_file,
info: attachment.info, info: attachment.info,
fileToImport: attachment.fileToImport,
id: attachment.id, id: attachment.id,
}); });
this.attachmentDataKey += 1; this.attachmentDataKey += 1;
},
addExistingAttachementFormset(attachementFormset) {
for (const attachment of attachementFormset) {
this.addAttachment(attachment);
} }
}, },
...@@ -857,7 +866,7 @@ export default { ...@@ -857,7 +866,7 @@ export default {
const currentFeature = features.filter( const currentFeature = features.filter(
(feat) => feat.id === currentFeatureId (feat) => feat.id === currentFeatureId
)[0]; )[0];
this.updateMap(this.map, currentFeature); this.updateMap( currentFeature);
} }
} }
}) })
...@@ -955,7 +964,12 @@ export default { ...@@ -955,7 +964,12 @@ export default {
width: 100%; width: 100%;
border: 1px solid grey; border: 1px solid grey;
} }
#get-geom-from-image-file{
margin-bottom: 5px;
}
.georef-btn{
max-width: 400px;
}
@media only screen and (max-width: 767px) { @media only screen and (max-width: 767px) {
#map { #map {
height: 80vh; height: 80vh;
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
:to="{ :to="{
name: 'details-type-signalement', name: 'details-type-signalement',
params: { params: {
feature_type_slug: feature.properties.feature_type.title, feature_type_slug: feature.properties.feature_type.slug,
}, },
}" }"
> >
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment