Compare commits

..

No commits in common. "55cef1128eaa59c79122fccc3f3ce63fed42f3e4" and "767d34f8b74664ed484819bebdb5f4bc93c39916" have entirely different histories.

9 changed files with 188 additions and 423 deletions

View file

@ -1,133 +0,0 @@
<template>
<div class="async-wrapper" :class="{ 'loaded': loaded }">
<div class="deferred">
<slot></slot>
</div>
<div class="loader-wrapper">
<div class="loader-ellipsis">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'AsyncLoader',
props: {
loaded: {
type: Boolean,
default: false
}
}
};
</script>
<style>
.async-wrapper {
position: relative;
}
.async-wrapper > .deferred {
width: 100%;
height: 100%;
display: none;
}
.async-wrapper.loaded > .deferred {
display: block;
}
.async-wrapper > .loader-wrapper {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis {
color: #17a2b8;
}
.async-wrapper.loaded > .loader-wrapper {
display: none;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis,
.async-wrapper > .loader-wrapper > .loader-ellipsis div {
box-sizing: border-box;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis div {
position: absolute;
top: 33.33333px;
width: 13.33333px;
height: 13.33333px;
border-radius: 50%;
background: currentColor;
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.async-wrapper > .loader-wrapper > .loader-ellipsis div:nth-child(1) {
left: 8px;
animation: loader-ellipsis1 0.6s infinite;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis div:nth-child(2) {
left: 8px;
animation: loader-ellipsis2 0.6s infinite;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis div:nth-child(3) {
left: 32px;
animation: loader-ellipsis2 0.6s infinite;
}
.async-wrapper > .loader-wrapper > .loader-ellipsis div:nth-child(4) {
left: 56px;
animation: loader-ellipsis3 0.6s infinite;
}
@keyframes loader-ellipsis1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes loader-ellipsis3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@keyframes loader-ellipsis2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(24px, 0);
}
}
</style>

View file

@ -29,7 +29,16 @@
</router-link> </router-link>
</li> </li>
</ul> </ul>
<SearchBox v-if="hasPermissions" class="mt-1 my-lg-auto my-xl-auto w-100 d-inline mr-1"/> <form class="form-inline mt-1 my-lg-auto my-xl-auto w-100 d-inline mr-1" v-if="hasPermissions">
<input
class="form-control w-100"
type="search"
placeholder="Search"
aria-label="Search"
@input="searchEventItems($event.target.value)"
disabled
>
</form>
<div class="custom-control-inline mr-1" v-if="hasPermissions"> <div class="custom-control-inline mr-1" v-if="hasPermissions">
<div class="btn-group btn-group-toggle mr-1" v-if="isItemView()"> <div class="btn-group btn-group-toggle mr-1" v-if="isItemView()">
<button :class="['btn', 'btn-info', { active: layout === 'cards' }]" @click="setLayout('cards')"> <button :class="['btn', 'btn-info', { active: layout === 'cards' }]" @click="setLayout('cards')">
@ -94,13 +103,9 @@
<script> <script>
import {mapState, mapActions, mapMutations, mapGetters} from 'vuex'; import {mapState, mapActions, mapMutations, mapGetters} from 'vuex';
import SearchBox from "@/components/inputs/SearchBox.vue";
export default { export default {
name: 'Navbar', name: 'Navbar',
components: {
SearchBox
},
data: () => ({ data: () => ({
views: [ views: [
{'title': 'items', 'path': 'items'}, {'title': 'items', 'path': 'items'},
@ -117,7 +122,7 @@ export default {
...mapGetters(['getEventSlug', 'getActiveView', "checkPermission", "hasPermissions", "layout", "route"]), ...mapGetters(['getEventSlug', 'getActiveView', "checkPermission", "hasPermissions", "layout", "route"]),
}, },
methods: { methods: {
...mapActions(['changeEvent', 'changeView']), ...mapActions(['changeEvent', 'changeView', 'searchEventItems']),
...mapMutations(['logout']), ...mapMutations(['logout']),
navigateTo(link) { navigateTo(link) {
if (this.route.path !== link) if (this.route.path !== link)

View file

@ -40,10 +40,10 @@
<div class=""> <div class="">
<textarea placeholder="add comment..." v-model="newComment" class="form-control"> <textarea placeholder="add comment..." v-model="newComment" class="form-control">
</textarea> </textarea>
<AsyncButton class="btn btn-primary float-right" :task="addCommentAndClear"> <button class="btn btn-primary float-right" @click="addCommentAndClear">
<font-awesome-icon icon="comment"/> <font-awesome-icon icon="comment"/>
Save Comment Save Comment
</AsyncButton> </button>
</div> </div>
</div> </div>
</li> </li>
@ -58,10 +58,10 @@
<div> <div>
<textarea placeholder="reply mail..." v-model="newMail" class="form-control"> <textarea placeholder="reply mail..." v-model="newMail" class="form-control">
</textarea> </textarea>
<AsyncButton class="btn btn-primary float-right" :task="sendMailAndClear"> <button class="btn btn-primary float-right" @click="sendMailAndClear">
<font-awesome-icon icon="envelope"/> <font-awesome-icon icon="envelope"/>
Send Mail Send Mail
</AsyncButton> </button>
</div> </div>
</div> </div>
</li> </li>
@ -77,12 +77,11 @@ import {mapActions, mapGetters} from "vuex";
import TimelineAssignment from "@/components/TimelineAssignment.vue"; import TimelineAssignment from "@/components/TimelineAssignment.vue";
import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue"; import TimelineRelatedItem from "@/components/TimelineRelatedItem.vue";
import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue"; import TimelineShippingVoucher from "@/components/TimelineShippingVoucher.vue";
import AsyncButton from "@/components/inputs/AsyncButton.vue";
export default { export default {
name: 'Timeline', name: 'Timeline',
components: { components: {
TimelineShippingVoucher, AsyncButton, TimelineShippingVoucher,
TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail TimelineRelatedItem, TimelineAssignment, TimelineStateChange, TimelineComment, TimelineMail
}, },
props: { props: {
@ -104,15 +103,18 @@ export default {
}, },
}, },
methods: { methods: {
...mapActions(['sendMail', 'postComment']), ...mapActions(['fetchShippingVouchers']),
sendMailAndClear: async function () { sendMailAndClear: function () {
await this.sendMail(this.newMail); this.$emit('sendMail', this.newMail);
this.newMail = ""; this.newMail = "";
}, },
addCommentAndClear: async function () { addCommentAndClear: function () {
await this.postComment(this.newComment); this.$emit('addComment', this.newComment);
this.newComment = ""; this.newComment = "";
} }
},
mounted() {
this.fetchShippingVouchers();
} }
}; };
</script> </script>

View file

@ -1,47 +0,0 @@
<template>
<button @click.stop="handleClick" :disabled="disabled">
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"
:class="{'d-none': !disabled}"></span>
<span class="ml-2" :class="{'d-none': !disabled}">In Progress...</span>
<span :class="{'d-none': disabled}"><slot></slot></span>
</button>
</template>
<script>
export default {
name: 'AsyncButton',
data() {
return {
disabled: false,
};
},
props: {
task: {
type: Function,
required: true,
},
},
methods: {
async handleClick() {
console.log("AsyncButton.handleClick() called");
if (this.task && typeof this.task === 'function') {
this.disabled = true;
try {
await this.task();
} catch (e) {
console.error(e);
} finally {
this.disabled = false;
}
}
},
}
};
</script>
<style scoped>
.spinner-border {
vertical-align: -0.125em;
}
</style>

View file

@ -1,43 +0,0 @@
<template>
<input
class="form-control w-100"
type="search"
placeholder="Search"
aria-label="Search"
v-model="search_query"
@keyup.enter="dispatchSearch"
>
</template>
<script>
import {mapActions, mapGetters} from "vuex";
export default {
name: 'SearchBox',
data() {
return {
search_query: ''
}
},
computed: {
...mapGetters(['getActiveView'])
},
methods: {
...mapActions(['searchEventItems', 'searchEventTickets']),
isItemView() {
return this.getActiveView === 'items' || this.getActiveView === 'item';
},
isTicketView() {
return this.getActiveView === 'tickets' || this.getActiveView === 'ticket';
},
dispatchSearch() {
if (this.isItemView()) {
this.searchEventItems(this.search_query);
} else if (this.isTicketView()) {
this.searchEventTickets(this.search_query);
}
}
}
};
</script>

View file

@ -23,7 +23,6 @@ const store = createStore({
lastEvent: '37C3', lastEvent: '37C3',
lastUsed: {}, lastUsed: {},
searchQuery: '',
remember: false, remember: false,
user: { user: {
username: null, username: null,
@ -356,9 +355,10 @@ const store = createStore({
} }
}, },
async searchEventItems({commit, getters, state}, query) { async searchEventItems({commit, getters, state}, query) {
const encoded_query = base64.encode(utf8.encode(query)); const foo = utf8.encode(query);
const bar = base64.encode(foo);
const {data, success} = await http.get(`/2/${getters.getEventSlug}/items/${encoded_query}/`, state.user.token); const {data, success} = await http.get(`/2/${getters.getEventSlug}/items/${bar}/`, state.user.token);
if (data && success) if (data && success)
commit('replaceLoadedItems', data); commit('replaceLoadedItems', data);
}, },
@ -407,13 +407,6 @@ const store = createStore({
if (data && success) if (data && success)
commit('replaceTickets', data); commit('replaceTickets', data);
}, },
async searchEventTickets({commit, getters, state}, query) {
const encoded_query = base64.encode(utf8.encode(query));
const {data, success} = await http.get(`/2/${getters.getEventSlug}/tickets/${encoded_query}/`, state.user.token);
if (data && success)
commit('replaceTickets', data);
},
async sendMail({commit, dispatch, state}, {id, message}) { async sendMail({commit, dispatch, state}, {id, message}) {
const {data, success} = await http.post(`/2/tickets/${id}/reply/`, {message}, state.user.token); const {data, success} = await http.post(`/2/tickets/${id}/reply/`, {message}, state.user.token);
if (data && success) { if (data && success) {

View file

@ -1,82 +1,77 @@
<template> <template>
<AsyncLoader :loaded="loadedItems.length > 0"> <div class="container-fluid px-xl-5 mt-3">
<div class="container-fluid px-xl-5 mt-3"> <Modal title="Edit Item" v-if="editingItem" @close="closeEditingModal()">
<Modal title="Edit Item" v-if="editingItem" @close="closeEditingModal()"> <template #body>
<template #body> <EditItem
<EditItem :item="editingItem"
:item="editingItem" badge="uid"
badge="uid"
/>
</template>
<template #buttons>
<button type="button" class="btn btn-secondary" @click="closeEditingModal()">Cancel</button>
<button type="button" class="btn btn-success" @click="saveEditingItem()">Save Changes</button>
</template>
</Modal>
<Lightbox v-if="lightboxHash" :hash="lightboxHash" @close="closeLightboxModal()"/>
<div class="row" v-if="layout === 'table'">
<div class="col-xl-8 offset-xl-2">
<Table
:columns="['uid', 'description', 'box']"
:items="loadedItems"
:keyName="'uid'"
@itemActivated="openLightboxModalWith($event)"
>
<template #actions="{ item }">
<div class="btn-group">
<button class="btn btn-success"
@click.stop="confirm('return Item?') && markItemReturned(item)"
title="returned">
<font-awesome-icon icon="check"/>
</button>
<button class="btn btn-secondary" @click.stop="openEditingModalWith(item)" title="edit">
<font-awesome-icon icon="edit"/>
</button>
<button class="btn btn-danger" @click.stop="confirm('delete Item?') && deleteItem(item)"
title="delete">
<font-awesome-icon icon="trash"/>
</button>
</div>
</template>
</Table>
</div>
</div>
<Cards
v-if="layout === 'cards'"
:columns="['uid', 'description', 'box']"
:items="loadedItems"
:keyName="'uid'"
v-slot="{ item }"
@itemActivated="openLightboxModalWith($event)"
>
<AuthenticatedImage v-if="item.file" cached
:src="`/media/2/256/${item.file}/`"
class="card-img-top img-fluid"
/> />
<div class="card-body"> </template>
<h6 class="card-title">{{ item.description }}</h6> <template #buttons>
<h6 class="card-subtitle text-secondary">uid: {{ item.uid }} box: {{ item.box }}</h6> <button type="button" class="btn btn-secondary" @click="closeEditingModal()">Cancel</button>
<div class="row mx-auto mt-2"> <button type="button" class="btn btn-success" @click="saveEditingItem()">Save Changes</button>
</template>
</Modal>
<Lightbox v-if="lightboxHash" :hash="lightboxHash" @close="closeLightboxModal()"/>
<div class="row" v-if="layout === 'table'">
<div class="col-xl-8 offset-xl-2">
<Table
:columns="['uid', 'description', 'box']"
:items="loadedItems"
:keyName="'uid'"
@itemActivated="openLightboxModalWith($event)"
>
<template #actions="{ item }">
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-outline-success" <button class="btn btn-success"
@click.stop="confirm('return Item?') && markItemReturned(item)" title="returned"> @click.stop="confirm('return Item?') && markItemReturned(item)" title="returned">
<font-awesome-icon icon="check"/> <font-awesome-icon icon="check"/>
</button> </button>
<button class="btn btn-outline-secondary" @click.stop="openEditingModalWith(item)" <button class="btn btn-secondary" @click.stop="openEditingModalWith(item)" title="edit">
title="edit">
<font-awesome-icon icon="edit"/> <font-awesome-icon icon="edit"/>
</button> </button>
<button class="btn btn-outline-danger" <button class="btn btn-danger" @click.stop="confirm('delete Item?') && deleteItem(item)"
@click.stop="confirm('delete Item?') && deleteItem(item)"
title="delete"> title="delete">
<font-awesome-icon icon="trash"/> <font-awesome-icon icon="trash"/>
</button> </button>
</div> </div>
</template>
</Table>
</div>
</div>
<Cards
v-if="layout === 'cards'"
:columns="['uid', 'description', 'box']"
:items="loadedItems"
:keyName="'uid'"
v-slot="{ item }"
@itemActivated="openLightboxModalWith($event)"
>
<AuthenticatedImage v-if="item.file" cached
:src="`/media/2/256/${item.file}/`"
class="card-img-top img-fluid"
/>
<div class="card-body">
<h6 class="card-title">{{ item.description }}</h6>
<h6 class="card-subtitle text-secondary">uid: {{ item.uid }} box: {{ item.box }}</h6>
<div class="row mx-auto mt-2">
<div class="btn-group">
<button class="btn btn-outline-success"
@click.stop="confirm('return Item?') && markItemReturned(item)" title="returned">
<font-awesome-icon icon="check"/>
</button>
<button class="btn btn-outline-secondary" @click.stop="openEditingModalWith(item)" title="edit">
<font-awesome-icon icon="edit"/>
</button>
<button class="btn btn-outline-danger" @click.stop="confirm('delete Item?') && deleteItem(item)"
title="delete">
<font-awesome-icon icon="trash"/>
</button>
</div> </div>
</div> </div>
</Cards> </div>
</div> </Cards>
</AsyncLoader> </div>
</template> </template>
<script> <script>
@ -87,7 +82,6 @@ import EditItem from '@/components/EditItem';
import {mapActions, mapGetters, mapState} from 'vuex'; import {mapActions, mapGetters, mapState} from 'vuex';
import Lightbox from '../components/Lightbox'; import Lightbox from '../components/Lightbox';
import AuthenticatedImage from "@/components/AuthenticatedImage.vue"; import AuthenticatedImage from "@/components/AuthenticatedImage.vue";
import AsyncLoader from "@/components/AsyncLoader.vue";
export default { export default {
name: 'Items', name: 'Items',
@ -95,7 +89,7 @@ export default {
lightboxHash: null, lightboxHash: null,
editingItem: null, editingItem: null,
}), }),
components: {AsyncLoader, AuthenticatedImage, Lightbox, Table, Cards, Modal, EditItem}, components: {AuthenticatedImage, Lightbox, Table, Cards, Modal, EditItem},
computed: { computed: {
...mapState(['loadedItems']), ...mapState(['loadedItems']),
...mapGetters(['layout']), ...mapGetters(['layout']),

View file

@ -1,77 +1,74 @@
<template> <template>
<AsyncLoader :loaded="ticket.id"> <div class="container-fluid px-xl-5 mt-3">
<div class="container-fluid px-xl-5 mt-3"> <div class="row">
<div class="row"> <div class="col-xl-8 offset-xl-2">
<div class="col-xl-8 offset-xl-2"> <div class="card bg-dark text-light mb-2" id="filters">
<div class="card bg-dark text-light mb-2" id="filters"> <div class="card-header">
<div class="card-header"> <h3>Ticket #{{ ticket.id }} - {{ ticket.name }}</h3>
<h3>Ticket #{{ ticket.id }} - {{ ticket.name }}</h3> </div>
<Timeline :timeline="ticket.timeline" @sendMail="handleMail" @addComment="handleComment"/>
<div class="card-footer d-flex justify-content-between">
<button class="btn btn-secondary mr-2" @click="$router.go(-1)">Back</button>
<!--button class="btn btn-danger" @click="deleteItem({type: 'tickets', id: ticket.id})">
<font-awesome-icon icon="trash"/>
Delete
</button-->
<div class="btn-group">
<select class="form-control" v-model="selected_assignee">
<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)">
Assign&nbsp;Ticket
</button>
</div> </div>
<Timeline :timeline="ticket.timeline" @sendMail="handleMail" @addComment="handleComment"/> <div class="btn-group">
<div class="card-footer d-flex justify-content-between"> <select class="form-control" v-model="selected_state">
<button class="btn btn-secondary mr-2" @click="$router.go(-1)">Back</button> <option v-for="status in state_options" :value="status.value">{{
<!--button class="btn btn-danger" @click="deleteItem({type: 'tickets', id: ticket.id})"> status.text
<font-awesome-icon icon="trash"/> }}
Delete </option>
</button--> </select>
<div class="btn-group"> <button class="form-control btn btn-success"
<select class="form-control" v-model="selected_assignee"> @click="changeTicketStatus(ticket)"
<option v-for="user in users" :value="user.username">{{ user.username }}</option> :disabled="(selected_state == ticket.state)">
</select> Change&nbsp;Status
<button class="form-control btn btn-success" </button>
@click="assignTicket(ticket)"
:disabled="!selected_assignee || (selected_assignee == ticket.assigned_to)">
Assign&nbsp;Ticket
</button>
</div>
<div class="btn-group">
<select class="form-control" v-model="selected_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)">
Change&nbsp;Status
</button>
</div>
</div> </div>
<div class="card-footer d-flex justify-content-between"> </div>
<ClipboardButton :payload="shippingEmail" class="btn btn-primary"> <div class="card-footer d-flex justify-content-between">
<font-awesome-icon icon="clipboard"/> <ClipboardButton :payload="shippingEmail" class="btn btn-primary">
Copy&nbsp;DHL&nbsp;contact&nbsp;to&nbsp;clipboard <font-awesome-icon icon="clipboard"/>
</ClipboardButton> Copy&nbsp;DHL&nbsp;contact&nbsp;to&nbsp;clipboard
<div class="btn-group"> </ClipboardButton>
<select class="form-control" v-model="shipping_voucher_type"> <div class="btn-group">
<option v-for="type in availableShippingVoucherTypes.filter(t=>t.count>0)" <select class="form-control" v-model="shipping_voucher_type">
:value="type.id">{{ type.name }} <option v-for="type in availableShippingVoucherTypes.filter(t=>t.count>0)"
</option> :value="type.id">{{ type.name }}
</select> </option>
<button class="form-control btn btn-success" </select>
@click="claimShippingVoucher({ticket: ticket.id, shipping_voucher_type}).then(()=>shipping_voucher_type=null)" <button class="form-control btn btn-success"
:disabled="!shipping_voucher_type"> @click="claimShippingVoucher({ticket: ticket.id, shipping_voucher_type}).then(()=>shipping_voucher_type=null)"
Claim&nbsp;Shipping&nbsp;Voucher :disabled="!shipping_voucher_type">
</button> Claim&nbsp;Shipping&nbsp;Voucher
</div> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</AsyncLoader> </div>
</template> </template>
<script> <script>
import {mapActions, mapGetters, mapState} from 'vuex'; import {mapActions, mapGetters, mapState} from 'vuex';
import Timeline from "@/components/Timeline.vue"; import Timeline from "@/components/Timeline.vue";
import ClipboardButton from "@/components/inputs/ClipboardButton.vue"; import ClipboardButton from "@/components/inputs/ClipboardButton.vue";
import AsyncLoader from "@/components/AsyncLoader.vue";
export default { export default {
name: 'Ticket', name: 'Ticket',
components: {AsyncLoader, ClipboardButton, Timeline}, components: {ClipboardButton, Timeline},
data() { data() {
return { return {
selected_state: null, selected_state: null,

View file

@ -1,53 +1,51 @@
<template> <template>
<AsyncLoader :loaded="tickets.length > 0"> <div class="container-fluid px-xl-5 mt-3">
<div class="container-fluid px-xl-5 mt-3"> <div class="row">
<div class="row"> <div class="col-xl-8 offset-xl-2">
<div class="col-xl-8 offset-xl-2"> <Table
<Table :columns="['id', 'name', 'state', 'last_activity', 'assigned_to']"
:columns="['id', 'name', 'state', 'last_activity', 'assigned_to', 'actions', 'actions2']" :items="tickets"
:items="tickets.map(formatTicket)" :keyName="'id'"
:keyName="'id'" v-if="layout === 'table'"
v-if="layout === 'table'" >
> <template #actions="{ item }">
<template v-slot:actions="{item}"> <div class="btn-group">
<div class="btn-group"> <a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view"
<a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view" @click.prevent="gotoDetail(item)">
@click.prevent="gotoDetail(item)"> <font-awesome-icon icon="eye"/>
<font-awesome-icon icon="eye"/> View
View </a>
</a> </div>
</div> </template>
</template> </Table>
</Table>
</div>
</div> </div>
<CollapsableCards v-if="layout === 'tasks'" :items="tickets"
:columns="['id', 'name', 'last_activity', 'assigned_to']"
:keyName="'state'" :sections="['pending_new', 'pending_open','pending_shipping',
'pending_physical_confirmation','pending_return','pending_postponed'].map(stateInfo)">
<template #section_header="{index, section, count}">
{{ section.text }} <span class="badge badge-light ml-1">{{ count }}</span>
</template>
<template #section_body="{item}">
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>{{ item.last_activity }}</td>
<td>{{ item.assigned_to }}</td>
<td>
<div class="btn-group">
<a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view"
@click.prevent="gotoDetail(item)">
<font-awesome-icon icon="eye"/>
View
</a>
</div>
</td>
</tr>
</template>
</CollapsableCards>
</div> </div>
</AsyncLoader> <CollapsableCards v-if="layout === 'tasks'" :items="tickets"
:columns="['id', 'name', 'last_activity', 'assigned_to']"
:keyName="'state'" :sections="['pending_new', 'pending_open','pending_shipping',
'pending_physical_confirmation','pending_return','pending_postponed'].map(stateInfo)">
<template #section_header="{index, section, count}">
{{ section.text }} <span class="badge badge-light ml-1">{{ count }}</span>
</template>
<template #section_body="{item}">
<tr>
<td>{{ item.id }}</td>
<td>{{ item.name }}</td>
<td>{{ item.last_activity }}</td>
<td>{{ item.assigned_to }}</td>
<td>
<div class="btn-group">
<a class="btn btn-primary" :href="'/'+ getEventSlug + '/ticket/' + item.id" title="view"
@click.prevent="gotoDetail(item)">
<font-awesome-icon icon="eye"/>
View
</a>
</div>
</td>
</tr>
</template>
</CollapsableCards>
</div>
</template> </template>
<script> <script>
@ -58,11 +56,10 @@ import {mapActions, mapGetters, mapState} from 'vuex';
import Lightbox from '../components/Lightbox'; import Lightbox from '../components/Lightbox';
import Table from '@/components/Table'; import Table from '@/components/Table';
import CollapsableCards from "@/components/CollapsableCards.vue"; import CollapsableCards from "@/components/CollapsableCards.vue";
import AsyncLoader from "@/components/AsyncLoader.vue";
export default { export default {
name: 'Tickets', name: 'Tickets',
components: {AsyncLoader, Lightbox, Table, Cards, Modal, EditItem, CollapsableCards}, components: {Lightbox, Table, Cards, Modal, EditItem, CollapsableCards},
computed: { computed: {
...mapState(['tickets']), ...mapState(['tickets']),
...mapGetters(['stateInfo', 'getEventSlug', 'layout']), ...mapGetters(['stateInfo', 'getEventSlug', 'layout']),