Compare commits

..

No commits in common. "b851809214c2a7373257d6e767a3da6587e8a67b" and "84aa2e8820f74e371e3d38ef130789ebce59a4eb" have entirely different histories.

View file

@ -15,25 +15,23 @@
Delete
</button-->
<div class="btn-group">
<select class="form-control" v-model="selected_assignee">
<select class="form-control" v-model="ticket.assigned_to">
<option v-for="user in users" :value="user.username">{{ user.username }}</option>
</select>
<button class="form-control btn btn-success"
@click="assignTicket(ticket)"
:disabled="!selected_assignee || (selected_assignee == ticket.assigned_to)">
:disabled="!ticket.assigned_to">
Assign&nbsp;Ticket
</button>
</div>
<div class="btn-group">
<select class="form-control" v-model="selected_state">
<select class="form-control" v-model="ticket.state">
<option v-for="status in state_options" :value="status.value">{{
status.text
}}
</option>
</select>
<button class="form-control btn btn-success"
@click="changeTicketStatus(ticket)"
:disabled="(selected_state == ticket.state)">
<button class="form-control btn btn-success" @click="changeTicketStatus(ticket)">
Change&nbsp;Status
</button>
</div>
@ -73,23 +71,11 @@ export default {
name: 'Ticket',
components: {AsyncLoader, ClipboardButton, Timeline},
data() {
return {
selected_state: null,
selected_assignee: null,
shipping_voucher_type: null,
return {
shipping_voucher_type: null
}
},
watch: {
ticket(val) {
if (this.selected_state == null){
this.selected_state = val.state;
};
if(this.selected_assignee == null){
this.selected_assignee = val.assigned_to
}
}
},
computed: {
computed: {
...mapState(['tickets', 'state_options', 'users']),
...mapGetters(['availableShippingVoucherTypes']),
ticket() {
@ -101,7 +87,7 @@ export default {
const domain = document.location.hostname;
return `ticket+${this.ticket.uuid}@${domain}`;
}
},
},
methods: {
...mapActions(['deleteItem', 'markItemReturned', 'sendMail', 'updateTicketPartial', 'postComment']),
...mapActions(['loadTickets', 'fetchTicketStates', 'loadUsers', 'scheduleAfterInit']),
@ -119,17 +105,15 @@ export default {
})
},
changeTicketStatus(ticket) {
ticket.state = this.selected_state;
this.updateTicketPartial({
this.updateTicketPartial({
id: ticket.id,
state: this.selected_state,
state: ticket.state
})
},
assignTicket(ticket) {
ticket.assigned_to = this.selected_assignee;
this.updateTicketPartial({
this.updateTicketPartial({
id: ticket.id,
assigned_to: this.selected_assignee
assigned_to: ticket.assigned_to
})
},
},