MIT-Mobile / MIT-Mobile-for-iOS

The iPhone native portion of the MIT Mobile Framework
http://m.mit.edu/about/iphoneapp.html
Other
107 stars 46 forks source link

Libraries work #148

Closed rosslebeau closed 9 years ago

rosslebeau commented 10 years ago

Thread for the libraries module work

rosslebeau commented 10 years ago

@justinanderson is there a test Kerberos and/or Touchstone account we can use?

justinanderson commented 10 years ago

@rosslebeau I can email that to you separately. But as I said during review last week, I'd like to see 3.6/dev-intrepid merged into 3.6-dev before we get into Libraries.

intrepidtong commented 10 years ago

@justinanderson That's our plan. We are just taking 1-2 hours estimating the libraries work and putting tasks into our backlog and sprints appropriately. We are still wrapping up the final fixes for dining and will be merging into 3.6-dev as soon as those are wrapped up

rosslebeau commented 10 years ago

@justinanderson Just wondering what your ideas are re: testing on iOS 8 and iPhone 6? Should we be spending time testing iPhone 4/5 with both iOS 7 and 8? The project still won't build for 64-bit so testing iPhone 6 is impossible currently.

justinanderson commented 10 years ago

@rosslebeau We should be testing on iOS 7 and 8, and will support the 6's screen but not the 6 Plus just yet. Supporting the 6 will verify that we've used autolayout correctly. The 6 Plus will get a scaled up 6 for this release.

I think Tours is the last part of the app still using the ArcGIS SDK. Once Tours is converted to MapKit, we can drop ArcGIS and support native 64-bit.

You should be able to build and test on the 5S/6/6 Plus by turning off the "active arch only" flag for dev builds. At least that's why Xcode complained when building for my 5S before.

rosslebeau commented 10 years ago

@justinanderson Aha thanks, got it running on an iPhone 6 now. I've added a temporary launch image at 1334x750 to see the proper autolayout. I'll test Libraries with this as we go; as for testing the other modules we've worked on, would you like to do it yourself or should we set aside some time?

justinanderson commented 10 years ago

@rosslebeau We'll do testing on our end here and document what we find.

rosslebeau commented 10 years ago

@justinanderson Just a heads up - almost all of the books I'm seeing in the libraries search web service contain two strings under "year" that look like these:

"year": [
    "2007",
    "c2007."
]
"year": [
    "1950",
    "1950."
]
"year": [
    "1968",
    "[1968]"
]

I'm guessing this is dirty data and not something that's actually intended/useful?

samvoigt commented 10 years ago

@justinanderson Is there an API doc somewhere for all the accounts/renewal/misc. library stuff? The 3.0 API doesn't have much for the libraries. The cleanup we're doing (decoupling web calls from view controllers so we can make the same webcalls from an iPad VC) would be a bit easier if we could see a spec. Thanks!

justinanderson commented 10 years ago

@rosslebeau That year data is correct. Just display the first one in the array. We get a lot of extra data from our library service, like alternative spellings, which we include in our API response but ignore much of in client apps.

justinanderson commented 10 years ago

@samvoigt We haven't written documentation for the account part of it yet, unfortunately. I can point out some of the differences though:

Thanks! -Sam

rosslebeau commented 10 years ago

@justinanderson The search API returns batches of items using an offset, but I don't see any way in the wireframes that the user can initiate the loading of more results. I have 2 ideas:

-Have a "Load More Results..." button cell like we did in calendars -Implement an infinite scrolling type of tableview and continue the search from the offset with a loading indicator when you get to the bottom

Thoughts?

justinanderson commented 10 years ago

@rosslebeau I would go the infinite route for Libraries. Sorry, that should've been in the mockups.

samvoigt commented 10 years ago

@justinanderson I'm noticing some slight differences between things returned by search, and things that are, say, on loan (e.g. search returns an array of authors, loaned items just have a string, search has a format field, while loaned items seem to call the same field "material")... I'm guessing this is because search is worldcat, and loan stuff is MIT libraries only, so it's slightly different, but I was wondering if these differences will get reconciled, or if we should treat these calls as returning fundamentally different things, or if they're the "same" and we should just transmogrify the web call results on our end to have them match? Thanks!

justinanderson commented 10 years ago

@samvoigt They're effectively different. I wouldn't treat them as the same type of object.

samvoigt commented 10 years ago

@justinanderson Could you put some sample Holds into the response from https://mobile-dev.mit.edu/apis/secure/libraries/account? Right now it's just an empty array. Thanks!

justinanderson commented 10 years ago

@samvoigt added a few holds. Let me know if you want items with particular attributes.

samvoigt commented 10 years ago

@justinanderson Thanks! I'm just looking for coverage of all the fields (basically using this as a spec), so as long as each possible loans/hold/fines field is there at least once, I'll be able to capture it in my model.

samvoigt commented 10 years ago

@justinanderson For displaying the hours of a library today, should we be manually parsing the library terms to see if it's open? The old webservice gave an "hours_today" field, which we don't have (and couldn't use very well to see if a given place was open for a given time anyway).

justinanderson commented 10 years ago

@samvoigt Yeah, the old code relied on the server for that, but now we'd like it handled client side. You should have enough info from the locations/ call to tell what's open when.

samvoigt commented 10 years ago

@justinanderson I do, it's just not very straightforward... we don't have any actual dates for when they're open, we have a range for when a term applies, and then within the term, we have times for a given day of the week, as well as exceptions for when the term doesn't apply, etc etc... I can get it working, just wanted to make sure there wasn't anything more straightforward hiding somewhere.

justinanderson commented 10 years ago

@samvoigt Yeah, it'll be a bit of work. Check which term today is in, check if today is a special closing or has exceptional hours, if not then figure out today's day of the week, find if there are hours for that day of the week or the previous day of the week (some days go past midnight, though none do in the data right now), then see if the time right now is inside one of those ranges.

samvoigt commented 10 years ago

@justinanderson How do you want the exception hours to be shown on the libraries details screen? The wires only show the regular hours and the closings, and the exceptions are slightly different in format than either of those. Thanks!

justinanderson commented 10 years ago

@samvoigt Exceptions should be sorted in with closings. Here's a quick mockup with an exception on June 3rd.

You can see something similar on the web at http://m.mit.edu/libraries/location-detail.php?library=Dewey+Library&termday=1412200403.

samvoigt commented 10 years ago

@justinanderson The loans returned for an account have a due_text field, but the mockups have us showing different text than appears to be coming down in the field. Should I follow the mockups, or just use the due text?

samvoigt commented 10 years ago

@justinanderson Could you add a hold to the mock data that has something which is Ready To Be Picked up? All the ones now are just In Process. Thanks!

justinanderson commented 10 years ago

@samvoigt You should use whatever due_text gives you. I'll see about adding a hold that's ready for pickup. The data you're getting now is live from the Libraries dev server, so we'll need to create a canned version of that on mobile-dev with the desired data.

samvoigt commented 10 years ago

@justinanderson Will do. For the fines, there is currently no due_text field, only the amount due, so I plan on following the mockups there. Just want to confirm this.

justinanderson commented 10 years ago

@samvoigt Actually, the mockups are wrong. There's a difference between an overdue loan and a fine, and that's lost in the mockups. Just a sec, I'll make an update to those.

samvoigt commented 10 years ago

@justinanderson What are the possible statuses for a hold? I see "In Process", "Waiting in queue" and "Will hold until xx" in the wires... Are there any others, and will these strings be constant (I need to be able to calculate the number of holds that are ready for the header in the holds tableview)? Thanks!

samvoigt commented 10 years ago

@justinanderson the overdue field on a loan item does not appear to be working right, it looks like it's always returning true: "call_number": "GV863.A1.A872x 1889", "year": "1889", "title": "Athletic sports in America, England and Australia : comprising history, characteristics, sketches of", "imprint": "Hubbard Bros.,", "doc_number": "1329726", "material": "Book", "sub_library": "Library Storage Annex", "barcode": "39080027675757", "loaned_at": "2014-08-12T17:33:00-04:00", "due_at": "2014-10-14T17:00:00-04:00", "overdue": true, "long_overdue": false, "due_text": "Overdue as of 10/14/2014 at 5:00 pm", "has_hold": false

justinanderson commented 10 years ago

@samvoigt

rosslebeau commented 10 years ago

@justinanderson Re: the "Share" button in the citations screen - I assume we are using the default UIActivityViewController. I was just going to implement this, but I realized that I'm not sure what we should be sharing. The citation comes down with HTML tags, so I guess I can either share this string with the tags attached, or perhaps take an image of the webview once its formatted?

There is an option to share an attributed string, but it seems like converting HTML to an attributed string will lead to pain and suffering, unless we have some strict subset of HTML tags to interpret.

justinanderson commented 10 years ago

@rosslebeau Here's something new as of iOS 7. Reportedly really slow with larges amounts of HTML, but I think it's ok for this.

NSString *html = @"Barndt, D. (2008). <i>Tangled routes: Women, work, and globalization on the tomato trail</i>. Lanham, Md: Rowman &amp; Littlefield Publishers. ";
NSData *data = [NSData dataWithBytes:[html cStringUsingEncoding:NSUTF8StringEncoding] length:[html length]];
NSAttributedString *attributedString = [[NSAttributedString alloc]
                                        initWithData:data
                                        options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType}
                                        documentAttributes:nil error:nil];
samvoigt commented 10 years ago

@justinanderson Currently, MITTouchstoneController handles the presentation of the login view. On iPad, this view just takes up the whole screen (same as on iPhone, but, you know, bigger). Is this ok, or do you want us to pull this out into a popover type view (which will take a bit of work, since the login command on the touchstone controller handles the presentation of the login view automagically), or is it ok to just use it as is?

justinanderson commented 10 years ago

@samvoigt https://mobile-dev.mit.edu/apis/secure/libraries/account returns static mock data now, including a hold ready for pickup and the missing ready_for_pickup_count and overdue_count fields.

samvoigt commented 10 years ago

@justinanderson for the libraries on iPad, we're showing a map with a pin, but the library detail call just returns something like: "location": "E53-100" Can we get the coordinates for the library pin included in that call? Thanks!

justinanderson commented 10 years ago

@samvoigt Sure, I'll see about adding that.

rosslebeau commented 10 years ago

@justinanderson The iPhone wireframes doesn't show a detail screen for a Fine from Your Account, and the iPad wireframes shows a detail screen for an "Overdue Loan" but not a Fine. Does this mean that Fines should not be tappable, or should we follow the "Overdue Loan" guide for a Fine detail screen? (I'll implement both the same in iPhone/iPad, unless it was really intended that iPhone has no Fine detail and iPad does)

justinanderson commented 10 years ago

@rosslebeau That's a mistake in the mockups. There's no such thing as an Overdue Loan screen, just loans, fines, and holds. I need to add a mockup of what a fine looks like and remove the overdue loan mockups.

An account item is either a loan, fine, or hold. They all use the same layout except for a couple extra rows in each. Loans say when they are due, fines say when it turned into a fine and how much the fine is now, and holds say where it will be, whether it's ready for pickup, and if so until when.

rosslebeau commented 10 years ago

@justinanderson ok cool. Looks like the extra rows are just from the item list cell anyway, so I'll just use the same basic layout and I think it should be covered.

rosslebeau commented 10 years ago

@justinanderson The wireframes for the Loan/Fine/Hold details call for the Format, Summary, Publisher< Description, and ISBN. As far as I can tell, the web service provides the Format (with the key "material"), and the ISBN. I think the Publisher may be the data with the key "imprint", but I am not 100% sure. I don't see any data for a summary or description that seems to fit what the wireframes want, and I don't see any URL or identifier for some kind of item detail web service call.

I'll build the screen with what we have, it's totally modular so adding new fields if you change the web service will be really easy. Let me know what you think about this data.

rosslebeau commented 9 years ago

@justinanderson I was just thinking, the libraries item lists (both worldcat and MIT) might look better if there were some sort of placeholder image, especially the collectionviews. Right now they can look kind of barren and the text alignment doesn't always make sense when there is no image. Thoughts on this?

Also any info on my above comment?

justinanderson commented 9 years ago

@rosslebeau I agree we need some kind of placeholder. I thought MIT had one we could steal from another book-related service, but it looks like I was wrong. So that's something we'll need art for.

About your earlier comment, that's a mistake in the mockups. WorldCat search results have summaries, but account item info doesn't. Show whatever fields you get from the data as is, and when we review Libraries work we can decide if they need different labels or if they should even show up.