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

Standing Orders - improved order cycle duplication #1052

Closed
daniellemoorhead opened this Issue Jun 21, 2016 · 12 comments

Comments

8 participants
@daniellemoorhead
Copy link
Contributor

daniellemoorhead commented Jun 21, 2016

Overview

Order Cycles can currently be "cloned", which creates a brand new OC with identical settings.

The proposed Standing Orders model requires that Order Cycles exist into the future, as far as the shop owner wants customers to be allowed to place/cancel and ultimately edit their future orders.

In light of this, the capability to copy the list of products, fees and tags from between two existing order cycles becomes desirable.

Tasks

  • Add a "Copy settings from..." button to the Order Cycles edit interface (potentially in the "Advanced Settings" section?), accessible only to coordinators
  • When this button is clicked, the user is asked to select an order cycle to copy settings from, and on confirmation runs a "copy" action to duplicate all properties duplicated by the "clone" action

@daniellemoorhead daniellemoorhead added this to the v1.10 - Funky Feijoa! milestone Jun 21, 2016

@daniellemoorhead daniellemoorhead assigned stveep and unassigned bingxie Jul 1, 2016

@daniellemoorhead

This comment has been minimized.

Copy link
Contributor Author

daniellemoorhead commented Jul 1, 2016

@stveep this is your first foray into the world of standing orders work. Have a read of this and if you've got any questions speak with @oeoeaio. Cheers!

@daniellemoorhead daniellemoorhead modified the milestones: v1.9 - Enigmatic Edamame!, v1.10 - Funky Feijoa! Jul 1, 2016

@stveep

This comment has been minimized.

Copy link
Contributor

stveep commented Jul 5, 2016

Getting on ok with this so far, just one quick Q for @oeoeaio - if the existing OC already has products, do we want to overwrite or add?

@oeoeaio

This comment has been minimized.

Copy link
Contributor

oeoeaio commented Jul 8, 2016

Hi @stveep, I think overwrite. From my perspective, the desired functionality is that the 'destination' OC looks exactly the same as the 'source' OC one the copy action has been completed. So I think it is basically just a wipe and rewrite. Does that sound ok?

@stveep

This comment has been minimized.

Copy link
Contributor

stveep commented Jul 17, 2016

Hi @oeoeaio @daniellemoorhead I've had a go at this and think it's nearly there.

Edit: I fixed my bug, which this post was really about, so never mind! I'll leave the implementation details here though:

A few details on the implementation:

  • New instance method copy_settings_from that takes oc to be copied as an argument [copy products from may be a better name and I have been a bit inconsistent with naming some methods and functions - will fix this].
  • This and the clone method now delegate to a class method to DRY up the actual copying.
  • Existing exchanges are cleared as part of the copy_settings_from method (i.e. overwrites).
  • Called by POST to /admin/order_cycles/:id/copy_settings and passing oc_to_copy id as param.
  • New ng controller AdminAdvancedOrderCyclesCtrl to allow selection of oc to copy from under advanced settings. Bootstrapping of the admin.orderCycles moved so it's before the advanced dropdown (which wasn't previously contained within the app)
  • Copying fires an event that prompts update of the order cycle details on the page (by the other controller - needs to be added for the alternative "simple controller" too I think).

You can find it on my fork here: https://github.com/stveep/openfoodnetwork/tree/1067-so-oc-duplication. I still need to add a few things.

@daniellemoorhead

This comment has been minimized.

Copy link
Contributor Author

daniellemoorhead commented Aug 3, 2016

@stveep have you got this ready in a PR for code review and testing by @oeoeaio and @sstead?

@stveep

This comment has been minimized.

Copy link
Contributor

stveep commented Aug 3, 2016

PR #1111

There is also an authentication problem that I'm not sure how to fix - it works for a [super] admin user but not for a regular user at the moment. As noted on the PR, I couldn't get my feature test working (it's there but set to "pending") and this might be why. I won't have time to look until the weekend but it's probably an easy fix if you could have a look @oeoeaio ?

@daniellemoorhead daniellemoorhead modified the milestones: v1.8.5 - पांच अंक, v1.9 - Enigmatic Edamame! Aug 17, 2016

@daniellemoorhead daniellemoorhead modified the milestones: v1.9 - Enigmatic Edamame!, v1.8.5 - पांच अंक Aug 31, 2016

@daniellemoorhead daniellemoorhead modified the milestones: Standing Orders, v1.9 - Enigmatic Edamame! Sep 25, 2016

@daniellemoorhead daniellemoorhead added this to Code Review in Subscriptions Sep 15, 2017

@daniellemoorhead daniellemoorhead moved this from Code Review to Testing in Subscriptions Sep 15, 2017

@daniellemoorhead daniellemoorhead moved this from Testing to Code Review in Subscriptions Sep 15, 2017

@sigmundpetersen sigmundpetersen removed the uk label May 29, 2018

@mkllnk

This comment has been minimized.

Copy link
Member

mkllnk commented May 29, 2018

The connected PR has been closed. Rob wants to pick this up again once standing orders are launched. I'm moving this back to dev ready.

@daniellemoorhead daniellemoorhead assigned oeoeaio and unassigned stveep and oeoeaio Jun 1, 2018

@sigmundpetersen sigmundpetersen removed the uk label Jun 21, 2018

@sigmundpetersen sigmundpetersen moved this from Code Review to Dev Ready in Subscriptions Aug 7, 2018

@daniellemoorhead daniellemoorhead moved this from Dev Ready to Backlog in Subscriptions Aug 10, 2018

@myriamboure myriamboure moved this from Backlog to For later iteration (can be closed for now) in Subscriptions Oct 12, 2018

@myriamboure

This comment has been minimized.

Copy link
Contributor

myriamboure commented Oct 22, 2018

If we go back to the need, what is it? The need is to enable hub manager to create easily a batch of OC attached to a schedule. To answer that need there are multiple possibilities:

  • from OC page duplicate an OC, and when duplicating make sure schedules are also duplicated (not the case for now). So hub manager could duplicate in a row and just update name and open/close date by bulk in the main OC page.
  • assume that the hub manager has created "empty or almost empty" OC to be able to create the schedule, and allow her to fill in the OC quickly by importing settings / content from other OCs.
  • maybe it's from the "shedule" page that we should be able to "create OCs in batch"
  • ...

I would say that given the scoped need described here https://community.openfoodnetwork.org/t/a-hub-manager-can-setup-an-automatic-standing-order-for-a-registered-customer/1462 this issue is out of scope so I will just close it for now.

When we get feedbacks from users saying it's not practical, we can open a wishlist about the need and investigate potential solutions and decide.
We don't know if the need is there, for now the users in France who are using it only create one OC in advance and create the schedule with it, and then create OCs on the flow. But other users might have other behaviors of course, so let's see what users would like to improve first.

@kirstenalarsen I remember you suggested it also in some other GH issue some time ago, so if you have already feedbacks from users about it, please open a wishlist item and we can happily move it forward :-)

Subscriptions automation moved this from For later iteration (can be closed for now) to Closed Oct 22, 2018

@myriamboure

This comment has been minimized.

Copy link
Contributor

myriamboure commented Oct 22, 2018

@daniellemoorhead if you disagree just SHOUT (gently of course ;-))

@kirstenalarsen

This comment has been minimized.

Copy link
Contributor

kirstenalarsen commented Oct 23, 2018

@daniellemoorhead

This comment has been minimized.

Copy link
Contributor Author

daniellemoorhead commented Oct 26, 2018

You're the standing orders boss @myriamboure, I will leave it to you to decide what's needed or not ;)

@myriamboure

This comment has been minimized.

Copy link
Contributor

myriamboure commented Nov 1, 2018

I think it should be separate and not included in standing order, but I can see the need and it definitely deserve a deeper thinking and UX reflexion a bit broader than just "make it easier to duplicate an OC"... so yes @kirstenalarsen open a wishlist and let's start to understand the need, and start some refined inception and see if we can prioritize sooner rather than later in the tons of things we want to priroitize :-) If you move forward inception chances are higher than the project move forward quicker :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment