ericvaandering / DocDB

Working repository for DocDB
25 stars 20 forks source link

Add "text with order" link to Javascript author widget #54

Closed ericvaandering closed 6 years ago

ericvaandering commented 6 years ago

On DocumentAddForm, there is no "text with order" link next to the Author selection field. Production has this. Is a "text with order" link supposed to be there?

ericvaandering commented 6 years ago

Should be there for selectable field, not JS search widget

lauramengel commented 6 years ago

Hi. This is working correctly ("text with order" there for selectable field, but not JS search widget), so I'll close this.

When I tested JS search widget before, I happened to select authors in alphabetical order, and did not realize I was controlling the order, so I thought the "text with order" option was still needed for users who wanted to control "first author" vs "second author" etc. But I am able to control the author order with JS search widget, so the "text with order" option is not needed, as you said.

ericvaandering commented 6 years ago

Hmm. I didn't remember that the JS widget controls the order, but if it does, that's fine.

lauramengel commented 6 years ago

I didn't remember that the JS widget controls the order,

Hi. You're right. When I was adding the authors, it showed them in the order I added them which made it look like it was using my order. But when I saved, it went back to alphabetical order, so I did not control the order.

Occasionally experimenters want the doc to explicitly display who is 1st author vs 2nd author or 3rd author. The "Text with Order" field allows them to specify whatever author order they want. This option is available to them as a "text with order" link when the "select authors from list" is there.

But the "text with order" link is not available to them when the JS search widget is there. So if they wanted to specifically input the authors in a particular order, they could not (except if they go back and change their author preference to "select from list").

So I reopened because it would be nice for users to have the ability to specify author order (via the "text with order" link) whether they have come into the CGI using "select author from list" or JS search widget. The default seems like it is to use the JS search widget (if the user has not specified in their author selection preferences).

Very few people have mentioned needing this feature to me, however that might be because the ability to control author order is there now. I do not know how many users would bring it up if the link were not there.

So, not an earthshattering issue, but if it's easy/uninvolved to have the "text with order" link available when using the JS search widget, that would allow users to specify author order if they want that.

ericvaandering commented 6 years ago

I don't see any reason we can't do that. Except that someone will logically ask "Why can't I use the nice new widget to select the authors in order?" :-)

The default widgets for this and topics are settings now.

ericvaandering commented 6 years ago

Ok @lauramengel try with the latest FNAL_sso? You'll also need the latest javascript installed.

lauramengel commented 6 years ago

Hi. The "text with order" link now shows up with the author selection being JS search widget.

However, clicking on the "text with order" link does not make it use the order of authors I picked. It shows them in the order I picked, but then when I submit the doc/metadata change, it goes back to using alphabetical order.

Do you want to leave this the way it was before (without the "text with order" link) and if an experimenter is determined to set explicitly first and second author, etc. We can just walk them through the workaround of changing their author selection preference to scrolled list and picking the "text with order" link there.

i.e. Since there is a workaround, we could leave it as a wish list item for later for the js search widget to allow alphabetizing or picking authors in a specific orders.

ericvaandering commented 6 years ago

It's working as expected. It is not expected that selections made in one widget are carried over if one uses a different widget. The select by list doesn't work that way either.

Counterintuitive, I agree. But I made a document in my test that has the authors done correctly.

Now, if one wants to use the JS selector to select the authors and have them ordered, there is a shorter workaround this way. You just update the metadata and click "Text w/ order".

I do notice one strange side effect which is that if the document has ordered authors, the option you can switch to is not the JS selector, but the scrolling list. I'm inclined to leave it like this.

Closing this issue, you can make another one for future ideas on overhauling the whole thing.

lauramengel commented 6 years ago

Hi. I should describe what I saw better:

So the issue is that clicking on "text with order" did not display a "text with order" multiline widget for me to type ordered authors into.

It did this on fnal_sso version DocumentAddForm when I used "Create a new Document from 1 file on your local computer". Also got the same when I used the "Update Document" and "Update metadata" buttons on a document.

The JS search widget is very nice/easy to use by the way.

ericvaandering commented 6 years ago

I suspect you didn't update or are not picking up the latest javascript as well. Try https://cd-docdbdev.fnal.gov/cgi-bin/sso/DocumentDatabase/

lauramengel commented 6 years ago

Ok. I should be getting the newest js when I do a pull, because I am symlinking to the js of the fnal_sso release (in the html dir Static/js )

From my latest fnal_sso pull, I see only one js file changed recently May 22 12:26 AuthorMethodDisplay.js. The rest are from March.

The cd-docdbdev create, update doc and update metadata pages do seem to switch nicely between "active search" and "text with order" input widgets, so I will look more at my setup.

ericvaandering commented 6 years ago

Quick way to tell. In your browser, maybe in the developer console, load that JS file. You should see two functions now and not just one.

lauramengel commented 6 years ago

Hi. I have re-tested and this is working well ("text with order" option available to "Active search" users in case they want to specify order).

Our devel setup was correct and should have gotten the JS updates in the pull, but the problem turned out to be Apache cached the older JS file. Once I forced a reload, it got the new file. Thanks for the info about the 2 vs 1 function, which helped debugging.

lauramengel commented 6 years ago

It should be ok that after using "text with order", the alternate author selection method is "scrolled list", because once a user has chosen that they want to control the order of the authors, they probably won't often want to switch to either unordered option.

ericvaandering commented 6 years ago

My browser was caching it which confused me for a while. :-)