mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup Sieve RainLoop filter editor
This commit is contained in:
parent
42bcc0e047
commit
62639acc5a
5 changed files with 2 additions and 36 deletions
|
|
@ -36,7 +36,6 @@ export class FilterModel extends AbstractModel {
|
||||||
this.addObservables({
|
this.addObservables({
|
||||||
enabled: true,
|
enabled: true,
|
||||||
askDelete: false,
|
askDelete: false,
|
||||||
canBeDeleted: true,
|
|
||||||
|
|
||||||
name: '',
|
name: '',
|
||||||
nameError: false,
|
nameError: false,
|
||||||
|
|
@ -181,27 +180,6 @@ export class FilterModel extends AbstractModel {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
toJSON() {
|
|
||||||
return {
|
|
||||||
// '@Object': 'Object/Filter',
|
|
||||||
ID: this.id,
|
|
||||||
Enabled: this.enabled() ? 1 : 0,
|
|
||||||
Name: this.name,
|
|
||||||
Conditions: this.conditions,
|
|
||||||
ConditionsType: this.conditionsType,
|
|
||||||
|
|
||||||
ActionType: this.actionType(),
|
|
||||||
ActionValue: this.actionValue,
|
|
||||||
ActionValueSecond: this.actionValueSecond,
|
|
||||||
ActionValueThird: this.actionValueThird,
|
|
||||||
ActionValueFourth: this.actionValueFourth,
|
|
||||||
|
|
||||||
Keep: this.keep() ? 1 : 0,
|
|
||||||
Stop: this.stop() ? 1 : 0,
|
|
||||||
MarkAsRead: this.markAsRead() ? 1 : 0
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
addCondition() {
|
addCondition() {
|
||||||
this.conditions.push(new FilterConditionModel());
|
this.conditions.push(new FilterConditionModel());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,16 +81,6 @@ export class FilterConditionModel extends AbstractModel {
|
||||||
|
|
||||||
// static reviveFromJson(json) {}
|
// static reviveFromJson(json) {}
|
||||||
|
|
||||||
toJSON() {
|
|
||||||
return {
|
|
||||||
// '@Object': 'Object/FilterCondition',
|
|
||||||
Field: this.field,
|
|
||||||
Type: this.type,
|
|
||||||
Value: this.value,
|
|
||||||
ValueSecond: this.valueSecond
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
cloneSelf() {
|
cloneSelf() {
|
||||||
const filterCond = new FilterConditionModel();
|
const filterCond = new FilterConditionModel();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,6 @@ export class SieveScriptModel extends AbstractModel
|
||||||
exists: false,
|
exists: false,
|
||||||
nameError: false,
|
nameError: false,
|
||||||
askDelete: false,
|
askDelete: false,
|
||||||
canBeDeleted: true,
|
|
||||||
hasChanges: false
|
hasChanges: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -317,7 +316,6 @@ export class SieveScriptModel extends AbstractModel
|
||||||
if (script.allowFilters()) {
|
if (script.allowFilters()) {
|
||||||
script.filters(sieveScriptToFilters(script.body()));
|
script.filters(sieveScriptToFilters(script.body()));
|
||||||
}
|
}
|
||||||
script.canBeDeleted(SIEVE_FILE_NAME !== json.name);
|
|
||||||
script.exists(true);
|
script.exists(true);
|
||||||
script.hasChanges(false);
|
script.hasChanges(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
|
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="delete-filter fontastic" data-bind="visible: !askDelete() && canBeDeleted(), click: function (oFilter) { $root.filterForDeletion(oFilter); }">🗑</span>
|
<span class="delete-filter fontastic" data-bind="visible: !askDelete(), click: function (oFilter) { $root.filterForDeletion(oFilter); }">🗑</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
|
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="e-action fontastic" data-bind="visible: !askDelete() && canBeDeleted(), click: function (oScript) { $root.scriptForDeletion(oScript); }">🗑</span>
|
<span class="e-action fontastic" data-bind="visible: !askDelete() && !allowFilters(), click: function (oScript) { $root.scriptForDeletion(oScript); }">🗑</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue