Skip to content
Snippets Groups Projects

display message if feature doesn't exist & wait response for redirect

2 files
+ 28
14
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -89,11 +89,11 @@
Attention, si vous avez déjà saisi une géométrie, celle issue de
l'image importée l'écrasera.
</p>
<div class="field">
<div class="field georef-btn">
<label>Image (png ou jpeg)</label>
<label class="ui icon button" for="image_file">
<i class="file icon"></i>
<span class="label">Sélectionner une image ...</span>
<span class="label">{{ geoRefFileLabel }}</span>
</label>
<input
type="file"
@@ -363,7 +363,13 @@ export default {
(el) => el.feature_id === this.$route.params.slug_signal
);
},
geoRefFileLabel() {
if(this.file){
return this.file.name;
}
return "Sélectionner une image ...";
}
,
selected_status: {
get() {
return this.form.status.value;
@@ -445,7 +451,6 @@ export default {
handleFileUpload() {
this.file = this.$refs.file.files[0];
console.log(">>>> 1st element in files array >>>> ", this.file);
},
georeferencement() {
@@ -471,14 +476,14 @@ export default {
type: "Feature",
geometry: {
type: "Point",
coordinates: [arr[1], arr[2]],
coordinates: [parseFloat(arr[1]), parseFloat(arr[2])],
},
properties: {},
};
self.updateMap(self.map, json);
self.updateMap(json);
self.updateGeomField(json);
// Set Attachment
//self.addAttachment(self.file)
self.addAttachment({title:"Localisation",info:"",id:"loc",attachment_file:self.file.name,fileToImport: self.file})
}
})
.catch(function (response) {
@@ -509,17 +514,21 @@ export default {
}); // * create an object with the counter in store
this.attachmentDataKey += 1; // * increment counter for key in v-for
},
addExistingAttachementFormset(attachementFormset) {
for (const attachment of attachementFormset) {
this.$store.commit("feature/ADD_ATTACHMENT_FORM", {
addAttachment(attachment){
console.log(attachment);
this.$store.commit("feature/ADD_ATTACHMENT_FORM", {
dataKey: this.attachmentDataKey,
title: attachment.title,
attachment_file: attachment.attachment_file,
info: attachment.info,
fileToImport: attachment.fileToImport,
id: attachment.id,
});
this.attachmentDataKey += 1;
},
addExistingAttachementFormset(attachementFormset) {
for (const attachment of attachementFormset) {
this.addAttachment(attachment);
}
},
@@ -857,7 +866,7 @@ export default {
const currentFeature = features.filter(
(feat) => feat.id === currentFeatureId
)[0];
this.updateMap(this.map, currentFeature);
this.updateMap( currentFeature);
}
}
})
@@ -955,7 +964,12 @@ export default {
width: 100%;
border: 1px solid grey;
}
#get-geom-from-image-file{
margin-bottom: 5px;
}
.georef-btn{
max-width: 400px;
}
@media only screen and (max-width: 767px) {
#map {
height: 80vh;
Loading