-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display status of item locations by status priority. #3758
Display status of item locations by status priority. #3758
Conversation
Thanks, @GrothTobias! Since @ThoWagen designed this system, I'd be interested to hear his thoughts on these changes. Also, do we need to adjust integration tests to help cover this case? At the moment I'm very busy finishing up some database-related refactoring for release 10, but if either of you think there's a strong value in getting this change included in release 10.0, I'll try to give it a closer look as soon as time permits! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the general approach in this PR is very good. Only the "uncertain" case needs some kind of change. See the comment below.
I refactored it a bit to @ThoWagen's approach. Based on the returned availability, all four statuses can be displayed now. While I'd like to somewhat separate the classes from the JavaScript, so people can easily change them, I don't really like how I did it here. As for the integration tests, I'm unsure as to how to change them to reflect the changes. @ThoWagen, I changed the return values in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below for one small suggestion.
I like the idea of changing 'true' and 'false' to more descriptive terms, but that probably counts as a breaking change that might require us to reschedule this PR from 10.1 to 11.0. Is that a problem for you? Or maybe @ThoWagen feels differently... or maybe there's a way to incorporate some backward compatibility via a deprecated option.
Regarding integration tests, if things are failing after you and @ThoWagen agree on the final shape of the code, I don't mind helping to get the tests to pass.
Regarding the classes in JS, I think it is good that you are importing them in JS, even though I understand that this does not look like the cleanest way. But currently I can not think of a better way to do this. And I agree with @demiankatz on the change from 'true'|'false'|'unknown'|'uncertain' to 'available'|'unavailable'|'unknown'|'uncertain'. This should be part of a major release or done in a backward compatible way. |
…djusted check_item_statuses.js.
Sorry, had to do something else first. I reverted the The return values would have to be changed in another PR. |
Thanks, @GrothTobias! I've asked @ThoWagen to re-review when he has a moment. If he has no concerns with this revision, I'll give it a closer look myself and then (if ready) merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I just realized that a review from me is still being requested here.
Unfortunately, something is not working properly. The Mink HoldingTest is failing. I think I found the problem. See the comments below.
Sorry for the late fix. |
@GrothTobias, thanks for the fix, and sorry for my own slow response. I think @ThoWagen will look at this soon, but he was out of office last week, and I haven't had a chance to look at this yet in his absence. :-) |
Unfortunately there are still two Mink tests failing. But the reason is not some wrong logic but that the tests are not correct anymore. The case when "multiple_locations" is "group" and the availability is "uncertain" or "unknown" needs to be modified. So basically the case "uncertain" needs to be handled somewhere in the lines 139-163 of the HoldingTest.php and if availability is null in line 174 the type is "muted" rather than "warning". |
Thanks for taking another look, @ThoWagen. @GrothTobias, please let me know if you need help fixing the tests and/or getting a standard test environment set up. I'm happy to help if you need me to, but I'll wait to hear from you before taking action in case you prefer to work on this yourself. |
I can't get the vagrant testing environment running. At first I could not import the marc records, that seemed to be a problem with symlinks in a shared folder (sadly, my host system is windows). Now I have created a new folder and did a |
@GrothTobias, I confess that I have never tried using the test suite in the Vagrant environment; I typically set up an Ubuntu VM in VirtualBox for testing, as this makes everything a bit more accessible. If that's too much trouble, though, I'm willing to investigate this further in my existing environment and see if I can easily fix the tests. :-) |
If it helps, with a wget on
|
That looks like a healthy Solr response. I suspect the problem is just that the automated testing code wasn't designed to run inside Vagrant. There's probably a way to make it work, but it may require a significant amount of configuration work. Before going down that road, I'll see if I can just solve the test problems in my own environment when time permits. (I unfortunately ran out of time today, but I might have better luck tomorrow!). |
@GrothTobias, I finally found time to run tests and found that there are two failing tests. Here's what the browser looks like during the first failure: That doesn't look quite right! Any idea what might be wrong? The test that was running had set "multiple_locations" to "group" in config.ini, and had turned on the Demo driver with this configuration:
If you have a test instance that doesn't have a record with an ID of testsample1, you should still be able to reproduce this scenario -- just change testsample1 in your Demo.ini to a different record ID. Is that any help? Please let me know if you need me to do further investigation on my end, or if you're having trouble reproducing the scenario. |
…callnumbers instead of a formatted string.
@demiankatz I have refactored the code so it does not need to create strings and explode the callnumbers and results from While I'm not quite satisfied due to serializing the callnumber arrays to use Do you have an idea to do this in a better way? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrothTobias, thanks for the progress here. I've given this another review and have a few more comments.
I can't think of a better way to deduplicate the lists; I don't expect that these should ever be so unreasonably huge that this operation will be too expensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @GrothTobias -- see below for a couple of follow-up suggestions.
It also looks like you need to run vendor/bin/phing update-bootstrap5
to get the themes back in sync.
@GrothTobias, the extra files were showing here because this branch was behind the current dev-11.0 branch. I've merged the latest changes in, and now the appropriate diffs seem to be showing again. I'm interested in whether @ThoWagen has further comments on this latest version. I'll give him a chance to comment and will take another look myself after that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the two comments below this is looking good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides that small suggestion this looks good to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrothTobias, thanks for all the progress here (and thanks for taking time to review, @ThoWagen).
I think we're nearly done, but I had a few minor comments/suggestions related to the templates, mostly related to being paranoid about escaping things. I realize that some of the missing escaping has been faithfully ported from the previous Javascript, but we might as well fix them regardless if they need fixing. (And if any data is pre-escaped and I'm being overly paranoid, feel free to ignore any irrelevant suggestions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again, @GrothTobias -- this looks good to me and all tests are passing!
Currently, if the item status for multiple locations is displayed in search results (Item_Status > multiple_locations = 'group'), locations with unknown items are always displayed as 'unknown' regardless if there are available items or not.
With this PR the displayed location status is based on the status priority configured in AvailabilityStatus:getPriority().
'Uncertain' and 'unavailable' are treated the same, as it is in the current implementation. (Not 'available' and not 'unknown')
TODO