Merge pull request #3833 from overleaf/em-meta-tags

Pass values to JS through meta tags

GitOrigin-RevId: f663a1b7fef4544b560574d21f59fdabaf617830
This commit is contained in:
Eric Mc Sween 2021-03-31 07:55:45 -04:00 committed by Copybot
parent 5653116cdb
commit 5587de9cf5
5 changed files with 16 additions and 25 deletions

View file

@ -5,6 +5,9 @@ include ./dashboard/_team_name_mixin
block head-scripts
script(type="text/javascript", nonce=scriptNonce, src="https://js.recurly.com/v4/recurly.js")
block append meta
meta(name="ol-managedInstitutions", data-type="json", content=managedInstitutions)
block content
main.content.content-alt(ng-cloak)
.container

View file

@ -1,6 +1,3 @@
script(type="text/javascript", nonce=scriptNonce).
window.managedInstitutions = !{StringHelper.stringifyJsonForScript(managedInstitutions)}
each institution in managedInstitutions
p
| You are a manager of

View file

@ -1,5 +1,12 @@
extends ../layout
block append meta
meta(name="ol-reconfirmationRemoveEmail", content=reconfirmationRemoveEmail)
meta(name="ol-reconfirmedViaSAML", content=reconfirmedViaSAML)
meta(name="ol-passwordStrengthOptions", data-type="json", content=settings.passwordStrengthOptions || {})
meta(name="ol-oauthProviders", data-type="json", content=oauthProviders)
meta(name="ol-thirdPartyIds", data-type="json", content=thirdPartyIds)
block content
main.content.content-alt
.container
@ -280,13 +287,3 @@ block content
)
span(ng-hide="state.inflight") #{translate("delete")}
span(ng-show="state.inflight") #{translate("deleting")}…
script#data(type="application/json").
!{StringHelper.stringifyJsonForScript({ reconfirmationRemoveEmail, reconfirmedViaSAML })}
script(type="text/javascript", nonce=scriptNonce).
window.data = JSON.parse(document.querySelector("#data").text);
script(type="text/javascript", nonce=scriptNonce).
window.usersEmail = !{StringHelper.stringifyJsonForScript(user.email)};
window.passwordStrengthOptions = !{StringHelper.stringifyJsonForScript(settings.passwordStrengthOptions || {})}

View file

@ -1,8 +1,3 @@
block head-scripts
script(type="text/javascript", nonce=scriptNonce).
window.oauthProviders = !{StringHelper.stringifyJsonForScript(oauthProviders)}
window.thirdPartyIds = !{StringHelper.stringifyJsonForScript(thirdPartyIds)}
mixin providerList()
ul.list-like-table
li(ng-repeat="(key, provider) in providers" ng-if="!provider.hideWhenNotLinked || (provider.hideWhenNotLinked && thirdPartyIds[key])")
@ -43,4 +38,4 @@ mixin providerList()
.col-xs-12
h3.text-capitalize#linked-accounts #{translate("linked_accounts")}
p.small #{translate("linked_accounts_explained", {appName:'{{settings.appName}}'})}
+providerList()
+providerList()

View file

@ -1,5 +1,10 @@
extends ../layout
block append meta
meta(name="ol-users", data-type="json", content=users)
meta(name="ol-paths", data-type="json", content=paths)
meta(name="ol-groupSize", data-type="json", content=groupSize)
block content
main.content.content-alt
.container
@ -106,9 +111,3 @@ block content
.row
.col-xs-2.col-xs-offset-10(ng-if="paths.exportMembers", ng-cloak)
a(href=paths.exportMembers) #{translate('export_csv')}
script(type="text/javascript", nonce=scriptNonce).
window.users = !{StringHelper.stringifyJsonForScript(users)};
window.paths = !{StringHelper.stringifyJsonForScript(paths)};
window.groupSize = #{groupSize || 'null'};