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

refactor: remove references of ENABLE_HOME_PAGE_COURSE_API_V2 #1611

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bra-i-am
Copy link
Contributor

@bra-i-am bra-i-am commented Jan 27, 2025

Description

This PR primarily aims to eliminate references to ENABLE_HOME_PAGE_COURSE_API_V2: it intends to use that API, enabling the pagination and the course filters by default without needing the flag. Moreover, it also solves some issues related to the requests to the API that make the UI blink or request more times than required.

Supporting information

https://github.com/eduNEXT/consulting-issues-mapping/issues/118

Side effects (pls help :D)

  • The Archived Courses Tab has been removed as it is no longer necessary because it relied on the previously used attribute archived_courses, which is no longer in use. With the implementation of the courses API v2, courses are marked as archived when the isActive attribute of the retrieved courses is true, as reviewed through the new filters.
  • Taking into account the conditional from courses-tab, should only be displayed when isEnablePagination is false. Since it cannot currently function this way, I assume this feature should be dropped. I wasn't able to make this work without hardcoding (I’m not sure if I'm doing something wrong or if the feature is not functioning). However, based on my review of the code, when a course is executed for re-run, it should transition to a in_process state, which I believe represents a background task, and this is indicated on the front end through the ProcessingCourses component. I’m unclear whether the element should be rendered or not with the new features (I didn't quite understand it), but currently, when the re-run is initiated, the user is redirected to a new route with its own loader button indicating the action being processed. Do you happen to know if this feature should be skipped or how I can get this to work for testing? Should we work this on another PR?

Testing instructions

  1. Mount this MFE on this specific branch in a Sumac/Nightly environment

  2. Be sure you count with many courses (11 makes to appear the pagination component)

  3. You should watch by default the search bar and filters without adding any env variable

    image

  4. Open the inspect and go to the Network tab, every time you change the search bar input or change any filter, you should see only one endpoint call is made

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 27, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Jan 27, 2025

Thanks for the pull request, @bra-i-am!

This repository is currently maintained by @openedx/2u-tnl.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are 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.


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.

@bra-i-am bra-i-am changed the title refactor: remove references of ENABLE_HOME_PAGE_COURSE_API_V2 [WIP] refactor: remove references of ENABLE_HOME_PAGE_COURSE_API_V2 Jan 27, 2025
@bra-i-am bra-i-am force-pushed the bc/rm-course-api-v2-and-fixes branch 2 times, most recently from 994e1b6 to eb6203a Compare January 30, 2025 15:37
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.30%. Comparing base (59243b0) to head (c6b6c64).
Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
src/studio-home/tabs-section/courses-tab/index.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1611    +/-   ##
========================================
  Coverage   93.30%   93.30%            
========================================
  Files        1101     1100     -1     
  Lines       21856    21821    -35     
  Branches     4741     4624   -117     
========================================
- Hits        20393    20361    -32     
- Misses       1392     1395     +3     
+ Partials       71       65     -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bra-i-am bra-i-am force-pushed the bc/rm-course-api-v2-and-fixes branch from 95ebf9d to dfabaab Compare February 3, 2025 13:28
@bra-i-am bra-i-am marked this pull request as ready for review February 3, 2025 14:13
@bra-i-am bra-i-am force-pushed the bc/rm-course-api-v2-and-fixes branch from 82b976e to c6b6c64 Compare February 18, 2025 14:32
@bra-i-am bra-i-am changed the title [WIP] refactor: remove references of ENABLE_HOME_PAGE_COURSE_API_V2 refactor: remove references of ENABLE_HOME_PAGE_COURSE_API_V2 Feb 18, 2025
@mariajgrimaldi
Copy link
Member

@bradenmacdonald: Can you help us review this PR which is part of the openedx/public-engineering#287 deprecation effort? Thank you!

@bradenmacdonald
Copy link
Contributor

  • The Archived Courses Tab has been removed as it is no longer necessary because it relied on the previously used attribute archived_courses, which is no longer in use. With the implementation of the courses API v2, courses are marked as archived when the isActive attribute of the retrieved courses is true, as reviewed through the new filters.
  • Taking into account the conditional from courses-tab, should only be displayed when isEnablePagination is false. Since it cannot currently function this way, I assume this feature should be dropped. I wasn't able to make this work without hardcoding (I’m not sure if I'm doing something wrong or if the feature is not functioning). However, based on my review of the code, when a course is executed for re-run, it should transition to a in_process state, which I believe represents a background task, and this is indicated on the front end through the ProcessingCourses component. I’m unclear whether the element should be rendered or not with the new features (I didn't quite understand it), but currently, when the re-run is initiated, the user is redirected to a new route with its own loader button indicating the action being processed. Do you happen to know if this feature should be skipped or how I can get this to work for testing? Should we work this on another PR?

Hmm, I don't think I'll be able to answer these questions. Maybe @jristau1984 or @KristinAoki can answer?

@KristinAoki
Copy link
Member

I think the ProcessingCourses component work should be moved to another PR. I have only seen it one time when a course creation job was hung. I am unable to say if it should be skipped or not. If you want to see the feature, you can manually force a course be in-progress by hard-coding the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

5 participants