cleangroupassigns

cleangroupassigns

10.2k Downloads

Feature request: CSV import

philipaarseth opened this issue ยท 10 comments

commented

Hey,

I know plenty of guilds who make their rosters on google sheets. Something that would be a fantastic middle step here would be the ability to import for instance a csv file/ string to automatically create an arrangement.

commented

Hey, I made a little csv import that works for me. It just needs all 40 players separated by comma with no spaces.
I also sent a Mail to @fjaros so he can integrate it into this repo (I currently do not have github on this machine so i did not create a pull request).

cleangroupassigns.zip

commented
commented

@tobbi007 I tested it out a little and it works quite well, well done!
Only problem is that it requires per line trailing comma which I don't think is standard .csv behaviour.
If you export from google sheets for instance, it will give you without trailing comma.
Maybe consider fixing that first?

commented

@philipaarseth I think it is standard csv behaviour. Its just a table with one row and 40 columns.
I made it like that because other addons do it the same way (looking at https://www.curseforge.com/wow/addons/raid-group-organizer). In a spreadsheet you can do a formular to get that comma separated line anyway.

But I also don not mind changing it.

commented

thanks so much for doing the work. in general i haven't bothered with it since my guild has no need for it, but i understand it can be really useful for others. I'll take a look at your changes and provide some comments.
the solution should be able to parse the input in a smart way - a number of additional separators like , \t space should be supported. leading/trailing separators should be trimmed.

commented

Sounds great. I didn't bother looking at other separators and I really do not know lua or the wow api really well ๐Ÿ˜„
A friend is organizing a lot of gdkp pugs and I wanted to help him out with that. So I might aswell share.
I thought multiple separators weren't really needed. I think most people will just do the formular once in their sheet and then forget about it. But a good explanation of the format for sure is needed (I did not do a great job there).

commented

some feedback:

  1. the child dialog should be anchored to the parent. this way if you drag the parent to another part of the screen, the import dialog will display in the center of the parent, not in the center of the screen.
  2. my first "test" import of "player1,player2,player3" throws a lua error once clicking on the imported roster. it might be because the roster expects exactly 40 players? it should be able to handle any number 1-40

I can help to make the effort production ready but somewhat busy lately so might be a week or two

commented

Hey,

I made some changes:

  1. Subframe will always show on center of parent frame.
  2. The import did not expect exactly 40 players. But there was an issue that the players not getting added to the playerTable correctly

Also the function AddToPlayerTable added players with a capital letter to the playertable and the import just added the players to the arrangementsdb "how they were written". So that was a conflict that is fixed now, first letter is always capital.

cleangroupassigns.zip

commented

awesome. looks good! i'll make some time to merge this in over the weekend

commented

Cleaned up & improved it a bit. Released in 736029b. Thanks for your contribution!