tsdataclinic / scout

Scout is a data discovery tool to explore open data portals worldwide.
https://scout.tsdataclinic.com
Apache License 2.0
33 stars 12 forks source link

show Add To Collection button if loading collection from URL #297

Closed indraneel closed 2 years ago

indraneel commented 2 years ago

i want to see if this makes sense, so i'll do a fuller PR message later

the change i made uses loadingCollectionFromURL to determine if the collection button should be shown. this means that:

those last few points are probably bigger issues, and i think for just getting the button on the page, this change should probably be enough. my instinct is we might want to just leave the Add to Collections button on all the datasets though, no matter where you're seeing it

jps327 commented 2 years ago

Regarding your first point: yeah, what you're saying makes sense. We should just have this button on all collections, regardless if you own it or not. Even if it's your own collection you might still want to remove it or add to other collections you own. Good point.

Regarding second point: yes, we definitely do need to rethink how sharing URLs work. The way it works right now is just not good. That is definitely outside the scope of this PR though. But in short, my opinion is that every collection should be stored in the DB. It doesn't matter if the user is authenticated or not.

If the user is authenticated, this is easier. The collection can just be linked to that user. If the user is not authenticated, instead each unauthenticated should be given a session ID that is generated by the browser. A collection will be linked to the session ID instead. This means that we will need a new column in the collections to hold a session ID, and it should only be filled when this is an unauthenticated collection.

Now that each collection has a UUID that can be looked up in the db (regardless of whether they are authenticated or not), then we can created shareable URLs using the UUID instead of storing all the collection metadata in the URL (which as you pointed out is editable and not a useful way of persisting data).

I've created a new issue to track this #299

indraneel commented 2 years ago

Regarding your first point: yeah, what you're saying makes sense. We should just have this button on all collections, regardless if you own it or not. Even if it's your own collection you might still want to remove it or add to other collections you own. Good point.

updated to meet this suggestion. I think this should close #225