-
Notifications
You must be signed in to change notification settings - Fork 255
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
Get multi-sequences to work for v3 ranges/seqs #3333
base: master
Are you sure you want to change the base?
Conversation
MImranAsghar
commented
Nov 2, 2020
- Update sequences and canvases selectors to get multi-sequences to work for v3 top-level ranges with behavior sequence
- Add integration test for v3 multi sequences
a6cde22
to
d7f1eea
Compare
Thanks for moving this forward @MImranAsghar . I'm seeing some issues here which seems related. Can you investigate? https://deploy-preview-3333--mirador-dev.netlify.app/__tests__/integration/mirador/toc.html |
Thanks Jack. Yes, looking into it. |
d7f1eea
to
2f0fdb5
Compare
Codecov Report
@@ Coverage Diff @@
## master #3333 +/- ##
==========================================
- Coverage 89.17% 88.89% -0.28%
==========================================
Files 196 195 -1
Lines 3380 3396 +16
==========================================
+ Hits 3014 3019 +5
- Misses 366 377 +11
Continue to review full report at Codecov.
|
2f0fdb5
to
1638681
Compare
- Update sequences and canvases selectors to get multi-sequences to work for v3 top-level ranges with behavior sequence, check if full canvases exist in each sequence - Add integration test for v3 multi sequences
1638681
to
d41322c
Compare
... all items including ToC for v3, other changes - Display an option in multi seq select bar that displays all the canvases in v3 sequence along with ToC - Constrain the size of multi seqs select bar - Change sequences test to expect uuid instead of undefined id for first v3 sequence - Add checkes in getSequences selector before setting id for first v3 sequence which has undefined id initially
d41322c
to
c97d5da
Compare
Hi @mejackreed , i have added some more changes. I think for the tests |
when running these tests on mirador multiple times, some tests are giving timeout in a particular run but when I run the tests again the timeout disappears. Is it okay if those tests fail(timeout) in a pull request in that case? |
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 for continuing to move this forward @MImranAsghar . However, I'm seeing some issues with previous working content: https://iiif.bodleian.ox.ac.uk/iiif/manifest/e32a277e-91e2-4a6d-8ba6-cc4bad230410.json
It would also be helpful I think to either (or both) add some additional unit tests in the modified selectors to better codify the changes that are happening. I'm still not fully clear on what the modeling changes are intended to represent.
label: { | ||
paddingLeft: theme.spacing(1), | ||
}, | ||
select: { | ||
'& .MuiSelect-icon': { |
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'm not sure this works with our themed approach. Can you say more about the need to modify the color here?
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.
Hi Jack, this is for constraining the size of the select dropdown so it does not extend beyond the sidebar panel when there is a long sequence label.. the reasoning for setting background color to white was to make sure that the 'Arrow icon' in the select bar and the long sequence label don't overlap.
if (!sequence || !window) return undefined; | ||
|
||
if (!window.canvasId) return sequence.getCanvasByIndex(0); | ||
if (!window.canvasId && (typeof sequence.getCanvasByIndex == 'function')) { |
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.
Is the case here that the sequence is not a manifesto Sequence object?
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.
Hi Jack, this is for when the sequence represents a 'Range' manifesto object here which does not provide the 'getCanvasById' or 'getCanvases' function. 'Range' manifesto object has 'items' where it lists all the canvases.
src/state/selectors/sequences.js
Outdated
// v3 sequence (not range sequence): assign id if not there | ||
const manifestSequences = manifest.getSequences(); | ||
if (v3RangeSequences && manifestSequences && manifestSequences.length > 0 | ||
&& !manifestSequences[0].id) { |
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.
Can you say more about the case where an id would not be present?
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.
For a v3 range, manifest.getSequences() always seems to return a sequence manifesto object with all the items/manifesto canvases listed by default, even if it is not listed as range sequence. I thought displaying this as an option in the select dropdown (in addition to ranges with sequence behavior) would allow users to view all the canvases and, more importantly, the top-level Table of Contents can be displayed when this option is selected. This sequence object has the id as undefined because manifesto tries to get it from the 'items' property.
color, update getCurrentCanvas
62fea91
to
f92b5dd
Compare
src/state/selectors/sequences.js
Outdated
if (v3RangeSequences.length > 0 && manifest.items && manifest.items.length > 0 | ||
&& manifest.items[0].items && manifest.items[0].items.length > 0) { | ||
/** Use manifesto canvases provided in manifest 'items' property to populate | ||
* range 'items'/canvases | ||
*/ | ||
const canvases = manifest.items[0].items; | ||
|
||
v3RangeSequences.map((sequence) => { | ||
if (sequence.items.length === 0) { | ||
const updatedSequence = sequence; | ||
updatedSequence.items = sequence.canvases.map(canvasId => { | ||
const fullCanvas = canvases.find(c => c.id === canvasId); | ||
return fullCanvas; | ||
}); | ||
return updatedSequence; | ||
} | ||
return sequence; | ||
}); | ||
} | ||
} |
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.
Hi @mejackreed , I made a pull request to 'get' canvases in the iiif manifesto library as well so this specific change won't be needed in future and i will remove it later after that pull request gets accepted. The manifesto pull request is here IIIF-Commons/manifesto#79. Also I was wondering if you got a chance to get feedback from the designer on whether the additional sequence (which includes all manifest canvases) can be created and displayed (even if its not listed as seqs). I can make the changes accordingly after feedback from the designer.
... canvas based on the sequence/range