Add store location map manager #20
@ -46,6 +46,7 @@ export default function LocationMapBottomSheet({
|
||||
onDeleteObject,
|
||||
}) {
|
||||
const selectedTitle = selectedObject?.label || selectedObject?.zone_name || "Map Area";
|
||||
const selectedItemCountLabel = `${selectedZoneItems.length} item${selectedZoneItems.length === 1 ? "" : "s"}`;
|
||||
const sheetTitle = mode === "edit"
|
||||
? selectedObject && editorTool === "edit"
|
||||
? "Object Settings"
|
||||
@ -214,7 +215,7 @@ export default function LocationMapBottomSheet({
|
||||
<div className="location-map-zone-items">
|
||||
<div className="location-map-zone-items-title">
|
||||
<h2>{selectedTitle}</h2>
|
||||
<span>{selectedZoneItems.length}</span>
|
||||
<span>{selectedItemCountLabel}</span>
|
||||
</div>
|
||||
{selectedZoneItems.length === 0 ? (
|
||||
<p className="location-map-muted">No visible items assigned to this zone.</p>
|
||||
|
||||
@ -462,7 +462,7 @@
|
||||
}
|
||||
|
||||
.location-map-zone-items-title span {
|
||||
min-width: 34px;
|
||||
min-width: 58px;
|
||||
padding: 0.2rem 0.45rem;
|
||||
border-radius: 999px;
|
||||
background: rgba(96, 165, 250, 0.18);
|
||||
|
||||
@ -354,6 +354,8 @@ test("admin creates a map from zones, saves a draft, and publishes it", async ({
|
||||
await expect(page.getByText("loose batteries")).toHaveCount(0);
|
||||
|
||||
await page.locator(".location-map-object", { hasText: "Bread Wall" }).locator("rect").first().click();
|
||||
const zonePanel = page.locator(".location-map-zone-items");
|
||||
await expect(zonePanel.locator(".location-map-zone-items-title span")).toHaveText("2 items");
|
||||
await expect(page.getByText("french bread")).toBeVisible();
|
||||
await expect(page.getByText("sourdough")).toBeVisible();
|
||||
await expect(page.getByText("frozen salmon")).toHaveCount(0);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user