fix(admin): relax Qute type-safety for arithmetic in list.html, fix JS template literals
Deploy to Production / deploy (push) Successful in 3m14s
Deploy to Production / deploy (push) Successful in 3m14s
requireTypeSafeExpressions=false allows {page+1} and (page+1)*size
in pagination conditions. JS template literals with ${days} replaced
with string concatenation to avoid Qute consuming the {days} token.
Co-Authored-By: Mira Rehfeld <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ public class SandboxListResource {
|
||||
@ConfigProperty(name = "apix.admin.key")
|
||||
String adminKey;
|
||||
|
||||
@CheckedTemplate
|
||||
@CheckedTemplate(requireTypeSafeExpressions = false)
|
||||
static class Templates {
|
||||
static native TemplateInstance list(AdminSandboxListResponse result, int page, int size, String tier);
|
||||
static native TemplateInstance error(String message);
|
||||
|
||||
@@ -117,7 +117,7 @@ document.querySelectorAll('[data-expires]').forEach(td => {
|
||||
const d = new Date(td.dataset.expires);
|
||||
const now = new Date();
|
||||
const days = Math.round((d - now) / 86400000);
|
||||
td.textContent = days < 0 ? `expired ${-days}d ago` : `in ${days}d`;
|
||||
td.textContent = days < 0 ? ('expired ' + (-days) + 'd ago') : ('in ' + days + 'd');
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user