astoria-tech / volunteer-dispatch

Slackbot to coordinate errand volunteering
MIT License
24 stars 9 forks source link

Change how request task splitting works #55

Closed bronzehedwick closed 4 years ago

bronzehedwick commented 4 years ago

Instead of creating new records for each individual request, then marking the original record as "Was split", modify the original request's "Tasks" field to use only the first task listed, then create new records for any subsequent tasks.

This is done because the "Was split" field often gets deleted, or filters do no use it. This shows the original record, any it appears as a duplicate and unwanted noise.

Update a new "Original Tasks" field with all the tasks, un-split, input in the original request. Add these tasks to each split record as well as the original, for tracking purposes.

bronzehedwick commented 4 years ago

@azlyth This PR requires a new "Original Tasks" hidden field.

bronzehedwick commented 4 years ago

Thanks for the feedback @bcosynot ! That was really helpful.

I re-factored the function as you suggested; I agree with that suggestion and think it's a good improvement.

I also got the clone tasks tests to pass, although I still have to figure out the other failing tests.

I also need to fix a bug I just noticed where the first posted message to slack still contains all the un-split tasks, so I converted this PR to draft state while I investigate.