participedia / frontend

DEPRECATED - see https://github.com/participedia/api/ instead
MIT License
2 stars 2 forks source link

Don't allow users to add the same case as a component/parent of itself :P #846

Open scottofletcher opened 6 years ago

scottofletcher commented 6 years ago

From @davidascher on June 18, 2018 23:14

Sender: scottowenfletch@gmail.com Comment: Component Field BUG - I should not be able to select the current case as a component or parent. Open #211 in Usersnap Dashboard

Usersnap Feedback - Component Field BUG - I should not be able to select the current case as a (...) Download original image

Browser: Firefox 60 (Windows 10) Referer: https://participedia.xyz/case/5317/edit Screen size: 1920 x 1080 Browser size: 1920 x 876

Powered by usersnap.com

Copied from original issue: participedia/usersnaps#198

jesicarson commented 6 years ago

Good point. Not a bug, but could be coded: List all the cases in the database as possible components/ parents EXCEPT FOR the case currently being edited (because it can't be/ shouldn't be listed as a component or parent of itself). OR, show an error message when a user attempts to publish a case with components and parents of itself. Whatever is easier.

At any rate, I just tested it and luckily nothing breaks when you do this. It just lists the current case under components in the data sidebar, which is weird, but hopefully not many people will do it. I would maybe switch this to P2 for this reason - unlikely to occur because hopefully most people will just not do it. (if it starts to become a major problem we can bump up to P1, lets see how it goes)