discourse/app/assets/javascripts/admin/addon/controllers/admin-email-logs/rejected.js
Alan Guo Xiang Tan 109212127a
FIX: Clicking on subject in admin email logs broken (#35030)
This was a regression introduced in
f0069a4fab where clicking on an email
log's subject link did not open a modal that displays the details of the
incoming email.

In this commit, the following changes were also made:

1. Make all `admin-email-logs/*` routes inherit from the same parent
route.
   Having two different parent routes doing the same thing was probably
   something that was missed in the refactor previously.
2025-10-01 10:04:27 +08:00

47 lines
1.3 KiB
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";
import IncomingEmail from "admin/models/incoming-email";
export default class AdminEmailLogsRejectedController extends AdminEmailLogsController {
@tracked filterFrom = "";
@tracked filterTo = "";
@tracked filterSubject = "";
@tracked filterError = "";
filters = [
{ property: "filterFrom", name: "from" },
{ property: "filterTo", name: "to" },
{ property: "filterSubject", name: "subject" },
{ property: "filterError", name: "error" },
];
@action
updateFilter(filterType, event) {
const value = event.target.value;
switch (filterType) {
case "from":
this.filterFrom = value;
break;
case "to":
this.filterTo = value;
break;
case "subject":
this.filterSubject = value;
break;
case "error":
this.filterError = value;
break;
}
discourseDebounce(this, this.loadLogs, IncomingEmail, INPUT_DELAY);
}
@action
loadMore() {
this.loadLogs(IncomingEmail, true);
}
}