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

feat: Add "Recently Modified" library section [FC-0059] #1151

Conversation

yusuf-musleh
Copy link
Member

@yusuf-musleh yusuf-musleh commented Jul 10, 2024

Description

This PR adds the "Recently Modified" section in the Library Home Page along with the "View All" button that appears in other sections if there is more content than what is previewed.

Recently Modified Section
This section shows the most recently modified/created 4 or less library components. If there are no components yet in the library the section will not appear on the page. This section will always show those components regardless of whatever search terms or filters have been applied.

Screenshot 2024-07-12 at 1 34 30 PM

View All button
The "View All" button appears on all sections in the library page (excluding the "Recently Modified" section) when the number of content in the section exceeds what is being previewed (currently that limit is 4). Clicking on the "View All" button should navigate to the sections Tab to view all the content, while maintaining any search terms/filters/sorting applied.

Screenshot 2024-07-12 at 1 35 37 PM

Supporting information

Related Tickets:

Testing instructions

  1. Make sure you have edx-platform running locally
  2. Run this branch locally
  3. Make sure you have a few libraries created (you can use the soon-to-be-deprecated library-authoring mfe):
    1. A library that has 0 components
    2. A library that has more than 4 components
  4. After creating/updating the libraries, make sure to run ./manage.py cms reindex_studio --experimental in the cms container to update the search indexes with latest data
  5. In the course-authoring mfe, navigate to the libraries tab
  6. Click on the library that has 0 components:
    1. Confirm that the it shows the empty state, and no "Recently Modified" section
  7. Click on the library that has more than 4 components:
    1. Confirm that the "Recently Modified" section is shown in the home tab
    2. Confirm that the components show are in fact the most recently modified
    3. Confirm that performing a search/filtering/sorting has no impact on that section
    4. Confirm that the "View All" button is shown in the components section when there are more than 4 results
    5. Confirm that clicking on the "View All" button navigates to the "Components" tab, while maintaining any sorting/filtering/search terms applied
    6. Perform a filter or search to get 4 or less results, and confirm that the "View All" button is no longer displayed and that the number inside the components is updated to reflect how many components match
  8. Confirm that the modifying a component in the library (using the library-authoring mfe or shell) and updating the search index (see cms command above) will include that component at the beginning of the "Recently Modified" section.

Private-ref: FAL-3759

yusuf-musleh and others added 30 commits June 3, 2024 15:44
When lib mode is set to "mixed", both "Libraries" and "Legacy Libraries" tabs are show in the Studio Home. When "Libraries" is clicked, v2 libraries are fetched, when "Legacy Libraries" is clicked, v1 libraries are fetched.

When lib mode is set to "v1 only" or "v2 only", only one tab "Libraries" is show and only the respective libraries are fetched when the tab is clicked.
This is to switch between different library modes.
The path updates when selecting tabs, when accessing the url with the path directly it will open its respective tab. Navigating using the browser back/forward buttons is also supported.
This commit is temporary as the current frontend build system in tests doesnt support TS syntax. That should be fixed soon, and this commit should be removed.
This is a temporary commit since there are currently no webpack loaders that support tsx files in the test running. This commit should be removed once that is fixed upstream.
When lib mode is set to "mixed", both "Libraries" and "Legacy Libraries" tabs are show in the Studio Home. When "Libraries" is clicked, v2 libraries are fetched, when "Legacy Libraries" is clicked, v1 libraries are fetched.

When lib mode is set to "v1 only" or "v2 only", only one tab "Libraries" is show and only the respective libraries are fetched when the tab is clicked.
This is to switch between different library modes.
The path updates when selecting tabs, when accessing the url with the path directly it will open its respective tab. Navigating using the browser back/forward buttons is also supported.
This commit is temporary as the current frontend build system in tests doesnt support TS syntax. That should be fixed soon, and this commit should be removed.
This is a temporary commit since there are currently no webpack loaders that support tsx files in the test running. This commit should be removed once that is fixed upstream.
pomegranited and others added 3 commits July 10, 2024 18:30
Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ComponentType<{}> | undefined'.
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jul 10, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Jul 10, 2024

Thanks for the pull request, @yusuf-musleh!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Update the status of your PR

Your PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/lib-v2-home-recently-modified branch 2 times, most recently from 7e5bf28 to d15231d Compare July 11, 2024 13:36
using a re-usable custom hook.

Also fixed type/lint errors/console warnings.
@bradenmacdonald bradenmacdonald changed the title feat: Add "Recently Modified" library section feat: Add "Recently Modified" library section [FC-0059] Jul 12, 2024
The "View All" action appears on sections that pass in a view all action and contain content that exceeds the defined preview limit, which defaults to 4.
@yusuf-musleh
Copy link
Member Author

Tests should pass after this fix is added upstream.

Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍 Works and looks great @yusuf-musleh !

One nit, and there's 2 failing tests, but this is good to go once they're fixed.

@pomegranited
Copy link
Contributor

Merged this branch into WIP #1147, so will get this merged upstream as part of that.

@openedx-webhooks
Copy link

@yusuf-musleh Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

@pomegranited pomegranited deleted the yusuf-musleh/lib-v2-home-recently-modified branch July 20, 2024 06:50
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants