Small improvements

This commit is contained in:
RainLoop Team 2015-07-29 22:13:49 +04:00
parent 5123841540
commit c99a46a118
29 changed files with 459 additions and 26 deletions

View file

@ -43,6 +43,9 @@
this.actionValueSecond = ko.observable('');
this.actionValueThird = ko.observable('');
this.actionValueFourth = ko.observable('');
this.actionValueFourth.error = ko.observable(false);
this.actionMarkAsRead = ko.observable(false);
this.actionKeep = ko.observable(true);
@ -55,6 +58,8 @@
this.actionValue.error(false);
this.actionValueSecond('');
this.actionValueThird('');
this.actionValueFourth('');
this.actionValueFourth.error(false);
}, this);
var fGetRealFolderName = function (sFolderFullNameRaw) {
@ -189,6 +194,14 @@
return false;
}
if (Enums.FiltersAction.Vacation === this.actionType() &&
('' === this.actionValueFourth() || -1 === this.actionValueFourth().indexOf('@'))
)
{
this.actionValueFourth.error(true);
return false;
}
this.name.error(false);
this.actionValue.error(false);
@ -209,6 +222,7 @@
'ActionValue': this.actionValue(),
'ActionValueSecond': this.actionValueSecond(),
'ActionValueThird': this.actionValueThird(),
'ActionValueFourth': this.actionValueFourth(),
'ActionType': this.actionType(),
'Stop': this.actionNoStop() ? '0' : '1',
@ -228,6 +242,11 @@
Utils.delegateRunOnDestroy(oConditionToDelete);
};
FilterModel.prototype.setRecipients = function ()
{
this.actionValueFourth(require('Stores/User/Account').accountsEmails().join(', '));
};
FilterModel.prototype.parse = function (oItem)
{
var bResult = false;
@ -255,6 +274,7 @@
this.actionValue(Utils.pString(oItem['ActionValue']));
this.actionValueSecond(Utils.pString(oItem['ActionValueSecond']));
this.actionValueThird(Utils.pString(oItem['ActionValueThird']));
this.actionValueFourth(Utils.pString(oItem['ActionValueFourth']));
this.actionNoStop(!oItem['Stop']);
this.actionKeep(!!oItem['Keep']);
@ -288,6 +308,7 @@
oClone.actionValueSecond(this.actionValueSecond());
oClone.actionValueThird(this.actionValueThird());
oClone.actionValueFourth(this.actionValueFourth());
oClone.actionKeep(this.actionKeep());
oClone.actionNoStop(this.actionNoStop());