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

Basic layout for displaying "resources currently in lesson" #12845

Conversation

AllanOXDi
Copy link
Member

@AllanOXDi AllanOXDi commented Nov 14, 2024

Summary

This PR implements the "shopping cart" preview functionality as part of aligning the lesson management workflow with the side panel management

References

closes #12787

Reviewer guidance

For now test if

  • It displays an array of contentnodes, all of which are resources (no folders)

  • In the bottom bar a link should be displayed whenever the array length is > 0

  • On "select" it opens "shopping cart"

  • The header should display the number of items in the selection array

  • The lesson name is rendered in

  • The "back" arrow "minimizes" the shopping cart view. The "X" closes the side panel. no validation for closing is required

  • If each resource in the array is displayed as an item

  • If each item should have a content node icon

Not working.
Displaying the file size for each item in the list.

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend labels Nov 14, 2024
@AllanOXDi AllanOXDi changed the title WIP- don't even bother at it. WIP- don't even bother looking at it. Nov 14, 2024
@AllanOXDi AllanOXDi force-pushed the basic-layout-for-lesson-resources branch from 64c274c to e18471f Compare November 21, 2024 19:37
@AllanOXDi AllanOXDi force-pushed the basic-layout-for-lesson-resources branch from 38f90a6 to 4fa945b Compare November 22, 2024 18:03
@AllanOXDi AllanOXDi changed the title WIP- don't even bother looking at it. Basic layout display for "resources currently in lesson" Nov 22, 2024
@AllanOXDi AllanOXDi marked this pull request as ready for review November 22, 2024 19:02
@AllanOXDi
Copy link
Member Author

AllanOXDi commented Nov 22, 2024

hey @nucleogenesis this is the first part of the layout for displaying "resources currently in lesson. I have left few requirements out will get back to it on monday

@AllanOXDi AllanOXDi changed the title Basic layout display for "resources currently in lesson" Basic layout for displaying "resources currently in lesson" Nov 22, 2024
Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Hi @AllanOXDi. A lot of the foundational pieces are here! overall, I think the display of each item is visually close to done, and some of the core interactions on the side panel seem to be working. I'll leave additional feedback tomorrow, but I wanted to make sure I had done a preliminary review so that you had something to work on before I'm online.

my main question is I'm wondering why the planLessonRoutes file has been added back in here. Since Alex's finalization of the navigation updates and the refactoring there, it's no longer needed. Not sure if this just wasn't clear from the other project updates, or if this was a side effect of the rebase that you did and just got committed accidentally.

Other than that, I've left some inline comments, and I'll do a second pass tomorrow. Thank you! :)

icon="back"
@click="$router.go(-1)"
/>
<span
Copy link
Member

Choose a reason for hiding this comment

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

We may refactor this a bit when we update the side panel overall, but this should be an h1 not a span. You may need to override some of the styles so it still is the same size, but it's important that semantically it's an h1

<div class="bottom-buttons-style">
<KButton
:primary="true"
text="save & finish"
Copy link
Member

Choose a reason for hiding this comment

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

Unwrapped string!

If this string already exists, let's use that one. If it doesn't, please add it to the searchAndFilters strings

},
mounted() {
setTimeout(() => {
console.log(this.currentLesson);
Copy link
Member

Choose a reason for hiding this comment

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

was this just here for testing?

:key="index"
>
<KGrid :style="lessonOrderListButtonBorder">
<KGridItem :layout12="{ span: 6 }">
Copy link
Member

Choose a reason for hiding this comment

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

Can you update the KGridItems so that this aligns better on mobile? right now it's stacking oddly.

<div>
<DragSortWidget
moveUpText="up"
moveDownText="down"
Copy link
Member

@marcellamaki marcellamaki Nov 25, 2024

Choose a reason for hiding this comment

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

once you merge #12817, you'll need to update these^. you are now an expert on the fact that these need to be translated strings to use for the aria labels :)

@@ -0,0 +1,158 @@
<template>
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit of a nitpick, but I think calling this SelectedResources is more accurate than SelectedResource - to me the plural indicates the list, and the singular indicates the one item in the list

mounted() {
setTimeout(() => {
this.resources = this.resourceList;
}, 1000);
Copy link
Member

Choose a reason for hiding this comment

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

This is causing you to have an "extra" loading state, and it's mismatched with your loading spinner condition. I'm not sure if this is also here for testing, or if there is something else happening with loading/state management that you're trying to work around, but if that's the case, let's chat more about the situation and see if we can find another solution

Copy link
Member

Choose a reason for hiding this comment

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

on a second read, I think perhaps what is happening is that you are making a copy of the resource list to test the "remove" functionality. Let's talk about this more, because we'll need a slightly different approach, based on the resources that will ultimately be passed in here (the current selection, as opposed to the current state of the lesson)

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.

Left a few pieces of feedback, great work so far Allan!

},
methods: {
closeSidePanel() {
this.$router.go(-2);
Copy link
Member

Choose a reason for hiding this comment

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

This should probably just go straight to the root page rather than relying on the specific configuration in the browser history.

For example, if you refreshed while on this page and closed the side panel, you might not get the behavior you expect here.

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 this is called when the user clicks "Save & Finish" - should this be updating something somewhere?

@AllanOXDi AllanOXDi force-pushed the basic-layout-for-lesson-resources branch 4 times, most recently from e888e12 to d1cfe13 Compare December 5, 2024 17:56
@AllanOXDi AllanOXDi force-pushed the basic-layout-for-lesson-resources branch 3 times, most recently from 515574c to b2fdfa0 Compare December 5, 2024 18:50
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.

Some notes from review. Some of these things seem related to how things are being routed so I think that it might be worth chatting w/ @AlexVelezLl and looking at #12895 where he's working on the resource selection.

I mention this because I wonder if any changes there to how resources are selected altogether, so how you handle things like the bottom bar link respond to the user's choices may be affected by Alex's work.

Back arrow & side panel layout

When I am in the "Manage resources" page and open the "Shopping Cart" side panel, the underlying page is redirected back to the LessonRootPage somehow - so when I click the back arrow OR the X, I find myself at the list of all of my lessons.

Additionally, when I Save & Finish, I am not returned to the Lesson itself like I'd expect.

Bottom bar link

  • Shows when the value is 0
  • Does not update when I change my selection

Changes applied immediately, No "Are you sure?" confirmation modal when leaving without saving

When I remove an item and click the X to close the panel, I should be given an "Are you sure?" modal similar to what you'll see in Quiz Section Editor.

@AllanOXDi AllanOXDi force-pushed the basic-layout-for-lesson-resources branch from 15c17e9 to 26142c6 Compare December 18, 2024 18:58
},
},

computed: {
Copy link
Member

Choose a reason for hiding this comment

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

setTimeout(() => {
this.getResources();
}, 2000);
},
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be taken off- was for testing
The reason for the delay was to enable the component load fully with data, otherwise the function was returning undefined.

};
},
computed: {
...mapState('lessonSummary', ['currentLesson', 'workingResources', 'resourceCache']),
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be removed in favor of a composable

this.getLearnersForLesson(this.currentLesson),
);

const tableRow = {
Copy link
Member Author

Choose a reason for hiding this comment

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

This will also be replaced by useResourceselection compasable. We will not need it anymore

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Okay @AllanOXDi - I think this is ready to go! Please remove any code that will not be used (such as what you reference with the setTimeout, etc. that was just for testing). Once you do that, we will be able to merge. I'll open a follow up issue about the next steps once we get this and Alex's work into develop! Nice work

@AllanOXDi
Copy link
Member Author

Okay! thanks

Copy link
Member

@marcellamaki marcellamaki left a comment

Choose a reason for hiding this comment

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

Thank you, @AllanOXDi!

@marcellamaki marcellamaki dismissed nucleogenesis’s stale review December 19, 2024 19:07

Discussed requested changes with Jacob - some addressed, some will be follow up

@marcellamaki marcellamaki merged commit af1eedb into learningequality:develop Dec 19, 2024
37 checks passed
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.

Create the basic layout display for "resources currently in lesson"
3 participants