feat: add mandatory tag support to frontend and update ItemsPage to display mandatory tags

This commit is contained in:
Felix Zett 2025-08-31 22:30:48 +02:00
parent 22a34d7ad8
commit 1cfaf70803
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,7 @@
export interface Tag { export interface Tag {
id: string; id: string;
name: string; name: string;
mandatory: boolean;
} }
export interface Item { export interface Item {

View file

@ -151,11 +151,16 @@ export default function ItemsPage() {
"bg-gray-200 text-sm rounded px-1 py-0.5 flex items-center cursor-pointer " + "bg-gray-200 text-sm rounded px-1 py-0.5 flex items-center cursor-pointer " +
(newItemTags.includes(tag.id) (newItemTags.includes(tag.id)
? "bg-blue-200 text-blue-900 font-bold" ? "bg-blue-200 text-blue-900 font-bold"
: "") : "") +
(tag.mandatory ? " border-2 border-yellow-400" : "")
} }
onClick={() => toggleNewItemTag(tag.id)} onClick={() => toggleNewItemTag(tag.id)}
title={tag.mandatory ? "Pflicht-Tag (mandatory)" : ""}
> >
#{tag.name} #{tag.name}
{tag.mandatory && (
<span className="ml-1 text-yellow-500 font-bold" title="Pflicht-Tag">*</span>
)}
</span> </span>
))} ))}
<button <button