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

[BUU] Delete a product or variant #11068

Closed
mariocarabotta opened this issue Jun 19, 2023 · 6 comments · Fixed by #11846
Closed

[BUU] Delete a product or variant #11068

mariocarabotta opened this issue Jun 19, 2023 · 6 comments · Fixed by #11846
Assignees

Comments

@mariocarabotta
Copy link
Collaborator

mariocarabotta commented Jun 19, 2023

Context

This issue builds on top of #11069, to allow to delete products and variants.

Description

- As an: enterprise user
- On page: /admin/products
- I want to be able to: delete products or variants
- So that: my catalogue is up to date

Acceptance Criteria & Tests

Scenario 1: Product - delete action
Given that I am seeing products in my catalogue
When I select the actions available for a product
Then I see an option to edit and an option to delete

Scenario 2: Product - start deleting
Given that I am seeing the actions for a product
When I select the delete option
Then I see a dialog asking for confirmation

Scenario 3: Product - keep product
Given that I am seeing the delete confirmation dialog
When I select the option to keep the product
Then the dialog disappears
And the product remains in my catalogue

Scenario 4: Product - confirm deleting
Given that I am seeing the delete confirmation dialog
When I select the option to delete the product
Then the deleting process starts
And the dialog disappears
And I see a loading indicator

Scenario 5: Product - delete successful
Given that I have started the deleting process for a product
When the process is successful
Then my catalogue reloads
And I don't see that product anymore
And I see a success message

Scenario 6: Deleting failed
Note: not sure how to handle this failure. We can look into it during development.

Scenario 7: Variant - actions not available
Given that I am seeing products in my catalogue
And I have products with one variant only
The single variant for a product does not show any action

Scenario 8: Variant - actions available
Given that I am seeing products in my catalogue
And I have products with multiple variants
Then those variants have actions

Scenario 9: Variant - delete action
Given that I am seeing products with multiple variants in my catalogue
When I select the actions available for those variants
Then I see an option to delete

Scenario 10: Variant - start deleting
Given that I am seeing the actions for a variant
When I select the delete option
Then I see a dialog asking for confirmation

Scenario 11: Variant - keep variant
Given that I am seeing the delete confirmation dialog
When I select the option to keep the variant
Then the dialog disappears
And the variant remains in my catalogue

Scenario 12: Variant - confirm deleting
Given that I am seeing the delete confirmation dialog
When I select the option to delete the variant
Then the deleting process starts
And the dialog disappears
And I see a loading indicator

Scenario 13: Variant - delete successful
Given that I have started the deleting process for a variant
When the process is successful
Then my catalogue reloads
And I don't see that variant anymore
And I see a success message

Scenario 14: Deleting failed
Note: not sure how to handle this failure. We can look into it during development.

Design specs

Figma screens are available here >
https://www.figma.com/file/v1zbrWDZSRd3Nqoe0SJ2Sm/Engineering-Delivery---Back-Office?type=design&node-id=517%3A2906&mode=design&t=PzBG8cWoBQnyy30t-1

Prototype here (delete first product) > https://www.figma.com/proto/v1zbrWDZSRd3Nqoe0SJ2Sm/Engineering-Delivery---Back-Office?page-id=517%3A2906&type=design&node-id=517-2920&viewport=606%2C258%2C0.08&t=olIZaV9DfNiQk84y-1&scaling=min-zoom&mode=design

Component Example
Confirmation dialog Screenshot 2023-08-02 at 10 21 56
Primary disruptive button relaxed Screenshot 2023-08-02 at 10 22 30
@mariocarabotta mariocarabotta self-assigned this Jun 19, 2023
@mariocarabotta mariocarabotta added the design-needed issues requiring design label Jun 19, 2023
@mariocarabotta mariocarabotta changed the title [BUU] As an enterprise user, I want to delete a product or variant, so that I can make sure my customers buy only products that are available [BUU] Delete a product or variant Jun 26, 2023
@mariocarabotta mariocarabotta removed their assignment Jul 4, 2023
@mariocarabotta mariocarabotta removed the design-needed issues requiring design label Aug 2, 2023
@dacook
Copy link
Member

dacook commented Nov 21, 2023

This is adding a new item to the actions menu. It would be worth referring to similar recent PR #11785

For the confirmation popup, I expect we want to use ConfirmModalComponent (but I haven't checked closely).

Estimating: in terms of hours I'd think it wouldn't need more than a few.

@chahmedejaz
Copy link
Collaborator

Hey @mariocarabotta - I'd love work on this, can you please assign it to me? Thanks.

@chahmedejaz
Copy link
Collaborator

@mariocarabotta - Just to confirm, is the display of success and failure messages are being handled in #11517 for this issue as well?

chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 24, 2023
@mariocarabotta
Copy link
Collaborator Author

@mariocarabotta - Just to confirm, is the display of success and failure messages are being handled in #11517 for this issue as well?

Ideally yes. the problem is that that card is still in progress. @abdellani probably has quite a few things to work on, it might not be high on his list at the moment.
do you have any preference on how to deal with it? we can decouple those scenarios, or try to prioritise updating the messages first

@chahmedejaz
Copy link
Collaborator

chahmedejaz commented Nov 25, 2023

  • I read the card issue in detail and found that it will just create the success/failure message card that will be used to handle messages for the product's name, SKU, and price changes.

  • After that issue is closed, I suggest creating separate issues for places in which we need to use that card for success or failure messages. i.e. for cloning and deleting products. Or you can just create separate issues now and link them to that card issue. Your call.

  • Unfortunately, we have to have that card so that we can have symmetry of success and failure messages throughout the app

  • However, for the time being, we can just use the same old UI notifications for success or failure messages until that card is completed.
    image

Please let me know what you think about it. Thanks.

chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 25, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 25, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 25, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 25, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
# Conflicts:
#	app/views/admin/products_v3/components/_product_actions.html.haml
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Nov 28, 2023
# Conflicts:
#	app/views/admin/products_v3/components/_product_actions.html.haml
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 13, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 13, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
# Conflicts:
#	app/views/admin/products_v3/components/_product_actions.html.haml
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
chahmedejaz added a commit to chahmedejaz/openfoodnetwork that referenced this issue Dec 20, 2023
@chahmedejaz
Copy link
Collaborator

Update:

  • It's PR is ready for review now.

@mariocarabotta mariocarabotta added pr-staged-au staging.openfoodnetwork.org.au and removed pr-staged-au staging.openfoodnetwork.org.au labels Dec 20, 2023
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
# Conflicts:
#	app/views/admin/products_v3/components/_product_actions.html.haml
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
fleblond07 pushed a commit to fleblond07/openfoodnetwork that referenced this issue Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants