TT#29910 Call: Show the toast regarding call initialisation only if RTC:engine is enabled

Change-Id: I8a7faf80a76de536f548d5d4aa143f1de2a5746f
changes/07/18207/2
Hans-Peter Herzog 8 years ago
parent 80c14dcb68
commit 4ff24c087d

@ -9,6 +9,7 @@
<span slot="subtitle"></span> <span slot="subtitle"></span>
</q-card-title> </q-card-title>
<q-card-main> <q-card-main>
<form id="csc-login-form">
<q-field icon="fa-user-circle" :helper="$t('pages.login.username_helper')" :count="128"> <q-field icon="fa-user-circle" :helper="$t('pages.login.username_helper')" :count="128">
<q-input type="text" max-length="128" :float-label="$t('pages.login.username')" <q-input type="text" max-length="128" :float-label="$t('pages.login.username')"
autofocus clearable v-model="username" @keyup.enter="login()"/> autofocus clearable v-model="username" @keyup.enter="login()"/>
@ -17,6 +18,7 @@
<q-input type="password" max-length="32" :float-label="$t('pages.login.password')" <q-input type="password" max-length="32" :float-label="$t('pages.login.password')"
clearable v-model="password" @keyup.enter="login()" /> clearable v-model="password" @keyup.enter="login()" />
</q-field> </q-field>
</form>
</q-card-main> </q-card-main>
<q-card-actions class="pull-right"> <q-card-actions class="pull-right">
<q-btn flat icon-right="fa-arrow-right" <q-btn flat icon-right="fa-arrow-right"

@ -51,9 +51,9 @@
"button": "Sign In", "button": "Sign In",
"error": "Wrong username or password", "error": "Wrong username or password",
"username": "Username", "username": "Username",
"username_helper": "Web-Username, SIP-URI", "username_helper": "Input username or username@domain",
"password": "Password", "password": "Password",
"password_helper": "Web-Password" "password_helper": ""
}, },
"callBlockingIncoming": { "callBlockingIncoming": {
"title": "Block/Allow incoming calls", "title": "Block/Allow incoming calls",

@ -22,6 +22,7 @@ export default {
state: { state: {
initialized: false, initialized: false,
initError: null, initError: null,
disabled: false,
endedReason: null, endedReason: null,
callState: CallState.input, callState: CallState.input,
number: null, number: null,
@ -50,7 +51,7 @@ export default {
return getters.isNetworkConnected; return getters.isNetworkConnected;
}, },
hasCallInitFailure(state, getters) { hasCallInitFailure(state, getters) {
return state.initError !== null; return state.initError !== null && state.disabled === false;
}, },
isPreparing(state, getters) { isPreparing(state, getters) {
return state.callState === CallState.input; return state.callState === CallState.input;
@ -78,6 +79,12 @@ export default {
}, },
isEnded(state, getters) { isEnded(state, getters) {
return state.callState === CallState.ended; return state.callState === CallState.ended;
},
hasRtcEngineCapability(state, getters, rootState, rootGetters) {
return rootGetters['user/hasRtcEngineCapability'];
},
hasRtcEngineCapabilityEnabled(state, getters, rootState, rootGetters) {
return rootGetters['user/hasRtcEngineCapabilityEnabled'];
} }
}, },
mutations: { mutations: {
@ -89,6 +96,9 @@ export default {
state.initialized = false; state.initialized = false;
state.initError = err; state.initError = err;
}, },
disable(state) {
state.disabled = true;
},
inputNumber(state) { inputNumber(state) {
state.callState = CallState.input; state.callState = CallState.input;
}, },
@ -152,6 +162,7 @@ export default {
Vue.call.end(); Vue.call.end();
context.commit('endCall', Vue.call.getEndedReason()); context.commit('endCall', Vue.call.getEndedReason());
}); });
if(context.getters.hasRtcEngineCapabilityEnabled) {
Vue.call.initialize().then(()=>{ Vue.call.initialize().then(()=>{
context.commit('initSucceeded'); context.commit('initSucceeded');
resolve(); resolve();
@ -159,6 +170,10 @@ export default {
context.commit('initFailed', err); context.commit('initFailed', err);
reject(err); reject(err);
}); });
} else {
context.commit('disable');
resolve();
}
}); });
}, },
/** /**

@ -34,11 +34,17 @@ export default {
return getters.isAdmin && state.capabilities !== null && state.capabilities.cloudpbx; return getters.isAdmin && state.capabilities !== null && state.capabilities.cloudpbx;
}, },
hasSmsCapability(state, getters) { hasSmsCapability(state, getters) {
return state.capabilities !== null && state.capabilities.sms; return state.capabilities !== null && state.capabilities.sms === true;
}, },
hasFaxCapability(state, getters) { hasFaxCapability(state, getters) {
return state.capabilities !== null && state.capabilities.faxserver; return state.capabilities !== null && state.capabilities.faxserver === true;
}, },
hasRtcEngineCapability(state, getters) {
return state.capabilities !== null && _.has(state.capabilities, 'rtcengine');
},
hasRtcEngineCapabilityEnabled(state, getters) {
return getters.hasRtcEngineCapability && state.capabilities.rtcengine === true;
}
}, },
mutations: { mutations: {
login(state, options) { login(state, options) {

Loading…
Cancel
Save