Cleanup Sieve RainLoop filter editor

This commit is contained in:
the-djmaze 2024-01-03 01:31:44 +01:00
parent 42bcc0e047
commit 62639acc5a
5 changed files with 2 additions and 36 deletions

View file

@ -36,7 +36,6 @@ export class FilterModel extends AbstractModel {
this.addObservables({
enabled: true,
askDelete: false,
canBeDeleted: true,
name: '',
nameError: false,
@ -181,27 +180,6 @@ export class FilterModel extends AbstractModel {
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() {
this.conditions.push(new FilterConditionModel());
}

View file

@ -81,16 +81,6 @@ export class FilterConditionModel extends AbstractModel {
// static reviveFromJson(json) {}
toJSON() {
return {
// '@Object': 'Object/FilterCondition',
Field: this.field,
Type: this.type,
Value: this.value,
ValueSecond: this.valueSecond
};
}
cloneSelf() {
const filterCond = new FilterConditionModel();

View file

@ -261,7 +261,6 @@ export class SieveScriptModel extends AbstractModel
exists: false,
nameError: false,
askDelete: false,
canBeDeleted: true,
hasChanges: false
});
@ -317,7 +316,6 @@ export class SieveScriptModel extends AbstractModel
if (script.allowFilters()) {
script.filters(sieveScriptToFilters(script.body()));
}
script.canBeDeleted(SIEVE_FILE_NAME !== json.name);
script.exists(true);
script.hasChanges(false);
}

View file

@ -61,7 +61,7 @@
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
</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>
</tr>
</tbody>

View file

@ -41,7 +41,7 @@
data-i18n="GLOBAL/ARE_YOU_SURE"></a>
</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>
</tr>
<!-- /ko -->