MT#53076 CSC: missing time/filter/search on Conversations page (comparing to v1 CSC)

Change-Id: Id633b92a4bdbfc51596e20c94f18b41fd1616a01
mr10.5.5
CORP\franci11 2 years ago committed by Marco Capetta
parent c1fd033b99
commit fce6f21e4b

@ -17,6 +17,7 @@ export function getConversations (options) {
const type = _.get(options, 'type', null)
const from = _.get(options, 'from', '')
const to = _.get(options, 'to', '')
const direction = _.get(options, 'direction', '')
const params = {
subscriber_id: _.get(options, 'subscriberId'),
order_by: _.get(options, 'order_by', 'timestamp'),
@ -35,6 +36,9 @@ export function getConversations (options) {
if (to !== '') {
params.to = to
}
if (direction !== '') {
params.direction = direction
}
getList({
path: 'api/conversations/',
root: '_embedded.ngcp:conversations',

@ -0,0 +1,68 @@
<template>
<q-toolbar>
<q-space/>
<div
class="col-xs-12 col-md-4"
>
<q-select
v-model="filterTypeModel"
dense
:options="filterTypeOptions"
:label="$t('Filter by')"
:disable="loading"
/>
</div>
<q-space />
</q-toolbar>
</template>
<script>
export default {
name: 'CscConversationsCallsFilter',
props: {
loading: {
type: Boolean,
default: false
}
},
data () {
return {
filterTypeModel: null
}
},
watch: {
filterTypeModel () {
this.filter()
}
},
computed: {
filterType () {
return this.filterTypeModel && this.filterTypeModel.value
},
filterTypeOptions () {
return [
{
label: this.$t('Show all calls'),
value: 'AllCalls'
},
{
label: this.$t('Show outgoing calls only'),
value: 'outgoingCallsOnly'
},
{
label: this.$t('Show incoming calls only'),
value: 'incomingCallsOnly'
}
]
}
},
methods: {
filter () {
const params = {}
if (this.filterType === "incomingCallsOnly") params["direction"] = "in"
else if (this.filterType === "outgoingCallsOnly") params["direction"] = "out"
this.$emit('filter', params)
},
},
}
</script>

@ -166,6 +166,7 @@
"Filter devices": "Filter devices",
"Filter groups": "Filter groups",
"Fine": "Fine",
"Folder : ": "Folder : ",
"Forgot password?": "Forgot password?",
"Format": "Format",
"Forward to Auto Attendant": "Forward to Auto Attendant",
@ -233,6 +234,7 @@
"Manager Secretary feature": "Manager Secretary feature",
"Maximum allowed extension is {max}": "Maximum allowed extension is {max}",
"Maximum calls in queue": "Maximum calls in queue",
"Me": "Me",
"Messages": "Messages",
"Minimum allowed extension is {min}": "Minimum allowed extension is {min}",
"Mo": "Mo",
@ -387,6 +389,9 @@
"Set your voicebox settings": "Set your voicebox settings",
"Settings": "Settings",
"Shared": "Shared",
"Show all calls": "Show all calls",
"Show incoming calls only": "Show incoming calls only",
"Show outgoing calls only": "Show outgoing calls only",
"Sign In": "Sign In",
"Slot": "Slot",
"Slot {number}": "Slot {number}",

@ -29,6 +29,13 @@
:disable="listLoading"
@input="filterTab(selectedTab)"
/>
<csc-conversations-calls-filter
v-if="selectedTab === 'call'"
id="csc-conversations-calls-filter"
class="q-pb-sm"
:loading="listLoading"
@filter="filterCallDirectionEvent"
/>
</template>
<q-infinite-scroll
ref="infiniteScroll"
@ -102,6 +109,7 @@ import CscPageStickyTabs from 'components/CscPageStickyTabs'
import CscListSpinner from 'components/CscListSpinner'
import CscConversationItem from 'components/pages/Conversations/CscConversationItem'
import CscConversationsFilter from 'components/pages/Conversations/CscConversationsFilter'
import CscConversationsCallsFilter from 'components/pages/Conversations/CscConversationsCallsFilter'
import CscRemoveDialog from 'components/CscRemoveDialog'
import { mapWaitingActions } from 'vue-wait'
export default {
@ -109,6 +117,7 @@ export default {
components: {
CscRemoveDialog,
CscConversationsFilter,
CscConversationsCallsFilter,
CscConversationItem,
CscListSpinner,
CscPageStickyTabs
@ -125,6 +134,7 @@ export default {
data () {
return {
filter: undefined,
filterDirection: undefined,
topMargin: 0,
deletionId: null,
selectedTab: this.initialTab
@ -238,10 +248,14 @@ export default {
if (this.selectedTab === 'call-fax-voicemail') {
type = null
}
const fullFilters = {}
if (this.filter) Object.assign(fullFilters, this.filter)
if (this.filterDirection) Object.assign(fullFilters, this.filterDirection)
await this.nextPage({
type: type,
index: index,
filter: this.filter,
filter: fullFilters,
done: done
}).finally(() => {
this.$wait.end('csc-conversations')
@ -333,6 +347,11 @@ export default {
} else {
return this.isNumberOutgoingBlocked(item.caller)
}
},
filterCallDirectionEvent (filter) {
this.$scrollTo(this.$parent.$el)
this.filterDirection = filter
this.forceReload()
}
}
}

@ -90,7 +90,8 @@ export default {
rows: ROWS_PER_PAGE,
type: options.type,
from: _.get(options, 'filter.from', ''),
to: _.get(options, 'filter.to', '')
to: _.get(options, 'filter.to', ''),
direction: _.get(options, 'filter.direction', '')
})
context.commit('nextPageSucceeded', res)
} catch (err) {

Loading…
Cancel
Save