mediacloud / web-tools

The shared repository for Media Cloud web apps (Explorer, Source Manager, Topic Mapper)
https://tools.mediacloud.org
Apache License 2.0
64 stars 30 forks source link

add advanced search to media picker #755

Closed rahulbot closed 6 years ago

rahulbot commented 6 years ago

This should be a new tab on the left side that says "advanced search". When the user clicks it, on the right it should look a lot like the advanced search in Source Mgr right now. There should be one additional dropdown - allowing the user to specify "sources" or "collections" - default to collections. Clicking search should then show a standard table like the other results in the media picker.

We can have Katy think about a better design for that once the functionality is in place.

cindyloo commented 6 years ago

do we want an option to search on both sources and collections, similar to what the Advanced search does now? @rahulbot

rahulbot commented 6 years ago

Good question. We need to think about this harder, which is hard with my cold...

Searching for a collection by metadata doesn't really make sense. What happens if you search for collections with "Name: Ghana" and "Language: En"? Do we only return collections that have "Ghana" in the name where every source is in English? That's really hard for us to do technically.

For sources, searching for "Pub Country: Ghana" and "Language: En" makes total sense... you'd get all the Ghanian sources published in English. So searching for sources by metadata makes total sense.

Is there a use case for searching for collections by metadata? I think I'm convincing myself there isn't, so perhaps "advanced search" is only for sources, and it should be an "Advanced" link on the "Search for Sources" tab. Clicking that link reveals the set of dropdowns. Clicking the link again hides them.

I like that better. Does that make sense to you or should I do a quick mockup sketch?

cindyloo commented 6 years ago

wouldn't we want to be able to find collections just based in the US? eg info on "surveillance" in english in Washington DC? another question (that we can address more on monday when you feel better) - does searching by MediaType metadata for collections make sense? should it be disabled?

rahulbot commented 6 years ago

If you want US collections then click the "Pick by Geography" tab and search for US there. Or click the "Search Collections" tab and search there.

I don't think searching for collections by metadata makes any sense.

cindyloo commented 6 years ago

so a parent of the MetadataPicker in the Explorer causes problems with Focus and Blur with the renderSelectField as well as the Popup with the renderAutoCompleteField. Not sure if it is a redux-form Field issue inside a Dialog or something else related to Fields and focus. Stepped deeply into the React elements and didn't see anything really erroneous...

cindyloo commented 6 years ago

also, I tried using <FormSection /> to see if some of the Form/Field weirdness would be handled. not so much. we may have to split it out as we were discussing yesterday but I'd like to be a little more sure about what is going on...

cindyloo commented 6 years ago

ok - it has something to do with the way we are handling the modality of the MediaPicker 'Dialog'. Some css/styling seems to be swallowing some handling that we need - probably along the lines of the popup. closing in on issue - good to know it's not about the Form at all

cindyloo commented 6 years ago

AutoComplete Popover issue: https://github.com/mui-org/material-ui/issues/4393

cindyloo commented 6 years ago

some history-related challenges w/r to the react-router-redux push method... trying to change the url parameters without causing a page reload.

cindyloo commented 6 years ago

the source -Advance search methods using metadata is now complete. We need to test the combinatio of the metadata tags and the rows brought back by mediaList

cindyloo commented 6 years ago

updated advanced query to allow for an empty keyword integrate backend call to pull storyCount info