fix: omit empty zone detail rows
This commit is contained in:
parent
7af995f561
commit
5262e89d11
@ -191,19 +191,17 @@ export function SelectedZoneItemsPanel({
|
|||||||
onSelectZoneItem,
|
onSelectZoneItem,
|
||||||
}) {
|
}) {
|
||||||
if (selectedZoneItems.length === 0) {
|
if (selectedZoneItems.length === 0) {
|
||||||
|
if (!hasHiddenSelectedItems) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="location-map-zone-items">
|
<div className="location-map-zone-items">
|
||||||
<div className="location-map-zone-empty">
|
<div className="location-map-zone-empty">
|
||||||
{hasHiddenSelectedItems ? (
|
<InlineStateAction
|
||||||
<InlineStateAction
|
label="Hidden"
|
||||||
label="Hidden"
|
value={hiddenSelectedItemCount}
|
||||||
value={hiddenSelectedItemCount}
|
actionLabel="Show Zone Items"
|
||||||
actionLabel="Show Zone Items"
|
onAction={onShowSelectedZoneItems}
|
||||||
onAction={onShowSelectedZoneItems}
|
/>
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<InlineStateAction label="Items" value="0" />
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -3609,9 +3609,8 @@ test("viewer handles empty and many-item zone panels without default pins", asyn
|
|||||||
|
|
||||||
await page.locator('[data-object-key="1562"]').locator("rect").first().click();
|
await page.locator('[data-object-key="1562"]').locator("rect").first().click();
|
||||||
await expect(page.locator(".location-map-sheet-count")).toHaveText("0 items");
|
await expect(page.locator(".location-map-sheet-count")).toHaveText("0 items");
|
||||||
const emptyZoneState = page.locator(".location-map-zone-items .location-map-inline-state", { hasText: "Items" });
|
await expect(page.locator(".location-map-zone-items")).toHaveCount(0);
|
||||||
await expect(emptyZoneState).toContainText("0");
|
await expect(page.locator(".location-map-inline-state", { hasText: "Items" })).toHaveCount(0);
|
||||||
await expect(emptyZoneState.getByRole("button")).toHaveCount(0);
|
|
||||||
await expect(page.getByText("No items assigned to this zone yet.")).toHaveCount(0);
|
await expect(page.getByText("No items assigned to this zone yet.")).toHaveCount(0);
|
||||||
|
|
||||||
await page.locator('[data-object-key="1561"]').locator("rect").first().click();
|
await page.locator('[data-object-key="1561"]').locator("rect").first().click();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user