RebelsManager icon indicating copy to clipboard operation
RebelsManager copied to clipboard

A rebel can be added to working groups when imported

Open mhulet opened this issue 5 years ago • 6 comments

Our current import (/rebels/imports/new) doesn't allow adding to working groups. We want to have a CSV column for working groups IDs.

mhulet avatar Oct 16 '19 04:10 mhulet

Hey @mhulet
To begin working on imports, I'd like to take this issue as well. Do you think it's ok ?

begault avatar Oct 20 '19 21:10 begault

Is the following format ok ? 1/2/78/4
Do you have a better proposition for separator ? (depending on your use)

begault avatar Oct 20 '19 21:10 begault

Some questions about implementation:

  • What do you think about using representers to better encapsulate stuff like https://github.com/extinctionrebellion/RebelsManager/blob/master/app/services/rebels/import_service.rb#L43 ? (Example of gem: https://github.com/apotonick/roar-rails) I feel like you'll soon need this kind of feature to manage more complex rebels parameters manipulation. It takes an input and returns a hash (or json) to easily create an object.
  • What do you think about moving csv_import into a library ? This part is not really related to your business model and some code might be shared between CSV part and Excel part. Not completely sure about this one. We might also put it into a model folder called imports to prepare for Excel version.

begault avatar Oct 20 '19 22:10 begault

@mhulet still interested by taking this issue ;)

begault avatar Nov 01 '19 16:11 begault

Damn, I completely missed your previous comments @begault. I will come back to it once I have some time to review your suggestions.

mhulet avatar Nov 02 '19 08:11 mhulet

Thanks a lot @begault.

  • About the format, why not using columns? On the user side, it will be easier to write (and read) than slashes. But maybe you suggested slashes for a good reason.
  • About moving csv_import into a library or a model imports folders: yes, that probably makes sense. I let you decide what's best (my only concern is to keep code readable and easy to maintain).
  • About representers, I have never used them personally but I have been interested in the past in Trailblazer (roar-rails suggests to switch to Trailblazer). My understanding is that architecture would make the code more complex to understand for new contributors, but I may be wrong. Maybe we should start with something small (only one representer) and I'll have a better understanding of representers themselves.

mhulet avatar Nov 03 '19 09:11 mhulet