feat(studio): add batch actions, group search filter and smart unit category rules
This commit is contained in:
1 parent
669e20a35c
commit
eb3dc4e88c
4 files changed
+76
-4
No files matched your search
@@ -557,19 +557,74 @@ export function OrganizeImportsDialog({
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="flex flex-col gap-2 rounded-md border bg-[var(--admin-surface)] p-3 text-xs">
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<p className="text-xs text-muted-foreground">{t("desc")}</p>
|
||||
<div className="relative flex-1">
|
||||
<Search className="absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />
|
||||
<Input
|
||||
className="h-8 pl-8 text-xs"
|
||||
placeholder={t("searchGroups")}
|
||||
value={groupSearchQuery}
|
||||
onChange={(e) => setGroupSearchQuery(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-[10px]"
|
||||
className="h-8 px-2.5 text-[10px]"
|
||||
onClick={toggleAll}
|
||||
>
|
||||
{allApproved ? t("deselectAll") : t("selectAll")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{/* Batch Actions Bar */}
|
||||
<div className="flex flex-wrap items-center gap-2 border-t pt-2.5">
|
||||
<span className="text-[10px] font-medium text-muted-foreground">
|
||||
Batch:
|
||||
</span>
|
||||
<Select
|
||||
value={batchLayout}
|
||||
onValueChange={(v) => {
|
||||
if (isValidCatalogLayout(v)) {
|
||||
setBatchLayout(v);
|
||||
applyBatchLayout(v);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger className="h-7 w-[140px] text-[10px]">
|
||||
<SelectValue placeholder={t("batchLayout")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{CATALOG_LAYOUTS.map((l) => (
|
||||
<SelectItem key={l} value={l} className="text-xs">
|
||||
{l}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<div className="flex items-center gap-1">
|
||||
<Input
|
||||
className="h-7 w-[120px] text-[10px]"
|
||||
placeholder={t("batchPrefix")}
|
||||
value={batchPrefix}
|
||||
onChange={(e) => setBatchPrefix(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
className="h-7 px-2 text-[10px]"
|
||||
onClick={applyBatchPrefix}
|
||||
>
|
||||
{t("applyBatch")}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{groups.map((group) => {
|
||||
const o = overrides[group.name] ?? {};
|
||||
const caption = o.caption ?? group.name;
|
||||
|
||||
@@ -270,6 +270,13 @@ function pluralizeLabel(token: string): string {
|
||||
* the classname token when nothing stronger is detected.
|
||||
*/
|
||||
function unitLabel(item: SugFurni): string | null {
|
||||
const name = (item.itemName || "").toLowerCase();
|
||||
const pub = (item.publicName || "").toLowerCase();
|
||||
if (name.includes("nft") || pub.includes("nft")) return "NFTs";
|
||||
if (name.includes("dragon") || pub.includes("dragon")) return "Dragons";
|
||||
if (name.includes("laser") || pub.includes("laser")) return "Lasers";
|
||||
if (name.includes("roller") || pub.includes("roller")) return "Rollers";
|
||||
|
||||
const inter = item.interactionType?.toLowerCase();
|
||||
let label: string | undefined;
|
||||
if (inter && inter !== "default") {
|
||||
|
||||
@@ -2238,7 +2238,12 @@
|
||||
"root": "Catalog root",
|
||||
"importedRoot": "Imported Furniture",
|
||||
"cancel": "Cancel",
|
||||
"create": "Create {count, plural, one {1 page} other {# pages}}"
|
||||
"create": "Create {count, plural, one {1 page} other {# pages}}",
|
||||
"batchLayout": "Set layout for all",
|
||||
"batchPrefix": "Add prefix to all titles",
|
||||
"applyBatch": "Apply to all",
|
||||
"searchGroups": "Filter import groups...",
|
||||
"visualPreview": "Preview"
|
||||
}
|
||||
},
|
||||
"bulk": {
|
||||
|
||||
@@ -2006,7 +2006,12 @@
|
||||
"root": "Catalogus-hoofdmap",
|
||||
"importedRoot": "Imported Furniture",
|
||||
"cancel": "Annuleren",
|
||||
"create": "{count, plural, one {1 pagina aanmaken} other {# pagina's aanmaken}}"
|
||||
"create": "{count, plural, one {1 pagina aanmaken} other {# pagina's aanmaken}}",
|
||||
"batchLayout": "Indeling voor alle",
|
||||
"batchPrefix": "Prefix toevoegen aan titels",
|
||||
"applyBatch": "Toepassen op alle",
|
||||
"searchGroups": "Filter importgroepen...",
|
||||
"visualPreview": "Voorbeeld"
|
||||
}
|
||||
},
|
||||
"bulk": {
|
||||
|
||||
Reference in new issue
Block a user