Mercurial > gemma
comparison client/src/components/fairway/BottleneckDialogue.vue @ 4402:5e894e680e0d
dsr implemented in frontend
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Mon, 16 Sep 2019 16:59:01 +0200 |
parents | 36d384326407 |
children | d336a78985ad |
comparison
equal
deleted
inserted
replaced
4401:9842812b92e0 | 4402:5e894e680e0d |
---|---|
632 'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.' | 632 'You can now select these coordinates from the "Saved cross profiles" menu to restore this cross profile.' |
633 ) | 633 ) |
634 }); | 634 }); |
635 }, | 635 }, |
636 deleteSelectedSurvey() { | 636 deleteSelectedSurvey() { |
637 const surveyText = `${this.selectedBottleneck}: ${lib.surveyDate( | 637 HTTP.post( |
638 this.selectedSurvey.date_info | 638 "/imports/dsr", |
639 )}`; | 639 { |
640 this.$store.commit("application/popup", { | 640 "bottleneck-id": this.selectedBottleneck, |
641 icon: "trash", | 641 "date-info": this.selectedSurvey.date_info |
642 title: this.$gettext("Delete survey"), | |
643 content: | |
644 `<small><b>` + | |
645 this.$gettext("Do you really want to delete the survey:") + | |
646 `</b><br> | |
647 ${surveyText}</small>`, | |
648 confirm: { | |
649 label: this.$gettext("Delete"), | |
650 icon: "trash", | |
651 callback: () => { | |
652 displayInfo({ title: this.$gettext("Not implemented") }); | |
653 } | |
654 }, | 642 }, |
655 cancel: { | 643 { |
656 label: this.$gettext("Cancel"), | 644 headers: { "X-Gemma-Auth": localStorage.getItem("token") } |
657 icon: "times" | |
658 } | 645 } |
659 }); | 646 ) |
647 .then(() => { | |
648 displayInfo({ | |
649 title: this.$gettext("Survey"), | |
650 message: | |
651 this.$gettext("Deleting ") + | |
652 `${this.selectedBottleneck}: ${this.selectedSurvey.date_info}` | |
653 }); | |
654 }) | |
655 .catch(error => { | |
656 const { status, data } = error.response; | |
657 displayError({ | |
658 title: this.$gettext("Backend Error"), | |
659 message: `${status}: ${data.message || data}` | |
660 }); | |
661 }); | |
660 }, | 662 }, |
661 deleteSelectedCut(cut) { | 663 deleteSelectedCut(cut) { |
662 this.$store.commit("application/popup", { | 664 this.$store.commit("application/popup", { |
663 icon: "trash", | 665 icon: "trash", |
664 title: this.$gettext("Delete cross profile"), | 666 title: this.$gettext("Delete cross profile"), |