question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove GLOBALS from base.html

See original GitHub issue

Explanation

We use GLOBALS for transferring dynamic variables between backend and frontend. Since we plan to move to static serving for our pages we need to get rid of GLOBALS.

GLOBALS consist of two types of variables: constants and dynamic variables. We should first get rid of the constants, there are three cases regarding constants:

  • the constant is used both in frontend and backend
    • we should move it from GLOBALS to /assets/constants.js or keep the constant in feconf.py and make an AJAX request to retrieve the constant to the frontend.
  • the constant is used just in the backend
    • we need to remove it from GLOBALS
  • the constant is used just in the frontend
    • we should move it from GLOBALS to core/templates/dev/head/app.js as oppia.constant()

The variables in GLOBALS can be handled in many different ways. For reference: #5191 #5290 #5397 #5618

If you’d like to help with this issue, please select a file from the list below, put your name in parentheses next to it, and submit a PR after getting rid of the variable from GLOBALS in that file. Once the PR is submitted, you can tick the checkboxes.

Remaining GLOBALS

  • ADDITIONAL_ANGULAR_MODULES (it’s used in interactions) @Jamesjay4199
  • csrf_token
  • status_code
  • GCS_RESOURCE_BUCKET_NAME (app identity) @Jamesjay4199
  • iframed @Jamesjay4199
  • isTopicManager
  • userIsLoggedIn @vrajesh978
    • check for the presence of App Engine authentification cookies
  • login/logout
  • SITE_FEEDBACK_FORM_URL @Jamesjay4199
  • promo bar @abhaygupta97
    • PROMO_BAR_IS_ENABLED
    • PROMO_BAR_MESSAGE
    • Create backend handler for promobar message. Retrieve promobar message on frontend by AJAX. Move feconf.ENABLE_PROMO_BAR to constants.
  • allowYamlFileUpload (deprecated – remove and move the functionality to admin Activities tab)
  • NAV_MODE
    • Used for side navigation bar, can be removed and handled in frontend.
  • user related @vojtechjelinek
    • isAdmin
    • isModerator
    • isSuperAdmin
    • can_create_collections
    • username
    • preferredSiteLanguageCode

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:60 (53 by maintainers)

github_iconTop GitHub Comments

2reactions
mighty-phoenixcommented, Jan 8, 2019

Thanks a lot! @YashJipkate

1reaction
abhaygupta97commented, Mar 6, 2019

Hi @Jamesjay4199, iframed has been assigned to you. Go ahead! Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Django global variable for base.html
I'm not really sure if its implemented the right way. I don't know how to access the global var. in Template. In the...
Read more >
Remove global.css from public and move it into app source ...
I suggest this to be done in the template too, global.css removed ... But it's just for base styles, which apply to the...
Read more >
R: Remove Objects from a Specified Environment
remove and rm can be used to remove objects. These can be specified successively as character strings, or in the character vector list...
Read more >
Adding or Removing Global Variables Using the CCE
In the CCE for a given resource, click the +/-Global Variable button . · On the Global Variable Selector dialog, click to de-select...
Read more >
Global attributes - HTML: HyperText Markup Language | MDN
Chrome Edge accesskey Full support. ChromeYes. Toggle history Full support. Edge12. Tog... autocapitalize Full support. Chrome43. Toggle history Full support. Edge79. Tog... autocomplete Full support. ChromeYes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found