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
+85
-13
No files matched your search
@@ -557,17 +557,72 @@ export function OrganizeImportsDialog({
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex flex-col gap-2 rounded-md border bg-[var(--admin-surface)] p-3 text-xs">
|
||||||
<p className="text-xs text-muted-foreground">{t("desc")}</p>
|
<div className="flex items-center justify-between gap-2">
|
||||||
<Button
|
<div className="relative flex-1">
|
||||||
type="button"
|
<Search className="absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />
|
||||||
variant="outline"
|
<Input
|
||||||
size="sm"
|
className="h-8 pl-8 text-xs"
|
||||||
className="h-7 px-2 text-[10px]"
|
placeholder={t("searchGroups")}
|
||||||
onClick={toggleAll}
|
value={groupSearchQuery}
|
||||||
>
|
onChange={(e) => setGroupSearchQuery(e.target.value)}
|
||||||
{allApproved ? t("deselectAll") : t("selectAll")}
|
/>
|
||||||
</Button>
|
</div>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="outline"
|
||||||
|
size="sm"
|
||||||
|
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>
|
</div>
|
||||||
|
|
||||||
{groups.map((group) => {
|
{groups.map((group) => {
|
||||||
|
|||||||
@@ -270,6 +270,13 @@ function pluralizeLabel(token: string): string {
|
|||||||
* the classname token when nothing stronger is detected.
|
* the classname token when nothing stronger is detected.
|
||||||
*/
|
*/
|
||||||
function unitLabel(item: SugFurni): string | null {
|
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();
|
const inter = item.interactionType?.toLowerCase();
|
||||||
let label: string | undefined;
|
let label: string | undefined;
|
||||||
if (inter && inter !== "default") {
|
if (inter && inter !== "default") {
|
||||||
|
|||||||
@@ -2238,7 +2238,12 @@
|
|||||||
"root": "Catalog root",
|
"root": "Catalog root",
|
||||||
"importedRoot": "Imported Furniture",
|
"importedRoot": "Imported Furniture",
|
||||||
"cancel": "Cancel",
|
"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": {
|
"bulk": {
|
||||||
|
|||||||
@@ -2006,7 +2006,12 @@
|
|||||||
"root": "Catalogus-hoofdmap",
|
"root": "Catalogus-hoofdmap",
|
||||||
"importedRoot": "Imported Furniture",
|
"importedRoot": "Imported Furniture",
|
||||||
"cancel": "Annuleren",
|
"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": {
|
"bulk": {
|
||||||
|
|||||||
Reference in new issue
Block a user