mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 22:12:08 +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.
63 lines
1.8 KiB
Text
Vendored
63 lines
1.8 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 RECEIVED_HEADERS = [
|
|
{ key: "admin.email.incoming_emails.from_address" },
|
|
{ key: "admin.email.incoming_emails.to_addresses" },
|
|
{ key: "admin.email.incoming_emails.subject" },
|
|
];
|
|
|
|
const RECEIVED_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",
|
|
},
|
|
];
|
|
|
|
export default RouteTemplate(
|
|
<template>
|
|
<EmailLogsList
|
|
@status="received"
|
|
@logType="received"
|
|
@sourceModel={{IncomingEmail}}
|
|
@headers={{RECEIVED_HEADERS}}
|
|
@filters={{RECEIVED_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>
|
|
</tr>
|
|
</:default>
|
|
</EmailLogsList>
|
|
</template>
|
|
);
|