denverfoundation / storybase

The code behind Floodlight
http://floodlightproject.org
MIT License
11 stars 7 forks source link

Associate uploaded/linked data with assets instead of in the separate "Add Data" step #583

Closed jwirfs-brock closed 11 years ago

jwirfs-brock commented 11 years ago

When you are uploading a map, chart or table asset, you should be able to upload and/or link to the raw data.

It would also be cool if on the Story Detail page there was some indication that a story contains data elements (like there is if you've uploaded a dataset on the "Add Data" step).

Update: Outstanding issues:

jwirfs-brock commented 11 years ago

@ghing I think it makes the most sense to deploy the current iteration as it is once it'd done, then deal with #767 in the next iteration.

ghing commented 11 years ago

@bpawlak wrote

When I click to edit a dataset ... I still have the "Data Source" field, although I thought the option for adding a data set was to pick either a data source or upload a file.

This is ambiguous labeling. "Data Source" means the name of the entity that created the data. So, this would be something like "U.S. Census Bureau" or "City of Denver Department of Health". The labels of the fields could all stand to be improved, I think.

bpawlak commented 11 years ago

I actually liked having the dataset name be the link as well as the icon... far more salient and a bigger "hit" area for the mouse.

ghing commented 11 years ago

@bpawlak Ok, they're back to being links now.

bpawlak commented 11 years ago

Just took a look at dev. According to the checkboxes in the first comment (on 06.06.13 10:10am MST), all looks good. Do have an opinion about the icon on the left or right. I kind of like it on the left as it also doubles as a "bullet point" for multiple data sets. Should be top aligned, too.

See below - long data set names can cause the icon-on-the-right solution to look weird.

image

ghing commented 11 years ago

. Do have an opinion about the icon on the left or right. I kind of like it on the left as it also doubles as a "bullet point" for multiple data sets.

That was my original thinking too. @jwirfs-brock, do you have a strong preference for download/external link icon to the left or right of the item in the list? I'll make sure to top-align it either way.

jwirfs-brock commented 11 years ago

@ghing @bpawlak That's a good observation about the left-alignment creating a bullet point. Let's go with that.

jwirfs-brock commented 11 years ago

@bpawlak Did you have any suggestions about how/where we display the data attribution (checkpoint 3 on the list)?

Some suggestions @ghing had were:

Other ideas?

bpawlak commented 11 years ago

Sorry, I forgot to comment on that. Yes, I would think medium-grey text (smaller, and maybe italics - although that can be harder to read) below the Data Set title works.

jwirfs-brock commented 11 years ago

@ghing @bpawlak One thing I noticed while testing this out is that, when you are adding a new dataset, you can enter in both a URL and upload a file into the edit window. But then, once you click save, just the URL will show up.

I'm not sure if there is a way to make this clearer to the user. People might think they can do both and be confused. Or, maybe it won't be an issue.

jwirfs-brock commented 11 years ago

When I click to edit a dataset I still have the "Data Source" field, although I thought the option for adding a data set was to pick either a data source or upload a file - This is ambiguous naming. Data source is the name of the entity that provided the data, e.g. U.S. Census Bureau or City of Denver

I also found this ambiguous. I made some microcopy notes, and one of them includes just changing this to "Source."

ghing commented 11 years ago

One thing I noticed while testing this out is that, when you are adding a new dataset, you can enter in both a URL and upload a file into the edit window. But then, once you click save, just the URL will show up.

@jwirfs-brock, this is #767

Note that it won't actually allow you to create a data set with both items. It will return with an error message.

For now, think about what microcopy we can add/edit to make this as clear as possible. We can disambiguate this for real once we implement #767

jwirfs-brock commented 11 years ago

Microcopy edits:

Note that we should stick with the convention of "dataset" as one word throughout (this matches the convention on codataengine.org).

bpawlak commented 11 years ago

@jwirfs-brock, check out: https://github.com/PitonFoundation/atlas/issues/767... it's related

jwirfs-brock commented 11 years ago

Ah, ok. Note that I did not see an error message. It just saved the dataset and kept the URL, not the file I had selected.

jwirfs-brock commented 11 years ago

For the test scenario:

   Scenario: View datasets in the story viewer
            Given the scenario "Add an additional dataset to a table asset" has been run
            Given the user clicks the "Preview" link
            Given the user clicks the "Next" button
            Then "FOIA No Heats 2011 to Present" appears in the dataset list below the asset content
            Then "FOIA No Heats 2011 to Present" has an "external" icon
            Then "FOIA No Heats 2011 to Present" lists "City of Chicago" as the source
            Then "Test CSV Data" appears in the dataset list below the asset content
            Then "Test CSV Data" has a "download" icon
            Then "Test CSV Data" lists "City of Chicago" as the source
            Given the user clicks the "FOIA No Heats 2011 to Present" link
            Then the URL "https://docs.google.com/spreadsheet/ccc?key=0AvaXS4x_XvJmdGthMFBSb1BJOUNPTnhaNWN4UDZnZkE#gid=0" opens in a new tab
            Given the user closes the browser tab
            Given the user clicks the "Test CSV Data" link
            Then the user is prompted to download the file "test_data.csv"

Everything worked as expected, except the dataset "FOIA No Heats 2011 to Present" opened in a new window instead of a new tab.

jwirfs-brock commented 11 years ago

Related to the comment above about the external dataset opening up in a new window instead of a new tab, I also observed this when clicking on the link from the story detail page.

bpawlak commented 11 years ago

Is that a browser setting? Because when I click on a data source, it opens a new tab and immediately gives me the OS's "save location" dialog.

Question: Does the link have to open in a new tab if all we're doing is downloading data (an Excel spreadsheet in my test instance)? Or, does it work this way in the event the data is actually a URL (instead of a file)?

jwirfs-brock commented 11 years ago

@bpawlak @ghing I observed this when I was viewing an external dataset via a URL. I am not sure if it's a browser setting -- I was testing in Firefox, and other things open in new tabs by default (like when I preview a story). I just tried it in Chrome, though, and external datasets are opening in a new tab as expected.

ghing commented 11 years ago

@bpawlak,

Or, does it work this way in the event the data is actually a URL (instead of a file)?

That's exactly why it does this. We only know for sure that files uploaded to Floodlight are downloadable. We make an educated guess when the user provides a URL based on filename extensions in the URL.

For me, the new tab closes as soon as I download the file. It only remains open and empty if you cancel the download. So, opening the downloadable file in a new tab seemed like an ok behavior since in the vast majority of cases I'm assuming users will want to save the file (and thus automatically close the extra tab).

ghing commented 11 years ago

@jwirfs-brock, @bpawlak I confirmed that on Firefox, the links open in a new window rather than a new tab. I'll look at the docs and see if there's a way to force a certain behavior with window.open and Firefox.

ghing commented 11 years ago

@jwirfs-brock @bpawlak it turns out there's some subtlety to how Firefox handles window.open. See 579ae71 for the gory details, but dataset links should open in a new tab in Firefox (unless the user has configured other behavior explicitly in the browser settings).