adds logic to LibraryPage to optionally display a particular device's…#10227
adds logic to LibraryPage to optionally display a particular device's…#10227akolson merged 6 commits intolearningequality:developfrom
Conversation
Build Artifacts
|
rtibbles
left a comment
There was a problem hiding this comment.
This all makes sense to me - and for the Studio piece until we get the backend APIs on Studio unstable at least, this is the best we can do to test out the UI.
Interested if there's any intersection here with @bjester's work on the device listing that might be useful!
| * during development | ||
| */ | ||
| if (deviceId === KolibriStudioId) { | ||
| RemoteChannelResource.getKolibriStudioStatus().then(({ data }) => { |
There was a problem hiding this comment.
Flagging for any other reviewers that until we have a Studio server with the new public content APIs in them, we have to do it this way.
| "gradeLevels": label_metadata["grade_levels"], | ||
| "accessibilityLabels": label_metadata["accessibility_labels"], | ||
| "learnerNeeds": label_metadata["learner_needs"], | ||
| "baseurl": conf.OPTIONS["Urls"]["CENTRAL_CONTENT_BASE_URL"], |
There was a problem hiding this comment.
Could we call this studio_baseurl to make it more explicit?
| }, | ||
| }, | ||
| $trs: { | ||
| libraryOf: { |
There was a problem hiding this comment.
@marcellamaki @radinamatic flagging the string movement here and in the next file.
jredrejo
left a comment
There was a problem hiding this comment.
I have some doubts in how this should work, not sure if it is because of my lack of understanding of the remote browsing or an actual issue.
| } else { | ||
| if (deviceId) { | ||
| return setCurrentDevice(deviceId).then(device => { | ||
| const baseurl = deviceId === KolibriStudioId ? plugin_data.studio_baseurl : device.base_url; |
There was a problem hiding this comment.
maybe this is a naive question, but wouldn't it be possible to reuse the code from the device channel in the showAvailableChannelsPage function instead of rewritting something so similar?
There was a problem hiding this comment.
Ultimately, we should remove most of this special casing, once we have a version of Studio that we can test against that supports the v2 public content APIs, then all we need to do is pass in the Studio baseurl, and channels and resources should all be fetched properly from Studio.
| if (data.status === 'online') { | ||
| RemoteChannelResource.fetchCollection().then(channels => { | ||
| //This is a hack to return kolibri channels. | ||
| store.commit('SET_ROOT_NODES', channels); |
There was a problem hiding this comment.
There was a problem hiding this comment.
@jredrejo it looks like the current implementation within the LibraryPage returns the previously loaded library channels as the newly selected library loads. This is an issue that I think should be resolved once loading states are streamlined across the remote content browsing feature. @rtibbles any thoughts on this?
There was a problem hiding this comment.
yep, it's showing both the channels existing in the local device plus the one on the remote device.
There was a problem hiding this comment.
Though the behavior is for previous results to be cleared once the loading is complete for remote devices. Not very sure the behavior with locally hosted devices
There was a problem hiding this comment.
Yes, the lack of the loading state is key here - especially as local channels are bootstrapped into the page so there's no loading at all.
6cf054e to
dcb88b4
Compare
rtibbles
left a comment
There was a problem hiding this comment.
This is good to merge, but more to do on top of this!

Summary
This PR implements the ability to explore a device's library. Please see #9854 for spec details and figma designs
References
Closes #9854
Reviewer guidance
To review;
/learn/#/explore_librariesvia the browser address barExplorebutton of any of the libraries displayedTesting checklist
PR process
Reviewer checklist
yarnandpip)