comparison client/src/components/importschedule/Importschedule.vue @ 1771:88b8da513944

deactivate delete and edit action during editing
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 11 Jan 2019 11:33:34 +0100
parents 25e6cf028b78
children f9ac2d4d2069
comparison
equal deleted inserted replaced
1770:ad9622a3f751 1771:88b8da513944
55 icon="check" 55 icon="check"
56 ></font-awesome-icon> 56 ></font-awesome-icon>
57 </td> 57 </td>
58 <td> 58 <td>
59 <font-awesome-icon 59 <font-awesome-icon
60 :style="activeStyle"
60 @click="editSchedule(schedule.id)" 61 @click="editSchedule(schedule.id)"
61 icon="pencil-alt" 62 icon="pencil-alt"
62 fixed-width 63 fixed-width
63 ></font-awesome-icon> 64 ></font-awesome-icon>
64 </td> 65 </td>
65 <td> 66 <td>
66 <font-awesome-icon 67 <font-awesome-icon
68 :style="activeStyle"
67 @click="deleteSchedule(schedule.id)" 69 @click="deleteSchedule(schedule.id)"
68 icon="trash" 70 icon="trash"
69 fixed-width 71 fixed-width
70 ></font-awesome-icon> 72 ></font-awesome-icon>
71 </td> 73 </td>
176 }, 178 },
177 newImport() { 179 newImport() {
178 this.$store.commit("imports/setImportScheduleDetailVisible"); 180 this.$store.commit("imports/setImportScheduleDetailVisible");
179 }, 181 },
180 deleteSchedule(index) { 182 deleteSchedule(index) {
183 if (this.importScheduleDetailVisible) return;
181 this.$store 184 this.$store
182 .dispatch("imports/deleteSchedule", index) 185 .dispatch("imports/deleteSchedule", index)
183 .then(() => { 186 .then(() => {
184 this.getSchedules(); 187 this.getSchedules();
188 displayInfo({
189 title: this.$gettext("Imports"),
190 message: this.$gettext("Deleted import: #") + index
191 });
185 }) 192 })
186 .catch(error => { 193 .catch(error => {
187 const { status, data } = error.response; 194 const { status, data } = error.response;
188 displayError({ 195 displayError({
189 title: this.$gettext("Backend Error"), 196 title: this.$gettext("Backend Error"),
193 } 200 }
194 }, 201 },
195 computed: { 202 computed: {
196 ...mapState("application", ["showSidebar"]), 203 ...mapState("application", ["showSidebar"]),
197 ...mapState("imports", ["schedules", "importScheduleDetailVisible"]), 204 ...mapState("imports", ["schedules", "importScheduleDetailVisible"]),
205 activeStyle() {
206 const color = this.importScheduleDetailVisible ? "#aeaeae" : "#000000";
207 return { color: color };
208 },
198 spacerStyle() { 209 spacerStyle() {
199 return [ 210 return [
200 "spacer ml-3", 211 "spacer ml-3",
201 { 212 {
202 "spacer-expanded": this.showSidebar, 213 "spacer-expanded": this.showSidebar,