Add store location map manager #20
@ -47,7 +47,7 @@ export function getMapStatus(state, options = {}) {
|
|||||||
if (options.hasUnsavedChanges) return "Unsaved Draft";
|
if (options.hasUnsavedChanges) return "Unsaved Draft";
|
||||||
if (!state?.draft_map && !state?.published_map) return "No Map";
|
if (!state?.draft_map && !state?.published_map) return "No Map";
|
||||||
if (options.mode === "edit") return "Draft";
|
if (options.mode === "edit") return "Draft";
|
||||||
if (options.mode === "view" && options.previewDraft && state?.draft_map) return "Draft Preview";
|
if (options.mode === "view" && options.previewDraft && state?.draft_map) return "Viewing Draft";
|
||||||
if (state?.published_map) return "Published";
|
if (state?.published_map) return "Published";
|
||||||
if (state?.draft_map) return "Draft";
|
if (state?.draft_map) return "Draft";
|
||||||
return "No Map";
|
return "No Map";
|
||||||
|
|||||||
@ -85,7 +85,7 @@
|
|||||||
border-color: rgba(245, 158, 11, 0.36);
|
border-color: rgba(245, 158, 11, 0.36);
|
||||||
}
|
}
|
||||||
|
|
||||||
.location-map-status-draft-preview {
|
.location-map-status-viewing-draft {
|
||||||
background: rgba(14, 165, 233, 0.2);
|
background: rgba(14, 165, 233, 0.2);
|
||||||
border-color: rgba(56, 189, 248, 0.4);
|
border-color: rgba(56, 189, 248, 0.4);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1221,7 +1221,7 @@ test("admin status follows the visible map when a saved draft exists", async ({
|
|||||||
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
|
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole("button", { name: "View Draft" }).click();
|
await page.getByRole("button", { name: "View Draft" }).click();
|
||||||
await expect(page.locator(".location-map-status")).toHaveText("Draft Preview");
|
await expect(page.locator(".location-map-status")).toHaveText("Viewing Draft");
|
||||||
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
|
await expect(page.locator(".location-map-object", { hasText: "Draft Bakery" })).toBeVisible();
|
||||||
|
|
||||||
await page.getByRole("button", { name: "View" }).click();
|
await page.getByRole("button", { name: "View" }).click();
|
||||||
@ -1344,7 +1344,7 @@ test("mode switches close open map layers without resetting filters", async ({ p
|
|||||||
await expect(page.locator(".location-map-display-panel")).toHaveCount(0);
|
await expect(page.locator(".location-map-display-panel")).toHaveCount(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("mobile keeps draft preview status compact in the topbar", async ({ page }) => {
|
test("mobile keeps viewing draft status compact in the topbar", async ({ page }) => {
|
||||||
await page.setViewportSize({ width: 409, height: 838 });
|
await page.setViewportSize({ width: 409, height: 838 });
|
||||||
await mockMapShell(page);
|
await mockMapShell(page);
|
||||||
|
|
||||||
@ -1397,7 +1397,7 @@ test("mobile keeps draft preview status compact in the topbar", async ({ page })
|
|||||||
const modeButtons = page.locator(".location-map-mode-buttons");
|
const modeButtons = page.locator(".location-map-mode-buttons");
|
||||||
const historyActions = page.locator(".location-map-history-buttons");
|
const historyActions = page.locator(".location-map-history-buttons");
|
||||||
const zoomControls = page.locator(".location-map-zoom-controls");
|
const zoomControls = page.locator(".location-map-zoom-controls");
|
||||||
await expect(status).toHaveText("Draft Preview");
|
await expect(status).toHaveText("Viewing Draft");
|
||||||
|
|
||||||
const topbarBox = await topbar.boundingBox();
|
const topbarBox = await topbar.boundingBox();
|
||||||
const backButtonBox = await backButton.boundingBox();
|
const backButtonBox = await backButton.boundingBox();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user