Skip to content

Commit e579a16

Browse files
authored
Merge pull request #5746 from Countly/SER-2099-do-a-small-product-frontend-improvement-for-alerts
[SER-2099] added enabled-disabled filter to alerts table
2 parents 2e56c57 + 951854a commit e579a16

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

plugins/alerts/frontend/public/javascripts/countly.views.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,12 @@
10691069
computed: {
10701070
tableRows: function() {
10711071
var rows = this.$store.getters["countlyAlerts/table/all"];
1072+
if (this.tableFilterStatus !== "all") {
1073+
var enabled = this.tableFilterStatus === "enabled" ? true : false;
1074+
rows = rows.filter(function(r) {
1075+
return r.enabled === enabled;
1076+
});
1077+
}
10721078
if (this.filteredApps.length > 0) {
10731079
var self = this;
10741080
rows = rows.filter(function(r) {
@@ -1106,6 +1112,7 @@
11061112
appsSelectorOption: appsSelectorOption,
11071113
filterStatus: "all",
11081114
filteredApps: [],
1115+
tableFilterStatus: "all",
11091116
tableDynamicCols: [
11101117
{
11111118
value: "appNameList",

plugins/alerts/frontend/public/localization/alerts.properties

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ alert.email-header = Email Notification
108108
alerts.email-icon = This alert can only be used within Hooks to trigger actions.
109109
alerts.common-icon-info = Alert will be triggered as soon as a new response is submitted for the selected widget.
110110
alerts.crashes-icon = Alert will be triggered as soon as a new, before unseen crash occurs.
111-
111+
alerts.status-all = All alerts
112+
alerts.status-enabled = Enabled
113+
alerts.status-disabled = Disabled

plugins/alerts/frontend/public/templates/vue-main.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@
4848
:default-sort="{prop: 'createdAt', order: 'descending'}"
4949
>
5050
<template v-slot:header-left="scope">
51+
<div class="bu-mr-2">
52+
<el-radio-group :plain="true" v-model="tableFilterStatus">
53+
<el-radio-button label="all">{{i18n('alerts.status-all')}}</el-radio-button>
54+
<el-radio-button label="enabled">{{i18n('alerts.status-enabled')}}</el-radio-button>
55+
<el-radio-button label="disabled">{{i18n('alerts.status-disabled')}}</el-radio-button>
56+
</el-radio-group>
57+
</div>
5158
<div class="alerts-table-app-selector">
5259
<cly-select-x
5360
:placeholder="i18n('alert.all-applications')"

0 commit comments

Comments
 (0)