Skip to content
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

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from

Conversation

AllanOXDi
Copy link
Member

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

Screenshot 2025-01-17 at 21 52 07

After

Screenshot 2025-01-17 at 21 38 21

Closes #12988

References

#12988

Reviewer guidance

  • See this
  • Navigate through the lesson workflow using the /lessonstemp path.
  • Can you successfully preview any non-exercise materials that use the content renderer ?
  • Is the side panel mobile responsiveness and a11y?

Currently not implemented

Ability to add a resource to a lesson
Have not figured out what triggered the KBreadcrumbs error in the console

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Jan 17, 2025
Copy link
Member

@AlexVelezLl AlexVelezLl left a 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',
Copy link
Member

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

Copy link
Member

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?

Copy link
Member Author

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


<div>
<KGrid>
<KGridItem
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just noticed that its a little bit misaligned 😅
image

@AllanOXDi AllanOXDi marked this pull request as ready for review January 24, 2025 15:40
@AllanOXDi AllanOXDi requested a review from AlexVelezLl January 24, 2025 15:40
Copy link
Member

@nucleogenesis nucleogenesis left a 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.

Comment on lines 134 to 136
params: {
...params,
},
Copy link
Member

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

Copy link
Member

@AlexVelezLl AlexVelezLl left a 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;
Copy link
Member

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?

Copy link
Member Author

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.valuewill remain true indefinitely because the condition to setloading.value = falseis only executed whennodeis not null. I can can see an infinite loading state here. Thanks for pointing that out

Copy link
Member

@nucleogenesis nucleogenesis Jan 29, 2025

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.


<div>
<KGrid>
<KGridItem
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just noticed that its a little bit misaligned 😅
image

});
};

fetchContentNode();
Copy link
Member

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.

Copy link
Member

@nucleogenesis nucleogenesis left a 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

image

Cannot preview Exercise content type

Seems like this might be that this.questions is undefined in the selectedQuestion computed property.

image


Otherwise, this is looking great! I tested adding/removing and going back/forth through the navigation and things are looking & feeling great.

@AllanOXDi
Copy link
Member Author

No way back from preview screen
I think this needs a back-arrow & handler.
This is something I discussed with @marcellamaki after @AlexVelezLl comment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build out "resource preview" for non-practice resources
4 participants