Skip to content

Commit

Permalink
Fix oppia#6301: fixes Dev-mode label showing up for a brief amount of…
Browse files Browse the repository at this point in the history
… time on page load. (oppia#6356)

* added ng cloak to fix dev_mode showing up

* modify DIV MODE def in constants.js

* added the ng-cloak update in base_test.py

* linting errors

* lint errors

* removed css, and replicated changed in tests
  • Loading branch information
amey-kudari authored and nithusha21 committed Mar 2, 2019
1 parent aa3aa04 commit 8171f30
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions core/controllers/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ def test_dev_indicator_appears_in_dev_and_not_in_production(self):

with self.swap(constants, 'DEV_MODE', True):
response = self.get_html_response(feconf.LIBRARY_INDEX_URL)
self.assertIn('<div ng-if="DEV_MODE" class="oppia-dev-mode">',
response.body)
self.assertIn(
'<div ng-if="DEV_MODE" class="oppia-dev-mode" ng-cloak>',
response.body)

with self.swap(constants, 'DEV_MODE', False):
response = self.get_html_response(feconf.LIBRARY_INDEX_URL)
self.assertIn('<div ng-if="DEV_MODE" class="oppia-dev-mode">',
response.body)
self.assertIn(
'<div ng-if="DEV_MODE" class="oppia-dev-mode" ng-cloak>',
response.body)

def test_that_no_get_results_in_500_error(self):
"""Test that no GET request results in a 500 error."""
Expand Down
2 changes: 1 addition & 1 deletion core/templates/dev/head/pages/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h2>
</div>
</div>

<div ng-if="DEV_MODE" class="oppia-dev-mode">
<div ng-if="DEV_MODE" class="oppia-dev-mode" ng-cloak>
Dev Mode
</div>

Expand Down
2 changes: 1 addition & 1 deletion core/tests/build_sources/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h2>
</div>
</div>

<div ng-if="DEV_MODE" class="oppia-dev-mode">
<div ng-if="DEV_MODE" class="oppia-dev-mode" ng-cloak>
Dev Mode
</div>

Expand Down

0 comments on commit 8171f30

Please sign in to comment.