mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 00:46:12 +08:00
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.
70 lines
2 KiB
Text
Vendored
70 lines
2 KiB
Text
Vendored
import { fn } from "@ember/helper";
|
|
import { on } from "@ember/modifier";
|
|
import RouteTemplate from "ember-route-template";
|
|
import formatDate from "discourse/helpers/format-date";
|
|
import routeAction from "discourse/helpers/route-action";
|
|
import EmailLogsList from "admin/components/email-logs-list";
|
|
import IncomingEmail from "admin/models/incoming-email";
|
|
|
|
const REJECTED_HEADERS = [
|
|
{ key: "admin.email.incoming_emails.from_address" },
|
|
{ key: "admin.email.incoming_emails.to_addresses" },
|
|
{ key: "admin.email.incoming_emails.subject" },
|
|
{ key: "admin.email.incoming_emails.error", colspan: "2" },
|
|
];
|
|
|
|
const REJECTED_FILTERS = [
|
|
{
|
|
property: "filterFrom",
|
|
name: "from",
|
|
placeholder: "admin.email.incoming_emails.filters.from_placeholder",
|
|
},
|
|
{
|
|
property: "filterTo",
|
|
name: "to",
|
|
placeholder: "admin.email.incoming_emails.filters.to_placeholder",
|
|
},
|
|
{
|
|
property: "filterSubject",
|
|
name: "subject",
|
|
placeholder: "admin.email.incoming_emails.filters.subject_placeholder",
|
|
},
|
|
{
|
|
property: "filterError",
|
|
name: "error",
|
|
placeholder: "admin.email.incoming_emails.filters.error_placeholder",
|
|
},
|
|
];
|
|
|
|
export default RouteTemplate(
|
|
<template>
|
|
<EmailLogsList
|
|
@status="rejected"
|
|
@logType="rejected"
|
|
@sourceModel={{IncomingEmail}}
|
|
@headers={{REJECTED_HEADERS}}
|
|
@filters={{REJECTED_FILTERS}}
|
|
@onShowEmail={{routeAction "showIncomingEmail"}}
|
|
>
|
|
<:default
|
|
as |emailLog ccThreshold sortWithAddressFilter handleShowIncomingEmail|
|
|
>
|
|
<tr data-test-email-log-row-id={{emailLog.id}}>
|
|
<td>{{formatDate emailLog.created_at}}</td>
|
|
<td>{{emailLog.from_address}}</td>
|
|
<td>{{emailLog.to_addresses}}</td>
|
|
<td>
|
|
<a
|
|
href
|
|
{{on "click" (fn handleShowIncomingEmail emailLog.id)}}
|
|
class="incoming-email-link"
|
|
>
|
|
{{emailLog.subject}}
|
|
</a>
|
|
</td>
|
|
<td>{{emailLog.error}}</td>
|
|
</tr>
|
|
</:default>
|
|
</EmailLogsList>
|
|
</template>
|
|
);
|