mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-24 11:34:26 +08:00
Started off attempting to fix filters, but was frustrated working with the old patterns and template duplication so I've updated everything and tried to consolidate into a `email-logs-list.gjs` component. The primary issue was that the filters only worked once, and if you needed to change them or remove them... you couldn't and had to refresh the page. Before: https://github.com/user-attachments/assets/9cfa0328-41d4-4178-ab87-ba2ff495d932 After: https://github.com/user-attachments/assets/febcff8f-3dfa-4b86-9be1-f333e6502648
36 lines
1,002 B
JavaScript
Vendored
36 lines
1,002 B
JavaScript
Vendored
import { tracked } from "@glimmer/tracking";
|
|
import { action } from "@ember/object";
|
|
import discourseDebounce from "discourse/lib/debounce";
|
|
import { INPUT_DELAY } from "discourse/lib/environment";
|
|
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
|
|
|
export default class AdminEmailLogsSkippedController extends AdminEmailLogsController {
|
|
@tracked filterUser = "";
|
|
@tracked filterAddress = "";
|
|
@tracked filterType = "";
|
|
|
|
filters = [
|
|
{ property: "filterUser", name: "user" },
|
|
{ property: "filterAddress", name: "address" },
|
|
{ property: "filterType", name: "type" },
|
|
];
|
|
|
|
@action
|
|
updateFilter(filterType, event) {
|
|
const value = event.target.value;
|
|
|
|
switch (filterType) {
|
|
case "user":
|
|
this.filterUser = value;
|
|
break;
|
|
case "address":
|
|
this.filterAddress = value;
|
|
break;
|
|
case "type":
|
|
this.filterType = value;
|
|
break;
|
|
}
|
|
|
|
discourseDebounce(this, this.loadLogs, INPUT_DELAY);
|
|
}
|
|
}
|