Add store location map manager #20
@ -73,20 +73,24 @@ export default function LocationMapBottomSheet({
|
||||
}));
|
||||
};
|
||||
const editorActions = showEditorControls ? (
|
||||
<div className="location-map-editor-actions location-map-primary-actions">
|
||||
<button type="button" onClick={onAddObject}>Add Area</button>
|
||||
<button type="button" onClick={onPreviewDraft}>Preview Draft</button>
|
||||
<button type="button" className="primary" onClick={onSaveDraft} disabled={saving || !hasUnsavedChanges}>Save Draft</button>
|
||||
<button
|
||||
type="button"
|
||||
className="primary"
|
||||
onClick={onPublish}
|
||||
disabled={saving || (!mapState?.draft_map && !hasUnsavedChanges)}
|
||||
>
|
||||
Publish
|
||||
</button>
|
||||
<button type="button" onClick={onUndo} disabled={history.length === 0}>Undo</button>
|
||||
<button type="button" onClick={onRedo} disabled={future.length === 0}>Redo</button>
|
||||
<div className="location-map-editor-action-stack" role="group" aria-label="Map draft actions">
|
||||
<div className="location-map-editor-actions location-map-primary-actions">
|
||||
<button type="button" className="primary" onClick={onSaveDraft} disabled={saving || !hasUnsavedChanges}>Save Draft</button>
|
||||
<button
|
||||
type="button"
|
||||
className="primary"
|
||||
onClick={onPublish}
|
||||
disabled={saving || (!mapState?.draft_map && !hasUnsavedChanges)}
|
||||
>
|
||||
Publish
|
||||
</button>
|
||||
</div>
|
||||
<div className="location-map-editor-actions location-map-secondary-actions">
|
||||
<button type="button" onClick={onAddObject}>Add Area</button>
|
||||
<button type="button" onClick={onPreviewDraft} aria-label="Preview Draft">Preview</button>
|
||||
<button type="button" onClick={onUndo} disabled={history.length === 0}>Undo</button>
|
||||
<button type="button" onClick={onRedo} disabled={future.length === 0}>Redo</button>
|
||||
</div>
|
||||
</div>
|
||||
) : canManage && mapState?.published_map ? (
|
||||
<div className="location-map-editor-actions">
|
||||
|
||||
@ -396,11 +396,25 @@
|
||||
|
||||
.location-map-editor-actions {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.location-map-editor-action-stack {
|
||||
display: grid;
|
||||
gap: 0.45rem;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.location-map-primary-actions button {
|
||||
flex: 1 1 96px;
|
||||
flex: 1 1 140px;
|
||||
}
|
||||
|
||||
.location-map-secondary-actions button {
|
||||
flex: 1 1 82px;
|
||||
min-height: 38px;
|
||||
padding: 0.45rem 0.58rem;
|
||||
background: rgba(21, 40, 59, 0.78);
|
||||
color: #dbeafe;
|
||||
font-size: 0.86rem;
|
||||
}
|
||||
|
||||
.location-map-mobile-tool-switch {
|
||||
|
||||
@ -882,6 +882,18 @@ test("mobile editor uses bottom sheet controls instead of desktop object toolbar
|
||||
await expect(page.getByLabel("Map controls")).toBeVisible();
|
||||
await expect(page.locator(".location-map-tool-buttons")).toBeHidden();
|
||||
await expect(page.locator(".location-map-mobile-tool-switch")).toBeVisible();
|
||||
const primaryActions = page.locator(".location-map-primary-actions");
|
||||
const secondaryActions = page.locator(".location-map-secondary-actions");
|
||||
await expect(primaryActions.getByRole("button", { name: "Save Draft" })).toBeVisible();
|
||||
await expect(primaryActions.getByRole("button", { name: "Publish" })).toBeVisible();
|
||||
await expect(secondaryActions.getByRole("button", { name: "Add Area" })).toBeVisible();
|
||||
await expect(secondaryActions.getByRole("button", { name: "Preview Draft" })).toBeVisible();
|
||||
const primaryActionBox = await primaryActions.boundingBox();
|
||||
const secondaryActionBox = await secondaryActions.boundingBox();
|
||||
expect(primaryActionBox).not.toBeNull();
|
||||
expect(secondaryActionBox).not.toBeNull();
|
||||
if (!primaryActionBox || !secondaryActionBox) throw new Error("Mobile action groups were not measurable");
|
||||
expect(primaryActionBox.y).toBeLessThan(secondaryActionBox.y);
|
||||
await expect(page.getByRole("button", { name: "Pan" })).toHaveClass(/active/);
|
||||
await expect(page.getByRole("button", { name: "Pan" })).toHaveClass(/is-pan/);
|
||||
await expect(page.getByRole("button", { name: "Objects" })).toHaveClass(/is-edit/);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user