feat: add course listing alongside learner dashboard (#30553)

* refactor: split programs into separate file space

This is in preparation to allow learner dashboard routes/files to live
alongside.

* feat: add new empty course listing view

* docs: update README and split out programs

Co-authored-by: nsprenkle <nsprenkle@2u.com>
This commit is contained in:
Nathan Sprenkle
2022-06-09 11:22:04 -04:00
committed by GitHub
parent e3923ab064
commit cf6ea15fff
5 changed files with 95 additions and 47 deletions

View File

@@ -0,0 +1,56 @@
.. _programs:
==================
Programs Dashboard
==================
Status: Maintenance
Responsibilities
================
This Django app hosts dashboard pages used by edX learners. The intent is for
this Django app to include the following dashboard tabs:
- Courses
- Programs
Direction: Deprecate
====================
This is being replaced by new UI that is in active development. New functionality should not be added here.
Glossary
========
Courses
-------
The learner-facing dashboard listing active and archived enrollments. The
current implementation of the dashboard resides in
``common/djangoapps/student/``.
Programs
--------
A page listing programs in which the learner is engaged. The page also shows
learners' progress towards completing the programs. Programs are structured
collections of course runs which culminate into a certificate.
More Documentation
==================
Implementation
^^^^^^^^^^^^^^
The ``views`` module contains the Django views used to serve the Program listing
page. The corresponding Backbone app is in the
``edx-platform/static/js/learner_dashboard``.
Configuration
^^^^^^^^^^^^^
In order to turn on the Programs tab, you need to update the ``Programs API
Config`` object in the lms Django admin. Make sure you set the values
``Enabled``, ``Do we want to show program listing page`` and ``Do we want to
show xseries program advertising`` to be true

View File

@@ -1,50 +1,21 @@
Status: Maintenance
=================
Learner dashboard
=================
Responsibilities
================
This djangoapp houses 2 related dashboards owned and developed, currently by 2 separate teams:
This Django app hosts dashboard pages used by edX learners. The intent is for
this Django app to include the following dashboard tabs:
1. Courses Dashboard
2. Programs Dashboard
- Courses
- Programs
Courses Dashboard
=================
Direction: Deprecate
====================
This is being replaced by new UI that is in active development. New functionality should not be added here.
The Courses section of the Learner Dashboard is a backend supporting a new MFE experience of the learner dashboard.
Glossary
========
This aims to replace the existing dashboard at::
/common/djangoapps/student/views/dashboard.py
Courses
-------
The learner-facing dashboard listing active and archived enrollments. The
current implementation of the dashboard resides in
``common/djangoapps/student/``.
Programs
--------
A page listing programs in which the learner is engaged. The page also shows
learners' progress towards completing the programs. Programs are structured
collections of course runs which culminate into a certificate.
More Documentation
Programs Dashboard
==================
Implementation
^^^^^^^^^^^^^^
The ``views`` module contains the Django views used to serve the Program listing
page. The corresponding Backbone app is in the
``edx-platform/static/js/learner_dashboard``.
Configuration
^^^^^^^^^^^^^
In order to turn on the Programs tab, you need to update the ``Programs API
Config`` object in the lms Django admin. Make sure you set the values
``Enabled``, ``Do we want to show program listing page`` and ``Do we want to
show xseries program advertising`` to be true
See :ref:`programs`.rst doc.

View File

@@ -0,0 +1,15 @@
"""
Views for the learner dashboard.
"""
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_GET
from common.djangoapps.util.json_request import JsonResponse
@login_required
@require_GET
def course_listing(request): # pylint: disable=unused-argument
""" List of courses a user is enrolled in or entitled to """
course_cards = []
return JsonResponse(course_cards)

View File

@@ -2,14 +2,20 @@
from django.urls import path, re_path
from lms.djangoapps.learner_dashboard import programs, views
from lms.djangoapps.learner_dashboard import courses_views, programs, program_views
# Learner Dashboard Routing
urlpatterns = [
path('programs/', views.program_listing, name='program_listing_view'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/$', views.program_details, name='program_details_view'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/discussion/$', views.ProgramDiscussionIframeView.as_view(),
path('learner/', courses_views.course_listing, name='course_listing_view')
]
# Program Dashboard Routing
urlpatterns += [
path('programs/', program_views.program_listing, name='program_listing_view'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/$', program_views.program_details, name='program_details_view'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/discussion/$', program_views.ProgramDiscussionIframeView.as_view(),
name='program_discussion'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/live/$', views.ProgramLiveIframeView.as_view(),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/live/$', program_views.ProgramLiveIframeView.as_view(),
name='program_live'),
path('programs_fragment/', programs.ProgramsFragmentView.as_view(), name='program_listing_fragment_view'),
re_path(r'^programs/(?P<program_uuid>[0-9a-f-]+)/details_fragment/$', programs.ProgramDetailsFragmentView.as_view(),