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 7 years ago
parent 80c14dcb68
commit 4ff24c087d

@ -9,14 +9,16 @@
<span slot="subtitle"></span>
</q-card-title>
<q-card-main>
<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')"
autofocus clearable v-model="username" @keyup.enter="login()"/>
</q-field>
<q-field icon="fa-lock" :helper="$t('pages.login.password_helper')" :count="32">
<q-input type="password" max-length="32" :float-label="$t('pages.login.password')"
clearable v-model="password" @keyup.enter="login()"/>
</q-field>
<form id="csc-login-form">
<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')"
autofocus clearable v-model="username" @keyup.enter="login()"/>
</q-field>
<q-field icon="fa-lock" :helper="$t('pages.login.password_helper')" :count="32">
<q-input type="password" max-length="32" :float-label="$t('pages.login.password')"
clearable v-model="password" @keyup.enter="login()" />
</q-field>
</form>
</q-card-main>
<q-card-actions class="pull-right">
<q-btn flat icon-right="fa-arrow-right"

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

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

@ -34,11 +34,17 @@ export default {
return getters.isAdmin && state.capabilities !== null && state.capabilities.cloudpbx;
},
hasSmsCapability(state, getters) {
return state.capabilities !== null && state.capabilities.sms;
return state.capabilities !== null && state.capabilities.sms === true;
},
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: {
login(state, options) {

Loading…
Cancel
Save