Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Payments: Widget #24617

Closed
5 tasks done
rodrigoi opened this issue May 2, 2018 · 2 comments
Closed
5 tasks done

Simple Payments: Widget #24617

rodrigoi opened this issue May 2, 2018 · 2 comments
Assignees
Labels
[Feature] Customizer The site customizer for traditional, non-block themes. Simple Payments [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Comments

@rodrigoi
Copy link
Contributor

rodrigoi commented May 2, 2018

Scenario

The user wants to add an existing Simple Payment button to the site sidebar, make changes to a published Payment Button, or create a new one.

Steps

Select the widget

Everything starts with either selecting an existing widget from a sidebar item, or adding a new one to one of the theme's sidebars.

To do so, the user has to:

  • Open the Customizer
  • Select Widgets and the Sidebar where the Payment Button widget is located, or were the user wants to add it.
  • Search for the Simple Payments widget on the Add Widget panel, or find an existing widget to edit.
  • Click on the arrow to expand the widget and make changes to it.

The customizer should display a drop down list of existing Payment Buttons, with the option to edit the selected item, or give the user the option to create a new one.

Add Existing Payment Button

To add an existing Payment Button as a widget, the user only needs to select it from the drop down list, where they will be listed by name. They have to be listed using the same sorting than the Simple Payments dialog on the Editor.

The changes are saved live, and the content of the selected payment button should show on the preview window. Only when the user publishes the customizer changes, they will show on the site.

Create a new Payment Button

The user should be allowed to create new Payment Button directly on the customizer in case there are none available, or no existing button satisfies the user requirement.

To do so, the user will have to:

  • Click on the Add button below the drop down list.
  • Complete the form with all the required information.
  • Select an optional image from the media library.

While creating a new Payment Button, the drop down list of existing items should either be disabled or show a generic text for new items.
All changes should be live, and should reflect on the preview as the user fills the form.

img_2185

When saving the new button, it will get added to the drop down list and it will marked as selected. The preview window should reflect this change.

Adding a Payment Button this way makes it live, and available on the Editor.

Edit an existing Payment Button

  • Select the Payment Button from the drop down list.
  • Click on the Edit button.
  • A form with all the Payment button information will expand, allowing the user to perform the following actions:
    • Replace or Edit the image.
    • Update any of the fields.
    • Save the changes, discard them, or delete the Payment Button.

Form Actions
img_2186

Image Actions
image_edit_replace

All the changes are saved when clicking the

Deleting an existing Payment Button

The edit action on the widget customizer allows the user to remove any existing Payment Button from the system.
Since this action is permanent and could potentially affect existing posts or pages, we need to display a confirm dialog.

delete confirmation

Once the action is confirmed, the form should close, the Payment Button should be removed from the drop down list. The first element on the list is now the selected Payment Button, and the preview should reflect that change.

Tasks

I've created separate issues for technical tasks that will need to be completed for this flow to work.

@rodrigoi
Copy link
Contributor Author

Ready for Review on Automattic/jetpack#9782.

@rodrigoi
Copy link
Contributor Author

Closed with WordPress.com release rWP178243 of D14005-code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Customizer The site customizer for traditional, non-block themes. Simple Payments [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

No branches or pull requests

3 participants