@ -7,8 +7,15 @@
>
>
< div
< div
class = "col col-xs-12 col-md-4 csc-cf-group-title"
class = "col col-xs-12 col-md-4 csc-cf-group-title"
v - if = "this.groupsCount > 0"
>
>
{ { $t ( 'pages.newCallForward.titles.mainTitle' ) } }
{ { $t ( 'pages.newCallForward.titles.mainTitle' , { number : this . subscriberDisplayName } ) } }
< / div >
< div
class = "col col-xs-12 col-md-4 csc-cf-group-title"
v - else
>
{ { $t ( 'pages.newCallForward.primarNumberEnabled' ) } } { { subscriberDisplayName } }
< / div >
< / div >
< div
< div
class = "col col-xs-12 col-md-2 text-left csc-cf-self-number-cont"
class = "col col-xs-12 col-md-2 text-left csc-cf-self-number-cont"
@ -91,6 +98,9 @@
import {
import {
mapGetters ,
mapGetters ,
} from 'vuex'
} from 'vuex'
import {
showGlobalWarning
} from '../../../helpers/ui'
import {
import {
QSpinnerDots ,
QSpinnerDots ,
QField ,
QField ,
@ -114,6 +124,7 @@
CscNewCallForwardDestination ,
CscNewCallForwardDestination ,
CscNewCallForwardAddDestinationForm ,
CscNewCallForwardAddDestinationForm ,
CscNewCallForwardDestinationsetTypeSelect ,
CscNewCallForwardDestinationsetTypeSelect ,
showGlobalWarning ,
QSpinnerDots ,
QSpinnerDots ,
QField ,
QField ,
QToggle ,
QToggle ,
@ -152,53 +163,64 @@
'subscriberDisplayName' ,
'subscriberDisplayName' ,
'forwardGroups' ,
'forwardGroups' ,
'selectedDestType'
'selectedDestType'
] )
] ) ,
groupsCount ( ) {
return this . forwardGroups . length ;
}
} ,
} ,
methods : {
methods : {
async addForwardGroup ( ) {
async addForwardGroup ( ) {
this . groupInCreation = true ;
this . groupInCreation = true ;
const selectedDestType = this . selectedDestType ;
const selectedDestType = this . selectedDestType ;
switch ( selectedDestType ) {
let tempGroups = this . forwardGroups . filter ( ( $group ) => {
case "unconditional" : {
return $group . id . toString ( ) . indexOf ( 'temp-' ) > - 1 ;
if ( this . toggleDefaultNumber ) {
} ) ;
const tempTimeoutFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-timeout' ) ;
if ( ! tempTimeoutFwdGroup ) {
if ( tempGroups . length > 0 ) {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'timeout' ) ;
showGlobalWarning ( ` ${ this . $t ( 'pages.newCallForward.addDestinationAlert' ) } ` , 5000 ) ;
}
else {
switch ( selectedDestType ) {
case "unconditional" : {
if ( this . toggleDefaultNumber ) {
const tempTimeoutFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-timeout' ) ;
if ( ! tempTimeoutFwdGroup ) {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'timeout' ) ;
}
}
}
}
else {
else {
const tempUnconditionalFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-unconditional' ) ;
const tempUnconditionalFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-unconditional' ) ;
if ( ! tempUnconditionalFwdGroup ) {
if ( ! tempUnconditionalFwdGroup ) {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'unconditional' ) ;
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'unconditional' ) ;
}
}
}
}
}
}
break ;
break ;
case "unconditional-from" : {
case "unconditional-from" : {
if ( this . toggleDefaultNumber ) {
if ( this . toggleDefaultNumber ) {
const tempTimeoutFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-timeout-from' ) ;
const tempTimeoutFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-timeout-from' ) ;
if ( ! tempTimeoutFwdGroup ) {
if ( ! tempTimeoutFwdGroup ) {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'timeoutFrom' ) ;
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'timeoutFrom' ) ;
}
}
}
}
else {
else {
const tempUnconditionalFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-unconditional-from' ) ;
const tempUnconditionalFwdGroup = await this . $store . dispatch ( 'newCallForward/getForwardGroupById' , 'temp-csc-unconditional-from' ) ;
if ( ! tempUnconditionalFwdGroup ) {
if ( ! tempUnconditionalFwdGroup ) {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'unconditionalFrom' ) ;
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'unconditionalFrom' ) ;
}
}
}
}
}
break ;
case "offline" : {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'offline' ) ;
}
break ;
case "busy" : {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'busy' ) ;
}
break ;
}
}
break ;
case "offline" : {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'offline' ) ;
}
break ;
case "busy" : {
await this . $store . dispatch ( 'newCallForward/addTempGroup' , 'busy' ) ;
}
break ;
}
}
this . groupInCreation = false ;
this . groupInCreation = false ;
} ,
} ,
showForm ( ) {
showForm ( ) {
@ -224,7 +246,6 @@
float right
float right
. csc - cf - group - title
. csc - cf - group - title
text - align right
text - align right
font - weight bold
. csc - cf - destinations - cont
. csc - cf - destinations - cont
margin - top 25 px
margin - top 25 px
. csc - cf - field - toggle
. csc - cf - field - toggle