This comment has been minimized.

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?

This comment has been minimized.

edited

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).

This comment has been minimized.

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 ?

This comment has been minimized.

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"

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 :-)

This comment has been minimized.

I think this is going to be a big issue for village centres - not because of subscriptions but because they are going to want order cycle every day and eventually lots of outgoing hubs - it will quickly become unworkable to open and manually change the delivery/pick-up info in each. But I will create a wishlist when confirmed :)

This comment has been minimized.

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 :-)