-
Notifications
You must be signed in to change notification settings - Fork 735
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
Update download request fetching on topic and topic content pages #11391
Update download request fetching on topic and topic content pages #11391
Conversation
Update content node progress fetching logic for remote browsing to filter similarly.
e59e480
to
65e29c4
Compare
Build Artifacts
|
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 had some questions, but no blockers, just learning questions. Thanks @rtibbles !
const children = topic.children ? topic.children.results : []; | ||
for (const child of children) { | ||
if (child.kind === ContentNodeKinds.TOPIC) { | ||
contentnode_id__in.push(..._getAllDescendantChildren(child)); |
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 know recursion isn't actually all that uncommon, but I do enjoy seeing in the wild where it makes complete sense and not just in a documentation page from my bootcamp classes where I was only understanding it theoretically and felt so confused as a junior dev
}; | ||
|
||
const fetchRemoteBrowsingContentNodeUserData = topic => { | ||
if (get(isUserLoggedIn) && props.deviceId) { |
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.
props.deviceId
is this a way to access the props from within setup?
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.
This is the way to access it.
Importantly, the props
object is reactive, but if you destructure const { deviceId } = props
then the deviceId
will not be reactive.
@@ -827,7 +860,7 @@ | |||
const parent = parentIndex > -1 ? this.contents[parentIndex] : null; | |||
const more = parent && parent.children && parent.children.more; | |||
if (more) { | |||
if (this.isUserLoggedIn) { | |||
if (this.isUserLoggedIn && !this.deviceId) { |
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 have seen the existence check on the deviceId in a few files now and I don't really know what it's for
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.
If it's not defined then we're not browsing remotely. If it is, we are.
facility: store.getters.currentFacilityId, | ||
status: 'Pending', | ||
status: 'PENDING', |
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.
important changes here
downloadRequestMap: { | ||
[CONTENT_ID]: { | ||
id: CONTENT_ID, | ||
status: 'COMPLETED', |
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.
this is the sort of thing in a test that I need to remember for some future date, that I can actually put in a test
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.
LGTM, no regression issues observed as well.
Summary
References
Fixes #10564
Fixes #11239
Reviewer guidance
Ensure there are no regressions on the MyDownloads page.
Ensure that Download Requests are properly displayed on the topics page and the topics content page.
Ensure that adding a new download in both places properly updates the frontend in a timely fashion.
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)