Skip to content

Conversation

@hichamboushaba
Copy link
Member

@hichamboushaba hichamboushaba commented Oct 21, 2024

Closes: #14156

Description

This PR adds support for deleting custom fields, it has the following changes:

  • Updates the logic of combining custom fields list with pending changes to handle deleted fields.
  • Adds logic for handling the delete button in the editor screen, and return the result to the list screen.
  • Adds logic to show a notice when a field is deleted.

Steps to reproduce

  1. Open an order or product details in the app.
  2. Tap on custom fields button or row.
  3. Open an existing custom field.
  4. Tap on the menu overflow button.
  5. Tap on Delete button.

Testing information

  • Confirm that deletion works.
  • Test the undo behavior.
  • Test deleting a newly added field (not saved on the server yet)

Screenshots

Simulator.Screen.Recording.-.iPhone.15.-.2024-10-21.at.17.32.21.mp4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@hichamboushaba hichamboushaba added type: enhancement A request for an enhancement. feature: order details Related to order details. feature: add/edit products Related to adding or editing products. labels Oct 21, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Oct 21, 2024

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is assigned to the milestone 20.9. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Oct 21, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14177-588572d
Version20.8
Bundle IDcom.automattic.alpha.woocommerce
Commit588572d
App Center BuildWooCommerce - Prototype Builds #11282
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@hichamboushaba hichamboushaba force-pushed the issue/14156-delete-custom-fields branch from 4d6e67a to ef0e542 Compare October 21, 2024 11:39
@hichamboushaba hichamboushaba changed the base branch from trunk to task/13493-navigation-update-cf-list-details October 21, 2024 11:39
@hichamboushaba hichamboushaba added the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Oct 21, 2024
@hichamboushaba hichamboushaba force-pushed the issue/14156-delete-custom-fields branch from ef0e542 to 06a41c4 Compare October 21, 2024 11:49
@hichamboushaba hichamboushaba force-pushed the issue/14156-delete-custom-fields branch from a513dab to f5a75eb Compare October 21, 2024 16:33
@hichamboushaba hichamboushaba marked this pull request as ready for review October 21, 2024 16:35
Copy link
Contributor

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested with both new and existing fields and the deletion and undo work as expected ✅.

I left some non-blocking comments and suggestions below.

Base automatically changed from task/13493-navigation-update-cf-list-details to trunk October 24, 2024 11:28
@hichamboushaba hichamboushaba removed the status: do not merge Dependent on another PR, ready for review but not ready for merge. label Oct 24, 2024
@hichamboushaba hichamboushaba added this to the 20.9 milestone Oct 24, 2024
@hichamboushaba hichamboushaba merged commit 728b5ab into trunk Oct 24, 2024
18 of 19 checks passed
@hichamboushaba hichamboushaba deleted the issue/14156-delete-custom-fields branch October 24, 2024 17:58
@hafizrahman hafizrahman mentioned this pull request Oct 28, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: add/edit products Related to adding or editing products. feature: order details Related to order details. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI and logic for deleting custom field

5 participants