Add new waffle for modals.

This commit is contained in:
Robert Raposa
2018-01-30 14:15:58 -05:00
parent 8b7701df9e
commit d6c15ffdbf
3 changed files with 11 additions and 8 deletions

View File

@@ -1,10 +1,15 @@
"""
Learner analytics helpers and settings
"""
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag, WaffleFlagNamespace
from openedx.core.djangoapps.waffle_utils import (
CourseWaffleFlag, WaffleFlag, WaffleFlagNamespace
)
# Namespace for learner analytics waffle flags.
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='learner_analytics')
# Simple safety valve in case the modal breaks DOM.
INCLUDE_UPSELL_MODAL = WaffleFlag(WAFFLE_FLAG_NAMESPACE, 'include_upsell_modal')
# Enables the learner analytics page for different courses via waffle course overrides.
ENABLE_DASHBOARD_TAB = CourseWaffleFlag(WAFFLE_FLAG_NAMESPACE, 'enable_dashboard_tab')

View File

@@ -7,7 +7,7 @@ from django.core.urlresolvers import reverse
from opaque_keys.edx.keys import CourseKey
from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
from openedx.features.learner_analytics import INCLUDE_UPSELL_MODAL
%>
<%namespace name='static' file='/static_content.html'/>
@@ -85,8 +85,7 @@ from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
<div id="currency_data" value="${currency_data}"></div>
<div class="container">
<% course_key = CourseKey.from_string('course-v1:Fake+Course+Key') %>
% if ENABLE_DASHBOARD_TAB.is_enabled(course_key):
% if INCLUDE_UPSELL_MODAL.is_enabled():
${static.renderReact(
component="UpsellExperimentModal",
id="upsell-modal",

View File

@@ -18,7 +18,7 @@ from openedx.core.djangoapps.theming import helpers as theming_helpers
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import HTML, Text
from openedx.features.learner_analytics import ENABLE_DASHBOARD_TAB
from openedx.features.learner_analytics import INCLUDE_UPSELL_MODAL
from entitlements.models import CourseEntitlement
from student.models import CourseEnrollment
@@ -125,8 +125,7 @@ from student.models import CourseEnrollment
<section class="dashboard" id="dashboard-main">
<main class="main-container" id="main" aria-label="Content" tabindex="-1">
<% course_key = CourseKey.from_string('course-v1:Fake+Course+Key') %>
% if ENABLE_DASHBOARD_TAB.is_enabled(course_key):
% if INCLUDE_UPSELL_MODAL.is_enabled():
${static.renderReact(
component="UpsellExperimentModal",
id="upsell-modal",