Skip to content

Simple way to remove AMP story pages #3279

@spacedmonkey

Description

@spacedmonkey

Feature description

As a user I want there to be an easier way to remove pages from within the editor.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • AC1: It is currently possible to remove AMP story pages by pressing delete or using the remove block button on the in the top bar. However, there should be a simple way to remove pages within the UI.
  • AC2: Add "Remove page" to the right-click context menu, upon selection, page will be removed.
  • AC3: Include a "remove" link in the page panel, when a page is selected. Selecting the "remove" link will remove the page (see visual in comment below).

Implementation brief

Implementation for this issue is broken into two piece of work.

  1. Add another a Remove page back on the InspectorControls for the edit method the page block.
    Mock up of which looks like this.

Screenshot from 2019-10-15 16-17-30

  1. Add new options to the context menu that appears when a user right clicks in the stories editor.
    Currently the context menu is limiting to only appearing in one of two cases. First if a block other the the page block is selected, it shows options. Case two, if a page block is selected and there a block in the clipboard, show a 'Paste block' option.

To implement this feature, some of the limitations and checks for if page is selected. These will have to be removed. The following limitations will need to be respected.

  • When a page block is selected, a user will not be able to copy or cut or page a page.
  • However, they is no limitation on duplication, so if simple, this should also be implemented.
  • Elements in popover menu, should say, remove page instead of remove block.
  • If only one page is in the story, remove page should not be displayed.

A mockup of what this will look like.
Screenshot from 2019-10-15 15-40-31

QA testing instructions

Test 1

  • Create new story post.
  • Create a second page.
  • Select second page.
  • Click page to show right context menu (background settings).
  • Click remove page.
  • Confirm page is removed.

Test 2

  • Create new story post.
  • Create a second page.
  • Select second page.
  • Right Click page to show context menu
  • Click remove page.
  • Confirm page is removed.

Demo

Changelog entry

  • Added a new button to the sidebar to easily remove pages.

Metadata

Metadata

Assignees

Labels

EnhancementNew feature or improvement of an existing one

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions