Files
edx-platform/openedx/core/djangoapps/credentials/config.py
Justin Hynes 9e83bf8f94 feat: Add configuration option to route View Records button to the Learner Record MFE
[APER-1922]

We are converting the legacy UI of the `records` app in the Credentials IDA (credentials.edx.org/records/, credentials.edx.org/records/programs/{uuid}, etc.) to a new MFE. Today, the Program Dashboard and the legacy (non-MFE) profile page have buttons that route learners to the Credentials IDA pages. We need to (optionally) introduce a way to route learner's to the new MFE instead.

- Introduces a new configuration setting called `LEARNER_RECORD_MICROFRONTEND_URL` (defaulting to None). This will be used by the LMS to store the base URL of the new MFE (e.g. records.stage.edx.org).
- Introduces a new waffle switch named `USE_LEARNER_RECORD_MFE`. This will be used to control whether routing learner's to the new MFE is enabled from the LMS's side.
- Updates the existing `get_credentials_records_url` function to add additional logic that will determine if we need to build a link to the legacy FE or the new MFE
- Adds tests for new and existing behavior. There were no existing unit tests for the utility function that I updated.
2022-09-07 13:44:05 -04:00

18 lines
644 B
Python

"""
This module contains various configuration settings via waffle switches for the Credentials app.
"""
from edx_toggles.toggles import WaffleSwitch
# Namespace
WAFFLE_NAMESPACE = 'credentials'
# .. toggle_name: credentials.use_learner_record_mfe
# .. toggle_implementation: WaffleSwitch
# .. toggle_default: False
# .. toggle_description: This toggle will inform the Program Dashboard to route to the Learner Record MFE over the
# legacy frontend of the Credentials IDA.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2022-09-07
USE_LEARNER_RECORD_MFE = WaffleSwitch(f"{WAFFLE_NAMESPACE}.use_learner_record_mfe", __name__)