@serve.zone/catalog 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/index.d.ts +3 -0
- package/dist_ts_web/elements/index.js +5 -1
- package/dist_ts_web/elements/sz-demo-view-mta.d.ts +25 -0
- package/dist_ts_web/elements/sz-demo-view-mta.js +375 -0
- package/dist_ts_web/elements/sz-mta-detail-view.d.ts +56 -0
- package/dist_ts_web/elements/sz-mta-detail-view.js +929 -0
- package/dist_ts_web/elements/sz-mta-list-view.d.ts +31 -0
- package/dist_ts_web/elements/sz-mta-list-view.js +371 -0
- package/dist_ts_web/pages/sz-demo-app-shell.js +8 -2
- package/dist_watch/bundle.js +1824 -329
- package/dist_watch/bundle.js.map +4 -4
- package/package.json +1 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/index.ts +5 -0
- package/ts_web/elements/sz-demo-view-mta.ts +335 -0
- package/ts_web/elements/sz-mta-detail-view.ts +933 -0
- package/ts_web/elements/sz-mta-list-view.ts +332 -0
- package/ts_web/pages/sz-demo-app-shell.ts +7 -1
package/package.json
CHANGED
package/ts_web/elements/index.ts
CHANGED
|
@@ -45,6 +45,10 @@ export * from './sz-service-create-view.js';
|
|
|
45
45
|
export * from './sz-platform-service-detail-view.js';
|
|
46
46
|
export * from './sz-domain-detail-view.js';
|
|
47
47
|
|
|
48
|
+
// MTA Email Views
|
|
49
|
+
export * from './sz-mta-list-view.js';
|
|
50
|
+
export * from './sz-mta-detail-view.js';
|
|
51
|
+
|
|
48
52
|
// Demo Views
|
|
49
53
|
export * from './sz-demo-view-dashboard.js';
|
|
50
54
|
export * from './sz-demo-view-services.js';
|
|
@@ -52,3 +56,4 @@ export * from './sz-demo-view-network.js';
|
|
|
52
56
|
export * from './sz-demo-view-registries.js';
|
|
53
57
|
export * from './sz-demo-view-tokens.js';
|
|
54
58
|
export * from './sz-demo-view-settings.js';
|
|
59
|
+
export * from './sz-demo-view-mta.js';
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeesElement,
|
|
3
|
+
customElement,
|
|
4
|
+
html,
|
|
5
|
+
css,
|
|
6
|
+
cssManager,
|
|
7
|
+
state,
|
|
8
|
+
type TemplateResult,
|
|
9
|
+
} from '@design.estate/dees-element';
|
|
10
|
+
import type { DeesAppui } from '@design.estate/dees-catalog';
|
|
11
|
+
import type { IEmail, TEmailDirection } from './sz-mta-list-view.js';
|
|
12
|
+
import type { IEmailDetail } from './sz-mta-detail-view.js';
|
|
13
|
+
import './index.js';
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'sz-demo-view-mta': SzDemoViewMta;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@customElement('sz-demo-view-mta')
|
|
22
|
+
export class SzDemoViewMta extends DeesElement {
|
|
23
|
+
private appui: DeesAppui | null = null;
|
|
24
|
+
|
|
25
|
+
@state()
|
|
26
|
+
private accessor currentView: 'list' | 'detail' = 'list';
|
|
27
|
+
|
|
28
|
+
@state()
|
|
29
|
+
private accessor selectedEmail: IEmailDetail | null = null;
|
|
30
|
+
|
|
31
|
+
@state()
|
|
32
|
+
private accessor currentDirectionFilter: TEmailDirection | 'all' = 'all';
|
|
33
|
+
|
|
34
|
+
private demoEmails: IEmail[] = [
|
|
35
|
+
{ id: '1', direction: 'outbound', status: 'delivered', from: 'noreply@serve.zone', to: 'user@example.com', subject: 'Welcome to serve.zone', timestamp: '2024-01-15 14:30:22', messageId: '<abc123@serve.zone>', size: '12.4 KB' },
|
|
36
|
+
{ id: '2', direction: 'outbound', status: 'bounced', from: 'alerts@serve.zone', to: 'invalid@nowhere.test', subject: 'Service Alert: CPU Usage High', timestamp: '2024-01-15 14:28:10', messageId: '<def456@serve.zone>', size: '8.2 KB' },
|
|
37
|
+
{ id: '3', direction: 'inbound', status: 'delivered', from: 'support@customer.com', to: 'admin@serve.zone', subject: 'Re: Infrastructure Review', timestamp: '2024-01-15 14:25:00', messageId: '<ghi789@customer.com>', size: '24.1 KB' },
|
|
38
|
+
{ id: '4', direction: 'outbound', status: 'rejected', from: 'billing@serve.zone', to: 'blocked@spam-domain.test', subject: 'Invoice #2024-001', timestamp: '2024-01-15 14:20:45', messageId: '<jkl012@serve.zone>', size: '45.6 KB' },
|
|
39
|
+
{ id: '5', direction: 'outbound', status: 'deferred', from: 'noreply@serve.zone', to: 'slow@remote-server.test', subject: 'Password Reset Request', timestamp: '2024-01-15 14:15:30', messageId: '<mno345@serve.zone>', size: '6.8 KB' },
|
|
40
|
+
{ id: '6', direction: 'inbound', status: 'delivered', from: 'ci@github.com', to: 'devops@serve.zone', subject: 'Build #4521 passed', timestamp: '2024-01-15 14:10:00', messageId: '<pqr678@github.com>', size: '15.3 KB' },
|
|
41
|
+
{ id: '7', direction: 'outbound', status: 'pending', from: 'reports@serve.zone', to: 'team@serve.zone', subject: 'Weekly Infrastructure Report', timestamp: '2024-01-15 14:05:00', messageId: '<stu901@serve.zone>', size: '102.7 KB' },
|
|
42
|
+
{ id: '8', direction: 'inbound', status: 'delivered', from: 'monitoring@uptime.io', to: 'ops@serve.zone', subject: 'Uptime Report: 99.98%', timestamp: '2024-01-15 13:55:00', messageId: '<vwx234@uptime.io>', size: '9.1 KB' },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
private demoEmailDetails: Record<string, IEmailDetail> = {
|
|
46
|
+
'1': {
|
|
47
|
+
id: '1',
|
|
48
|
+
direction: 'outbound',
|
|
49
|
+
status: 'delivered',
|
|
50
|
+
from: 'noreply@serve.zone',
|
|
51
|
+
to: 'user@example.com',
|
|
52
|
+
toList: ['user@example.com'],
|
|
53
|
+
subject: 'Welcome to serve.zone',
|
|
54
|
+
timestamp: '2024-01-15 14:30:22',
|
|
55
|
+
messageId: '<abc123@serve.zone>',
|
|
56
|
+
size: '12.4 KB',
|
|
57
|
+
smtpLog: [
|
|
58
|
+
{ timestamp: '14:30:20', direction: 'client', command: 'EHLO mail.serve.zone' },
|
|
59
|
+
{ timestamp: '14:30:20', direction: 'server', command: '250-mail.example.com Hello', responseCode: 250 },
|
|
60
|
+
{ timestamp: '14:30:20', direction: 'server', command: '250-STARTTLS', responseCode: 250 },
|
|
61
|
+
{ timestamp: '14:30:20', direction: 'server', command: '250 SIZE 52428800', responseCode: 250 },
|
|
62
|
+
{ timestamp: '14:30:20', direction: 'client', command: 'STARTTLS' },
|
|
63
|
+
{ timestamp: '14:30:21', direction: 'server', command: '220 Ready to start TLS', responseCode: 220 },
|
|
64
|
+
{ timestamp: '14:30:21', direction: 'client', command: 'EHLO mail.serve.zone' },
|
|
65
|
+
{ timestamp: '14:30:21', direction: 'server', command: '250-mail.example.com Hello', responseCode: 250 },
|
|
66
|
+
{ timestamp: '14:30:21', direction: 'server', command: '250-AUTH PLAIN LOGIN', responseCode: 250 },
|
|
67
|
+
{ timestamp: '14:30:21', direction: 'server', command: '250 SIZE 52428800', responseCode: 250 },
|
|
68
|
+
{ timestamp: '14:30:21', direction: 'client', command: 'AUTH PLAIN AHVzZXIAcGFzc3dvcmQ=' },
|
|
69
|
+
{ timestamp: '14:30:21', direction: 'server', command: '235 2.7.0 Authentication successful', responseCode: 235 },
|
|
70
|
+
{ timestamp: '14:30:21', direction: 'client', command: 'MAIL FROM:<noreply@serve.zone>' },
|
|
71
|
+
{ timestamp: '14:30:21', direction: 'server', command: '250 OK', responseCode: 250 },
|
|
72
|
+
{ timestamp: '14:30:21', direction: 'client', command: 'RCPT TO:<user@example.com>' },
|
|
73
|
+
{ timestamp: '14:30:21', direction: 'server', command: '250 Accepted', responseCode: 250 },
|
|
74
|
+
{ timestamp: '14:30:22', direction: 'client', command: 'DATA' },
|
|
75
|
+
{ timestamp: '14:30:22', direction: 'server', command: '354 Enter message, ending with "." on a line by itself', responseCode: 354 },
|
|
76
|
+
{ timestamp: '14:30:22', direction: 'client', command: '.' },
|
|
77
|
+
{ timestamp: '14:30:22', direction: 'server', command: '250 OK id=1pQ2rS-0003Ab-C4', responseCode: 250 },
|
|
78
|
+
{ timestamp: '14:30:22', direction: 'client', command: 'QUIT' },
|
|
79
|
+
{ timestamp: '14:30:22', direction: 'server', command: '221 mail.example.com closing connection', responseCode: 221 },
|
|
80
|
+
],
|
|
81
|
+
connectionInfo: {
|
|
82
|
+
sourceIp: '10.0.1.50',
|
|
83
|
+
sourceHostname: 'mail.serve.zone',
|
|
84
|
+
destinationIp: '93.184.216.34',
|
|
85
|
+
destinationPort: 25,
|
|
86
|
+
tlsVersion: 'TLSv1.3',
|
|
87
|
+
tlsCipher: 'TLS_AES_256_GCM_SHA384',
|
|
88
|
+
authenticated: true,
|
|
89
|
+
authMethod: 'PLAIN',
|
|
90
|
+
authUser: 'noreply@serve.zone',
|
|
91
|
+
},
|
|
92
|
+
authenticationResults: {
|
|
93
|
+
spf: 'pass',
|
|
94
|
+
spfDomain: 'serve.zone',
|
|
95
|
+
dkim: 'pass',
|
|
96
|
+
dkimDomain: 'serve.zone',
|
|
97
|
+
dmarc: 'pass',
|
|
98
|
+
dmarcPolicy: 'reject',
|
|
99
|
+
},
|
|
100
|
+
headers: {
|
|
101
|
+
'From': 'noreply@serve.zone',
|
|
102
|
+
'To': 'user@example.com',
|
|
103
|
+
'Subject': 'Welcome to serve.zone',
|
|
104
|
+
'Date': 'Mon, 15 Jan 2024 14:30:22 +0000',
|
|
105
|
+
'MIME-Version': '1.0',
|
|
106
|
+
'Content-Type': 'text/html; charset=UTF-8',
|
|
107
|
+
},
|
|
108
|
+
body: '<html>\n<head><title>Welcome</title></head>\n<body>\n <h1>Welcome to serve.zone!</h1>\n <p>Your account has been created successfully.</p>\n <p>Get started by visiting your <a href="https://serve.zone/dashboard">dashboard</a>.</p>\n</body>\n</html>',
|
|
109
|
+
},
|
|
110
|
+
'2': {
|
|
111
|
+
id: '2',
|
|
112
|
+
direction: 'outbound',
|
|
113
|
+
status: 'bounced',
|
|
114
|
+
from: 'alerts@serve.zone',
|
|
115
|
+
to: 'invalid@nowhere.test',
|
|
116
|
+
toList: ['invalid@nowhere.test'],
|
|
117
|
+
subject: 'Service Alert: CPU Usage High',
|
|
118
|
+
timestamp: '2024-01-15 14:28:10',
|
|
119
|
+
messageId: '<def456@serve.zone>',
|
|
120
|
+
size: '8.2 KB',
|
|
121
|
+
rejectionReason: '550 5.1.1 The email account that you tried to reach does not exist.',
|
|
122
|
+
bounceMessage: 'Delivery to the following recipient failed permanently:\n\n invalid@nowhere.test\n\nTechnical details of permanent failure:\nGoogle tried to deliver your message, but it was rejected by the server for the recipient domain nowhere.test.',
|
|
123
|
+
smtpLog: [
|
|
124
|
+
{ timestamp: '14:28:08', direction: 'client', command: 'EHLO mail.serve.zone' },
|
|
125
|
+
{ timestamp: '14:28:08', direction: 'server', command: '250-mail.nowhere.test Hello', responseCode: 250 },
|
|
126
|
+
{ timestamp: '14:28:08', direction: 'client', command: 'MAIL FROM:<alerts@serve.zone>' },
|
|
127
|
+
{ timestamp: '14:28:09', direction: 'server', command: '250 OK', responseCode: 250 },
|
|
128
|
+
{ timestamp: '14:28:09', direction: 'client', command: 'RCPT TO:<invalid@nowhere.test>' },
|
|
129
|
+
{ timestamp: '14:28:10', direction: 'server', command: '550 5.1.1 The email account that you tried to reach does not exist.', responseCode: 550 },
|
|
130
|
+
{ timestamp: '14:28:10', direction: 'client', command: 'QUIT' },
|
|
131
|
+
{ timestamp: '14:28:10', direction: 'server', command: '221 Bye', responseCode: 221 },
|
|
132
|
+
],
|
|
133
|
+
connectionInfo: {
|
|
134
|
+
sourceIp: '10.0.1.50',
|
|
135
|
+
sourceHostname: 'mail.serve.zone',
|
|
136
|
+
destinationIp: '198.51.100.25',
|
|
137
|
+
destinationPort: 25,
|
|
138
|
+
tlsVersion: 'TLSv1.2',
|
|
139
|
+
tlsCipher: 'ECDHE-RSA-AES128-GCM-SHA256',
|
|
140
|
+
authenticated: true,
|
|
141
|
+
authMethod: 'PLAIN',
|
|
142
|
+
authUser: 'alerts@serve.zone',
|
|
143
|
+
},
|
|
144
|
+
authenticationResults: {
|
|
145
|
+
spf: 'pass',
|
|
146
|
+
spfDomain: 'serve.zone',
|
|
147
|
+
dkim: 'pass',
|
|
148
|
+
dkimDomain: 'serve.zone',
|
|
149
|
+
dmarc: 'pass',
|
|
150
|
+
dmarcPolicy: 'quarantine',
|
|
151
|
+
},
|
|
152
|
+
headers: {
|
|
153
|
+
'From': 'alerts@serve.zone',
|
|
154
|
+
'To': 'invalid@nowhere.test',
|
|
155
|
+
'Subject': 'Service Alert: CPU Usage High',
|
|
156
|
+
'Date': 'Mon, 15 Jan 2024 14:28:10 +0000',
|
|
157
|
+
'MIME-Version': '1.0',
|
|
158
|
+
'Content-Type': 'text/plain; charset=UTF-8',
|
|
159
|
+
},
|
|
160
|
+
body: 'ALERT: CPU Usage High\n\nService: api-gateway\nCurrent Usage: 94.2%\nThreshold: 90%\nTimestamp: 2024-01-15 14:28:00 UTC\n\nPlease investigate immediately.',
|
|
161
|
+
},
|
|
162
|
+
'3': {
|
|
163
|
+
id: '3',
|
|
164
|
+
direction: 'inbound',
|
|
165
|
+
status: 'delivered',
|
|
166
|
+
from: 'support@customer.com',
|
|
167
|
+
to: 'admin@serve.zone',
|
|
168
|
+
toList: ['admin@serve.zone'],
|
|
169
|
+
cc: ['ops@serve.zone'],
|
|
170
|
+
subject: 'Re: Infrastructure Review',
|
|
171
|
+
timestamp: '2024-01-15 14:25:00',
|
|
172
|
+
messageId: '<ghi789@customer.com>',
|
|
173
|
+
size: '24.1 KB',
|
|
174
|
+
smtpLog: [
|
|
175
|
+
{ timestamp: '14:24:58', direction: 'client', command: 'EHLO mail.customer.com' },
|
|
176
|
+
{ timestamp: '14:24:58', direction: 'server', command: '250-mail.serve.zone Hello', responseCode: 250 },
|
|
177
|
+
{ timestamp: '14:24:58', direction: 'server', command: '250-STARTTLS', responseCode: 250 },
|
|
178
|
+
{ timestamp: '14:24:58', direction: 'server', command: '250 SIZE 52428800', responseCode: 250 },
|
|
179
|
+
{ timestamp: '14:24:59', direction: 'client', command: 'STARTTLS' },
|
|
180
|
+
{ timestamp: '14:24:59', direction: 'server', command: '220 Ready to start TLS', responseCode: 220 },
|
|
181
|
+
{ timestamp: '14:24:59', direction: 'client', command: 'MAIL FROM:<support@customer.com>' },
|
|
182
|
+
{ timestamp: '14:24:59', direction: 'server', command: '250 OK', responseCode: 250 },
|
|
183
|
+
{ timestamp: '14:24:59', direction: 'client', command: 'RCPT TO:<admin@serve.zone>' },
|
|
184
|
+
{ timestamp: '14:25:00', direction: 'server', command: '250 Accepted', responseCode: 250 },
|
|
185
|
+
{ timestamp: '14:25:00', direction: 'client', command: 'DATA' },
|
|
186
|
+
{ timestamp: '14:25:00', direction: 'server', command: '354 Enter message', responseCode: 354 },
|
|
187
|
+
{ timestamp: '14:25:00', direction: 'client', command: '.' },
|
|
188
|
+
{ timestamp: '14:25:00', direction: 'server', command: '250 OK id=2bR3sT-0004Cd-E5', responseCode: 250 },
|
|
189
|
+
],
|
|
190
|
+
connectionInfo: {
|
|
191
|
+
sourceIp: '203.0.113.45',
|
|
192
|
+
sourceHostname: 'mail.customer.com',
|
|
193
|
+
destinationIp: '10.0.1.50',
|
|
194
|
+
destinationPort: 25,
|
|
195
|
+
tlsVersion: 'TLSv1.3',
|
|
196
|
+
tlsCipher: 'TLS_AES_128_GCM_SHA256',
|
|
197
|
+
authenticated: false,
|
|
198
|
+
authMethod: '',
|
|
199
|
+
authUser: '',
|
|
200
|
+
},
|
|
201
|
+
authenticationResults: {
|
|
202
|
+
spf: 'pass',
|
|
203
|
+
spfDomain: 'customer.com',
|
|
204
|
+
dkim: 'pass',
|
|
205
|
+
dkimDomain: 'customer.com',
|
|
206
|
+
dmarc: 'pass',
|
|
207
|
+
dmarcPolicy: 'none',
|
|
208
|
+
},
|
|
209
|
+
headers: {
|
|
210
|
+
'From': 'support@customer.com',
|
|
211
|
+
'To': 'admin@serve.zone',
|
|
212
|
+
'CC': 'ops@serve.zone',
|
|
213
|
+
'Subject': 'Re: Infrastructure Review',
|
|
214
|
+
'Date': 'Mon, 15 Jan 2024 14:25:00 +0000',
|
|
215
|
+
'MIME-Version': '1.0',
|
|
216
|
+
'Content-Type': 'text/plain; charset=UTF-8',
|
|
217
|
+
'In-Reply-To': '<prev123@serve.zone>',
|
|
218
|
+
},
|
|
219
|
+
body: 'Hi Admin,\n\nThank you for the detailed infrastructure review report.\n\nWe have reviewed the recommendations and would like to\nproceed with the following:\n\n1. Upgrade to the Pro tier\n2. Enable automatic backups\n3. Set up monitoring alerts\n\nPlease let us know the timeline for these changes.\n\nBest regards,\nCustomer Support Team',
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
async onActivate(context: { appui: DeesAppui; viewId: string }) {
|
|
224
|
+
this.appui = context.appui;
|
|
225
|
+
|
|
226
|
+
this.appui.setContentTabs([
|
|
227
|
+
{
|
|
228
|
+
key: 'All Emails',
|
|
229
|
+
action: () => {
|
|
230
|
+
this.currentDirectionFilter = 'all';
|
|
231
|
+
this.currentView = 'list';
|
|
232
|
+
this.updateSecondaryMenu();
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: 'Inbound',
|
|
237
|
+
action: () => {
|
|
238
|
+
this.currentDirectionFilter = 'inbound';
|
|
239
|
+
this.currentView = 'list';
|
|
240
|
+
this.updateSecondaryMenu();
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
key: 'Outbound',
|
|
245
|
+
action: () => {
|
|
246
|
+
this.currentDirectionFilter = 'outbound';
|
|
247
|
+
this.currentView = 'list';
|
|
248
|
+
this.updateSecondaryMenu();
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
]);
|
|
252
|
+
|
|
253
|
+
this.updateSecondaryMenu();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
private updateSecondaryMenu() {
|
|
257
|
+
if (!this.appui) return;
|
|
258
|
+
|
|
259
|
+
this.appui.setSecondaryMenu({
|
|
260
|
+
heading: 'Email / MTA',
|
|
261
|
+
groups: [
|
|
262
|
+
{
|
|
263
|
+
name: 'Actions',
|
|
264
|
+
items: [
|
|
265
|
+
{ type: 'action', key: 'Refresh', iconName: 'lucide:RefreshCw', action: () => { console.log('Refresh emails'); } },
|
|
266
|
+
{ type: 'action', key: 'Export Logs', iconName: 'lucide:Download', action: () => { console.log('Export logs'); } },
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: 'Status Filters',
|
|
271
|
+
items: [
|
|
272
|
+
{ key: 'Delivered', iconName: 'lucide:CheckCircle', badge: '5', badgeVariant: 'success' as const, action: () => { console.log('Filter delivered'); } },
|
|
273
|
+
{ key: 'Bounced', iconName: 'lucide:XCircle', badge: '1', badgeVariant: 'error' as const, action: () => { console.log('Filter bounced'); } },
|
|
274
|
+
{ key: 'Deferred', iconName: 'lucide:Clock', badge: '1', badgeVariant: 'warning' as const, action: () => { console.log('Filter deferred'); } },
|
|
275
|
+
{ key: 'Pending', iconName: 'lucide:Loader', badge: '1', action: () => { console.log('Filter pending'); } },
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
name: 'Statistics',
|
|
280
|
+
items: [
|
|
281
|
+
{ type: 'header' as const, label: '8 Total Emails' },
|
|
282
|
+
{ type: 'header' as const, label: '62.5% Delivery Rate' },
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
onDeactivate() {
|
|
290
|
+
// Cleanup if needed
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
public static styles = [
|
|
294
|
+
cssManager.defaultStyles,
|
|
295
|
+
css`
|
|
296
|
+
:host {
|
|
297
|
+
display: block;
|
|
298
|
+
padding: 24px;
|
|
299
|
+
height: 100%;
|
|
300
|
+
overflow-y: auto;
|
|
301
|
+
box-sizing: border-box;
|
|
302
|
+
}
|
|
303
|
+
`,
|
|
304
|
+
];
|
|
305
|
+
|
|
306
|
+
public render(): TemplateResult {
|
|
307
|
+
if (this.currentView === 'detail' && this.selectedEmail) {
|
|
308
|
+
return html`
|
|
309
|
+
<sz-mta-detail-view
|
|
310
|
+
.email=${this.selectedEmail}
|
|
311
|
+
@back=${() => { this.currentView = 'list'; this.selectedEmail = null; }}
|
|
312
|
+
></sz-mta-detail-view>
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return html`
|
|
317
|
+
<sz-mta-list-view
|
|
318
|
+
.emails=${this.currentDirectionFilter === 'all'
|
|
319
|
+
? this.demoEmails
|
|
320
|
+
: this.demoEmails.filter(e => e.direction === this.currentDirectionFilter)}
|
|
321
|
+
@email-click=${(e: CustomEvent<IEmail>) => this.handleEmailClick(e.detail)}
|
|
322
|
+
></sz-mta-list-view>
|
|
323
|
+
`;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
private handleEmailClick(email: IEmail) {
|
|
327
|
+
const detail = this.demoEmailDetails[email.id];
|
|
328
|
+
if (detail) {
|
|
329
|
+
this.selectedEmail = detail;
|
|
330
|
+
this.currentView = 'detail';
|
|
331
|
+
} else {
|
|
332
|
+
console.log('No detail data available for email:', email.id);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|