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 type = _.get(options, 'type', null)
const from = _.get(options, 'from', '') const from = _.get(options, 'from', '')
const to = _.get(options, 'to', '') const to = _.get(options, 'to', '')
const direction = _.get(options, 'direction', '')
const params = { const params = {
subscriber_id: _.get(options, 'subscriberId'), subscriber_id: _.get(options, 'subscriberId'),
order_by: _.get(options, 'order_by', 'timestamp'), order_by: _.get(options, 'order_by', 'timestamp'),
@ -35,6 +36,9 @@ export function getConversations (options) {
if (to !== '') { if (to !== '') {
params.to = to params.to = to
} }
if (direction !== '') {
params.direction = direction
}
getList({ getList({
path: 'api/conversations/', path: 'api/conversations/',
root: '_embedded.ngcp: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 devices": "Filter devices",
"Filter groups": "Filter groups", "Filter groups": "Filter groups",
"Fine": "Fine", "Fine": "Fine",
"Folder : ": "Folder : ",
"Forgot password?": "Forgot password?", "Forgot password?": "Forgot password?",
"Format": "Format", "Format": "Format",
"Forward to Auto Attendant": "Forward to Auto Attendant", "Forward to Auto Attendant": "Forward to Auto Attendant",
@ -233,6 +234,7 @@
"Manager Secretary feature": "Manager Secretary feature", "Manager Secretary feature": "Manager Secretary feature",
"Maximum allowed extension is {max}": "Maximum allowed extension is {max}", "Maximum allowed extension is {max}": "Maximum allowed extension is {max}",
"Maximum calls in queue": "Maximum calls in queue", "Maximum calls in queue": "Maximum calls in queue",
"Me": "Me",
"Messages": "Messages", "Messages": "Messages",
"Minimum allowed extension is {min}": "Minimum allowed extension is {min}", "Minimum allowed extension is {min}": "Minimum allowed extension is {min}",
"Mo": "Mo", "Mo": "Mo",
@ -387,6 +389,9 @@
"Set your voicebox settings": "Set your voicebox settings", "Set your voicebox settings": "Set your voicebox settings",
"Settings": "Settings", "Settings": "Settings",
"Shared": "Shared", "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", "Sign In": "Sign In",
"Slot": "Slot", "Slot": "Slot",
"Slot {number}": "Slot {number}", "Slot {number}": "Slot {number}",

@ -29,6 +29,13 @@
:disable="listLoading" :disable="listLoading"
@input="filterTab(selectedTab)" @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> </template>
<q-infinite-scroll <q-infinite-scroll
ref="infiniteScroll" ref="infiniteScroll"
@ -102,6 +109,7 @@ import CscPageStickyTabs from 'components/CscPageStickyTabs'
import CscListSpinner from 'components/CscListSpinner' import CscListSpinner from 'components/CscListSpinner'
import CscConversationItem from 'components/pages/Conversations/CscConversationItem' import CscConversationItem from 'components/pages/Conversations/CscConversationItem'
import CscConversationsFilter from 'components/pages/Conversations/CscConversationsFilter' import CscConversationsFilter from 'components/pages/Conversations/CscConversationsFilter'
import CscConversationsCallsFilter from 'components/pages/Conversations/CscConversationsCallsFilter'
import CscRemoveDialog from 'components/CscRemoveDialog' import CscRemoveDialog from 'components/CscRemoveDialog'
import { mapWaitingActions } from 'vue-wait' import { mapWaitingActions } from 'vue-wait'
export default { export default {
@ -109,6 +117,7 @@ export default {
components: { components: {
CscRemoveDialog, CscRemoveDialog,
CscConversationsFilter, CscConversationsFilter,
CscConversationsCallsFilter,
CscConversationItem, CscConversationItem,
CscListSpinner, CscListSpinner,
CscPageStickyTabs CscPageStickyTabs
@ -125,6 +134,7 @@ export default {
data () { data () {
return { return {
filter: undefined, filter: undefined,
filterDirection: undefined,
topMargin: 0, topMargin: 0,
deletionId: null, deletionId: null,
selectedTab: this.initialTab selectedTab: this.initialTab
@ -238,10 +248,14 @@ export default {
if (this.selectedTab === 'call-fax-voicemail') { if (this.selectedTab === 'call-fax-voicemail') {
type = null type = null
} }
const fullFilters = {}
if (this.filter) Object.assign(fullFilters, this.filter)
if (this.filterDirection) Object.assign(fullFilters, this.filterDirection)
await this.nextPage({ await this.nextPage({
type: type, type: type,
index: index, index: index,
filter: this.filter, filter: fullFilters,
done: done done: done
}).finally(() => { }).finally(() => {
this.$wait.end('csc-conversations') this.$wait.end('csc-conversations')
@ -333,6 +347,11 @@ export default {
} else { } else {
return this.isNumberOutgoingBlocked(item.caller) 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, rows: ROWS_PER_PAGE,
type: options.type, type: options.type,
from: _.get(options, 'filter.from', ''), from: _.get(options, 'filter.from', ''),
to: _.get(options, 'filter.to', '') to: _.get(options, 'filter.to', ''),
direction: _.get(options, 'filter.direction', '')
}) })
context.commit('nextPageSucceeded', res) context.commit('nextPageSucceeded', res)
} catch (err) { } catch (err) {

Loading…
Cancel
Save