-
Notifications
You must be signed in to change notification settings - Fork 738
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
Adds ability to preview non-practice resources from the sidepanel #13012
base: develop
Are you sure you want to change the base?
Conversation
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.
Hey @AllanOXDi! I have left just a few comments, mainly to migrate this work to the new subPages
structure we have for the LessonResourceSelection side panel :). Please let me know if you have any question :)
@@ -155,18 +155,24 @@ export default [ | |||
path: 'channels', | |||
component: SelectFromChannels, | |||
}, | |||
{ | |||
name: PageNames.LESSON_PREVIEW_RESOURCE, | |||
path: 'preview-selected-resources', |
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 path here could be just "preview" or "preview-resource" as "preview-selected-resources" is not completely acurate and can be confused with path to the shopping cart
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 see that previous to this change, we had a path like this preview-resources/:nodeId
:
{
name: PageNames.LESSON_PREVIEW_RESOURCE,
path: 'preview-resources/:nodeId',
component: PreviewSelectedResources,
},
Was there any reason to change the path and the param to be a query?
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 don't think there was a particular reason to
kolibri/plugins/coach/assets/src/composables/useFetchContentNode.js
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
|
||
<div> | ||
<KGrid> | ||
<KGridItem |
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.
We also have this in the SelectFromChannels view. See how you can do this with just a few lines using flex: https://github.com/allanoxdi/kolibri/blob/dbae95ec4f53687239997acd8f8278f555c0507e/kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/SelectFromChannels.vue#L4
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.
Hey @AllanOXDi! Just checking in if you looked at the flex example :). If you have strong opinions to use KGrid here lets chat!
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.
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
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'll do some manual testing to follow-up, but have left a few code comments & questions.
params: { | ||
...params, | ||
}, |
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.
Non-blocking, this could just be simplified to params,
since you're not modifying anything
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/UpdatedResourceSelection.vue
Outdated
Show resolved
Hide resolved
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 @AllanOXDi! This is looking good!
I have just commented a few things more of the files structure :). And while doing manual QA I found that the breadcrumbs links are not working properly, these should redirect to the folder within the same side panel:
Compartir.pantalla.-.2025-01-27.17_32_17.mp4
Also, it seems that the add button is currently not working:
Compartir.pantalla.-.2025-01-27.17_48_11.mp4
}).then(node => { | ||
contentNode.value = node; | ||
if (node != null) { | ||
loading.value = false; |
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 is null then will loading be true indefinitely?
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.
Yes, I see! if node
is null, theloading.value
will remain true indefinitely because the condition to setloading.value = false
is only executed whennode
is not null.
I can can see an infinite loading state here. Thanks for pointing that out
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 node
can ever be null
here - I don't think our api resource methods like fetchModel
would return anything besides the data it gets from the API request or it throws an error.
So, in this case, I think you'd probably want to just treat your then()
callback function as if it's exactly what you expected to get.
Then you can chain a catch method on it - but you'll need a way to tell the caller of useFetchContentNode
to tell the Vue component it is used in that there were errors.
kolibri/plugins/coach/assets/src/composables/useFetchContentNode.js
Outdated
Show resolved
Hide resolved
kolibri/plugins/coach/assets/src/views/lessons/LessonSummaryPage/sidePanels/PreviewContent.vue
Outdated
Show resolved
Hide resolved
|
||
<div> | ||
<KGrid> | ||
<KGridItem |
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.
Hey @AllanOXDi! Just checking in if you looked at the flex example :). If you have strong opinions to use KGrid here lets chat!
|
||
<div> | ||
<KGrid> | ||
<KGridItem |
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.
...s/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/PreviewSelectedResources.vue
Outdated
Show resolved
Hide resolved
...s/LessonSummaryPage/sidePanels/LessonResourceSelection/subPages/PreviewSelectedResources.vue
Outdated
Show resolved
Hide resolved
a23e1f2
to
b5e50d9
Compare
}); | ||
}; | ||
|
||
fetchContentNode(); |
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.
Non-blocking note. You could skip making the function fetchContentNode
altogether and just run the code within it directly since you're not returning the function from the composable and you call it within the comopsable.
b5e50d9
to
a5a0297
Compare
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.
No way back from preview screen
I think this needs a back-arrow & handler
Cannot preview Exercise content type
Seems like this might be that this.questions
is undefined in the selectedQuestion
computed property.
Otherwise, this is looking great! I tested adding/removing and going back/forth through the navigation and things are looking & feeling great.
|
Summary
Updated the KCard in the resource selection in lessons to navigate to preview resources.
Used the existing content renderer to display the content using the /lessonstemp/ path in the updated side panel.
Before
After
Closes #12988
References
#12988
Reviewer guidance
lessonstemp
path.Currently not implemented
Ability to add a resource to a lesson
Have not figured out what triggered the KBreadcrumbs error in the console
…