diff --git a/components/EditMenu.vue b/components/EditMenu.vue index 2789ca4..aee187d 100644 --- a/components/EditMenu.vue +++ b/components/EditMenu.vue @@ -55,7 +55,7 @@ export default { } this.$store.commit('showEditMenu', null) if (confirmed) { - this.deleteDepartment() + this.deleteDepartment(this.activeDepartment) } }, addDept: function() { diff --git a/components/ShowPerson.vue b/components/ShowPerson.vue index b429f20..bc1a530 100644 --- a/components/ShowPerson.vue +++ b/components/ShowPerson.vue @@ -59,6 +59,7 @@ span.role {{assignment.role}} div button.btn1(v-if="showPerson.new" @click='addEmployee(showPerson)' :disabled='!employeeID || !employeeName') ADD + button.btn2(v-if="editMode" @click='deleteEmployee1(showPerson)' title='Removes the user from all departments and completely deletes the user') Delete this user @@ -134,7 +135,8 @@ export default { 'setShowPersonProperty', 'addPerson', 'updateActiveDepartmentManager', - 'addAssignment' + 'addAssignment', + 'deleteEmployee' ]), ...mapActions(['setShowDepartment']), goto(d) { @@ -162,6 +164,15 @@ export default { value: value }) }, + deleteEmployee1(person) { + console.log('Deleting', person) + if ( + confirm('This will remove the person completely. Continue?') + ) { + this.deleteEmployee(person) + this.setShowPerson(null) + } + }, addEmployee(person) { console.log('adding', person) if (this.people.find(p => p.id == person.id)) { @@ -307,6 +318,14 @@ table td * { background-color: lightgrey; cursor: not-allowed; } +.btn2 { + padding: 5px 20px; + border: 2px solid red; + border-radius: 5px; + color: white; + background-color: red; + cursor: pointer; +} .nophoto { font-size: 200px; color: lightgrey; diff --git a/docs/200.html b/docs/200.html index 5b8adef..7192db0 100644 --- a/docs/200.html +++ b/docs/200.html @@ -1,9 +1,9 @@
-