mirror of
https://github.com/rustmailer/bichon.git
synced 2026-08-03 07:48:34 +02:00
update
This commit is contained in:
@@ -173,7 +173,28 @@ export function MailListTable({
|
||||
{
|
||||
accessorKey: "subject",
|
||||
header: t('search.subject'),
|
||||
cell: ({ row }) => <LongText className='text-xs'>{row.original.subject}</LongText>,
|
||||
cell: ({ row }) => {
|
||||
const tags = row.original.tags ?? [];
|
||||
return (
|
||||
<div className="flex flex-col gap-1 py-1.5 min-w-0">
|
||||
<LongText className='text-xs font-medium truncate'>
|
||||
{row.original.subject}
|
||||
</LongText>
|
||||
{tags.length > 0 && (
|
||||
<div className="flex items-center gap-1 flex-wrap">
|
||||
{tags.map((tag) => (
|
||||
<span
|
||||
key={tag}
|
||||
className="inline-flex items-center rounded-md bg-primary/15 px-2 py-0.5 text-[10px] font-semibold text-primary ring-1 ring-inset ring-primary/20"
|
||||
>
|
||||
{tag}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
meta: { className: 'text-left text-xs' }
|
||||
},
|
||||
{
|
||||
|
||||
+21
-4
@@ -88,12 +88,28 @@ export function validateTag(facetPath: string) {
|
||||
};
|
||||
}
|
||||
|
||||
const invalidChars = /['"`;,()[\]{}<>]/;
|
||||
|
||||
if (invalidChars.test(facetPath)) {
|
||||
if (!facetPath.startsWith('/')) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "Tag path contains invalid characters"
|
||||
error: "Tag path must start with '/'"
|
||||
};
|
||||
}
|
||||
|
||||
let escaped = false;
|
||||
for (let i = 1; i < facetPath.length; i++) {
|
||||
const char = facetPath[i];
|
||||
|
||||
if (escaped) {
|
||||
escaped = false;
|
||||
} else if (char === '\\') {
|
||||
escaped = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (escaped) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "Tag path has unmatched escape character at the end"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -101,6 +117,7 @@ export function validateTag(facetPath: string) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function formatTimestamp(milliseconds: number): string {
|
||||
const date = new Date(milliseconds);
|
||||
const year = date.getFullYear();
|
||||
|
||||
Reference in New Issue
Block a user