comparison client/src/components/fairway/BottleneckDialogue.vue @ 4324:36d384326407

BottleneckDialogue: Prototype for delete of surveys implemented
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 04 Sep 2019 14:39:51 +0200
parents fabe67e204e7
children 5e894e680e0d
comparison
equal deleted inserted replaced
4323:ab7d80baebe6 4324:36d384326407
304 import Feature from "ol/Feature"; 304 import Feature from "ol/Feature";
305 import LineString from "ol/geom/LineString"; 305 import LineString from "ol/geom/LineString";
306 import { displayError, displayInfo } from "@/lib/errors"; 306 import { displayError, displayInfo } from "@/lib/errors";
307 import { HTTP } from "@/lib/http"; 307 import { HTTP } from "@/lib/http";
308 import { COMPARESURVEYS } from "@/components/paneSetups"; 308 import { COMPARESURVEYS } from "@/components/paneSetups";
309 import lib from "@/lib/filters";
309 310
310 export default { 311 export default {
311 name: "profiles", 312 name: "profiles",
312 data() { 313 data() {
313 return { 314 return {
631 '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.'
632 ) 633 )
633 }); 634 });
634 }, 635 },
635 deleteSelectedSurvey() { 636 deleteSelectedSurvey() {
637 const surveyText = `${this.selectedBottleneck}: ${lib.surveyDate(
638 this.selectedSurvey.date_info
639 )}`;
636 this.$store.commit("application/popup", { 640 this.$store.commit("application/popup", {
637 icon: "trash", 641 icon: "trash",
638 title: this.$gettext("Delete survey"), 642 title: this.$gettext("Delete survey"),
639 content: 643 content:
644 `<small><b>` +
640 this.$gettext("Do you really want to delete the survey:") + 645 this.$gettext("Do you really want to delete the survey:") +
641 `<br> 646 `</b><br>
642 <b>${this.selectedBottleneck}: ${this.selectedSurvey.date_info}</b>`, 647 ${surveyText}</small>`,
643 confirm: { 648 confirm: {
644 label: this.$gettext("Delete"), 649 label: this.$gettext("Delete"),
645 icon: "trash", 650 icon: "trash",
646 callback: () => { 651 callback: () => {
647 console.log("delete selected"); 652 displayInfo({ title: this.$gettext("Not implemented") });
648 displayInfo({ title: this.$gettext("Profile deleted!") });
649 } 653 }
650 }, 654 },
651 cancel: { 655 cancel: {
652 label: this.$gettext("Cancel"), 656 label: this.$gettext("Cancel"),
653 icon: "times" 657 icon: "times"
657 deleteSelectedCut(cut) { 661 deleteSelectedCut(cut) {
658 this.$store.commit("application/popup", { 662 this.$store.commit("application/popup", {
659 icon: "trash", 663 icon: "trash",
660 title: this.$gettext("Delete cross profile"), 664 title: this.$gettext("Delete cross profile"),
661 content: 665 content:
666 `<small><b>` +
662 this.$gettext("Do you really want to delete the cross profile:") + 667 this.$gettext("Do you really want to delete the cross profile:") +
663 `<br> 668 `</b><br>
664 <b>${cut.label}</b>`, 669 ${cut.label}</small>`,
665 confirm: { 670 confirm: {
666 label: this.$gettext("Delete"), 671 label: this.$gettext("Delete"),
667 icon: "trash", 672 icon: "trash",
668 callback: () => { 673 callback: () => {
669 let previousCuts = 674 let previousCuts =