Add error message on adminpanel contacts configuration page.

This commit is contained in:
RainLoop Team 2013-12-10 20:07:10 +04:00
parent a531846b8f
commit 869e0ed181
9 changed files with 120 additions and 60 deletions

View file

@ -21,11 +21,13 @@ function AdminContacts()
this.testing = ko.observable(false);
this.testContactsSuccess = ko.observable(false);
this.testContactsError = ko.observable(false);
this.testContactsErrorMessage = ko.observable('');
this.testContactsCommand = Utils.createCommand(this, function () {
this.testContactsSuccess(false);
this.testContactsError(false);
this.testContactsErrorMessage('');
this.testing(true);
RL.remote().testContacts(this.onTestContactsResponse, {
@ -45,13 +47,18 @@ Utils.addSettingsViewModel(AdminContacts, 'AdminSettingsContacts', 'Contacts', '
AdminContacts.prototype.onTestContactsResponse = function (sResult, oData)
{
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
this.testContactsSuccess(false);
this.testContactsError(false);
this.testContactsErrorMessage('');
if (Enums.StorageResultType.Success === sResult && oData && oData.Result && oData.Result.Result)
{
this.testContactsSuccess(true);
}
else
{
this.testContactsError(true);
this.testContactsErrorMessage(oData.Result.Message || '');
}
this.testing(false);
@ -61,6 +68,7 @@ AdminContacts.prototype.onShow = function ()
{
this.testContactsSuccess(false);
this.testContactsError(false);
this.testContactsErrorMessage('');
};
AdminContacts.prototype.onBuild = function ()