Skip to content

Commit 8cb6034

Browse files
committed
fix(ui): small tweaks
1 parent 798e2ce commit 8cb6034

File tree

9 files changed

+43
-21
lines changed

9 files changed

+43
-21
lines changed

lib/routes-ui.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,6 +1719,16 @@ return true;`
17191719
case 'open-ai':
17201720
await redis.del(`${REDIS_PREFIX}:openai:error`);
17211721
break;
1722+
1723+
case 'webhook-default':
1724+
await settings.clear('webhookErrorFlag');
1725+
break;
1726+
1727+
case 'webhook-route':
1728+
if (request.payload.entry) {
1729+
await redis.hdel(`${REDIS_PREFIX}wh:c`, `${request.payload.entry}:webhookErrorFlag`);
1730+
}
1731+
break;
17221732
}
17231733

17241734
return { success: true };
@@ -1734,7 +1744,8 @@ return true;`
17341744
failAction,
17351745

17361746
payload: Joi.object({
1737-
alert: Joi.string().required().max(1024)
1747+
alert: Joi.string().required().max(1024),
1748+
entry: Joi.string().empty('').max(1024).trim()
17381749
})
17391750
}
17401751
}

static/js/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ document.addEventListener('DOMContentLoaded', () => {
435435
headers: { 'content-type': 'application/json' },
436436
body: JSON.stringify({
437437
crumb: document.getElementById('crumb').value,
438-
alert: $(this).data('clearAlert') // eslint-disable-line no-invalid-this
438+
alert: $(this).data('clearAlert'), // eslint-disable-line no-invalid-this
439+
entry: $(this).data('clearEntry') || '' // eslint-disable-line no-invalid-this
439440
})
440441
}).catch(err => console.error(err));
441442
});

views/config/license.hbs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,14 @@
258258
try {
259259
let licenseFileTxt = await readContentFromFile(fileSelectElm, 'text');
260260
if (licenseFileTxt) {
261-
licenseTextElm.value = (licenseFileTxt || '').toString().trim();
261+
licenseFileTxt = (licenseFileTxt || '').toString().trim()
262+
licenseTextElm.value = licenseFileTxt;
262263
licenseTextElm.focus();
263264
licenseTextElm.select();
264-
//document.getElementById('licenseForm').submit();
265+
266+
if (licenseFileTxt.indexOf('BEGIN LICENSE') >= 0) {
267+
document.getElementById('licenseForm').submit();
268+
}
265269
}
266270
} catch (err) {
267271
if (err.code === 'NoFileSelected') {
@@ -273,6 +277,5 @@
273277
}
274278
275279
fileSelectElm.addEventListener('change', loadFromFile);
276-
277280
});
278281
</script>

views/config/oauth/app.hbs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262

6363
<div class="alert alert-info"><strong>NB!</strong> The required "mail.imap" scope might not be available
6464
for your <a href="https://oauth.mail.ru/app/" target="_blank"
65-
referrerpolicy="{{referrerPolicy}}">OAuth2
66-
apps</a> by default.</div>
65+
referrerpolicy="{{referrerPolicy}}">OAuth2 apps</a> by default.</div>
6766
{{/if}}
6867

6968
</div>

views/config/webhooks.hbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
{{#if values.webhooksEnabled}}
2424
{{#if webhookErrorFlag}}
25-
<div class="mt-3 mb-3 alert alert-danger">
25+
<div class="mt-3 mb-3 alert clear-alert-btn alert-danger" data-clear-alert="webhook-default">
26+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
27+
<span aria-hidden="true">&times;</span>
28+
</button>
29+
2630
<p><strong>NB!</strong> The last attempted webhook failed with the response below.</p>
2731
<hr>
2832
<p class="mb-0">

views/layout/app.hbs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,11 @@
333333
<a href="{{packageData.homepage}}" target="_blank">EmailEngine</a> v{{packageData.version}}.
334334
<span class="text-muted">&copy; 2020-{{currentYear}}</span>
335335

336-
<a class="text-muted" href="mailto:info@postalsys.com" target="_blank">Postal Systems OÜ</a>.
337-
Licensed under the
338-
<a href="/license.html" target="_blank">EmailEngine License</a>.
336+
<a class="text-muted" href="https://postalsys.com/contact" target="_blank">Postal Systems
337+
OÜ</a>.
338+
<a class="" href="/admin/legal">
339+
<i class="fas fa-fw fa-gavel"></i>
340+
License and terms</a>.
339341
</div>
340342
</div>
341343
</footer>

views/legal.hbs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,17 @@
3434
<strong>
3535
{{#if licenseInfo.details.key}}
3636
{{#if licenseInfo.details.trial}}
37-
This copy of EmailEngine is running on a trial license.
37+
This copy of EmailEngine is running on a trial license
3838
{{else}}
39-
This copy of EmailEngine is licensed to <em>{{licenseInfo.details.licensedTo}}</em>.
39+
This copy of EmailEngine is licensed to <em>{{licenseInfo.details.licensedTo}}</em>
4040
{{/if}}
4141
{{else}}
42-
License key not set for this copy of EmailEngine.
42+
License key not set for this copy of EmailEngine
4343
{{/if}}
44+
45+
4446
</strong>
47+
– <a class="" href="/admin/config/license">details</a>.
4548
</li>
4649

4750
<li class="list-group-item">

views/partials/side_menu.hbs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,4 @@
106106

107107
</div>
108108
</div>
109-
</li>
110-
111-
<li class="nav-item {{#if menuLegal}}active{{/if}}">
112-
<a class="nav-link" href="/admin/legal">
113-
<i class="fas fa-fw fa-gavel"></i>
114-
<span>Legal</span></a>
115109
</li>

views/webhooks/webhook.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@
3333
{{/if}}
3434

3535
{{#if webhook.webhookErrorFlag.message}}
36-
<div class="mt-3 mb-3 alert alert-danger">
36+
<div class="mt-3 mb-3 alert clear-alert-btn alert-danger" data-clear-alert="webhook-route"
37+
data-clear-entry="{{webhook.id}}">
38+
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
39+
<span aria-hidden="true">&times;</span>
40+
</button>
41+
3742
<p><strong>NB!</strong> The last attempted webhook failed with the response below.</p>
3843
<hr>
3944
<p class="mb-0">

0 commit comments

Comments
 (0)