mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-10 22:52:10 +00:00
Smaller rule list
This commit is contained in:
@@ -133,7 +133,7 @@ class ApplyRules extends Command
|
|||||||
// start running rules.
|
// start running rules.
|
||||||
$this->friendlyLine(sprintf('Will apply %d rule(s) to your transaction(s).', $count));
|
$this->friendlyLine(sprintf('Will apply %d rule(s) to your transaction(s).', $count));
|
||||||
|
|
||||||
// file the rule(s)
|
// fire the rule(s)
|
||||||
$ruleEngine->fire();
|
$ruleEngine->fire();
|
||||||
|
|
||||||
$this->friendlyLine('');
|
$this->friendlyLine('');
|
||||||
|
@@ -100,8 +100,16 @@ class SearchRuleEngine implements RuleEngineInterface
|
|||||||
// if rules and no rule groups, file each rule separately.
|
// if rules and no rule groups, file each rule separately.
|
||||||
if (0 !== $this->rules->count()) {
|
if (0 !== $this->rules->count()) {
|
||||||
app('log')->debug(sprintf('SearchRuleEngine:: found %d rule(s) to fire.', $this->rules->count()));
|
app('log')->debug(sprintf('SearchRuleEngine:: found %d rule(s) to fire.', $this->rules->count()));
|
||||||
|
|
||||||
|
/** @var Rule $rule */
|
||||||
foreach ($this->rules as $rule) {
|
foreach ($this->rules as $rule) {
|
||||||
$this->fireRule($rule);
|
$result = $this->fireRule($rule);
|
||||||
|
if (true === $result && $rule->stop_processing) {
|
||||||
|
app('log')->debug(sprintf('Rule #%d has triggered and executed, but calls to stop processing. Since not in the context of a group, do not stop.', $rule->id));
|
||||||
|
}
|
||||||
|
if (false === $result && $rule->stop_processing) {
|
||||||
|
app('log')->debug(sprintf('Rule #%d has triggered and changed nothing, but calls to stop processing. Do not stop.', $rule->id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
app('log')->debug('SearchRuleEngine:: done processing all rules!');
|
app('log')->debug('SearchRuleEngine:: done processing all rules!');
|
||||||
|
|
||||||
|
@@ -97,6 +97,35 @@ $(function () {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// show rule triggers
|
||||||
|
$('.rule-triggers-show').click(function (e) {
|
||||||
|
var obj = $(e.currentTarget);
|
||||||
|
$('.rule-trigger-list[data-id="' + obj.data('id') + '"]').show();
|
||||||
|
$('.rule-triggers-show[data-id="' + obj.data('id') + '"]').hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.rule-trigger-list').each(function(i,v) {
|
||||||
|
var obj = $(v);
|
||||||
|
if(obj.data('count') > 2) {
|
||||||
|
obj.hide();
|
||||||
|
$('.rule-triggers-show[data-id="' + obj.data('id') + '"]').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// show rule actions
|
||||||
|
$('.rule-actions-show').click(function (e) {
|
||||||
|
var obj = $(e.currentTarget);
|
||||||
|
$('.rule-action-list[data-id="' + obj.data('id') + '"]').show();
|
||||||
|
$('.rule-actions-show[data-id="' + obj.data('id') + '"]').hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.rule-action-list').each(function(i,v) {
|
||||||
|
var obj = $(v);
|
||||||
|
if(obj.data('count') > 1) {
|
||||||
|
obj.hide();
|
||||||
|
$('.rule-actions-show[data-id="' + obj.data('id') + '"]').show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('.move-group').click(moveRuleGroup);
|
$('.move-group').click(moveRuleGroup);
|
||||||
$('.duplicate-rule').click(duplicateRule);
|
$('.duplicate-rule').click(duplicateRule);
|
||||||
|
|
||||||
|
@@ -721,6 +721,8 @@ return [
|
|||||||
// rules
|
// rules
|
||||||
'is_not_rule_trigger' => 'Not',
|
'is_not_rule_trigger' => 'Not',
|
||||||
'cannot_fire_inactive_rules' => 'You cannot execute inactive rules.',
|
'cannot_fire_inactive_rules' => 'You cannot execute inactive rules.',
|
||||||
|
'show_triggers' => 'Show triggers',
|
||||||
|
'show_actions' => 'Show actions',
|
||||||
'rules' => 'Rules',
|
'rules' => 'Rules',
|
||||||
'rule_name' => 'Name of rule',
|
'rule_name' => 'Name of rule',
|
||||||
'rule_triggers' => 'Rule triggers when',
|
'rule_triggers' => 'Rule triggers when',
|
||||||
|
@@ -125,11 +125,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
><br/>{{ rule.description|default('')|markdown }}</small>
|
><br/>{{ rule.description|default('')|markdown }}</small>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<small><br/>{% if rule.strict %}<span class="text-danger">{{ 'rule_is_strict'|_ }}</span>{% else %}<span class="text-success">{{ 'rule_is_not_strict'|_ }}</span>{% endif %}</small>
|
<small>({% if rule.strict %}<span class="text-danger">{{ 'rule_is_strict'|_ }}</span>{% else %}<span class="text-success">{{ 'rule_is_not_strict'|_ }}</span>{% endif %})</small>
|
||||||
</td>
|
</td>
|
||||||
<td class="hidden-xs">
|
<td class="hidden-xs">
|
||||||
{% if rule.ruleTriggers.count() > 0 %}
|
{% if rule.ruleTriggers.count() > 0 %}
|
||||||
<ul class="small" data-id="{{ rule.id }}">
|
<ul class="small rule-trigger-list" data-count="{{ rule.ruleTriggers.count() }}" data-id="{{ rule.id }}">
|
||||||
{% for trigger in rule.ruleTriggers %}
|
{% for trigger in rule.ruleTriggers %}
|
||||||
{% if trigger.trigger_type != "user_action" %}
|
{% if trigger.trigger_type != "user_action" %}
|
||||||
<li
|
<li
|
||||||
@@ -146,11 +146,12 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
<span class="small rule-triggers-show" style="cursor:pointer;display:none;" data-id="{{ rule.id }}">{{ 'show_triggers'|_ }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="hidden-xs">
|
<td class="hidden-xs">
|
||||||
{% if rule.ruleActions.count() > 0 %}
|
{% if rule.ruleActions.count() > 0 %}
|
||||||
<ul class="small" data-id="{{ rule.id }}">
|
<ul class="small rule-action-list" data-count="{{ rule.ruleActions.count() }}" data-id="{{ rule.id }}">
|
||||||
{% for action in rule.ruleActions %}
|
{% for action in rule.ruleActions %}
|
||||||
<li
|
<li
|
||||||
{% if not rule.active %}
|
{% if not rule.active %}
|
||||||
@@ -163,6 +164,7 @@
|
|||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
<span class="small rule-actions-show" style="cursor:pointer;display:none;" data-id="{{ rule.id }}">{{ 'show_actions'|_ }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Reference in New Issue
Block a user