Merge "Integrates polymer-resin into polygerrit-ui"

This commit is contained in:
Dave Borowitz 2017-06-27 18:31:30 +00:00 committed by Gerrit Code Review
commit a9379dc91b
7 changed files with 58 additions and 1 deletions
WORKSPACE
gerrit-httpd/src/main/resources/com/google/gerrit/httpd/raw
lib/js
polygerrit-ui

@ -1100,6 +1100,13 @@ bower_archive(
version = "1.9.1",
)
bower_archive(
name = "polymer-resin",
package = "polymer/polymer-resin",
sha1 = "d759c8c09054a7ec04608a6cb586801c904f79a2",
version = "1.2.6-beta",
)
bower_archive(
name = "promise-polyfill",
package = "polymerlabs/promise-polyfill",

@ -44,6 +44,12 @@
<link rel="stylesheet" href="{$staticResourcePath}/styles/fonts.css">{\n}
<link rel="stylesheet" href="{$staticResourcePath}/styles/main.css">{\n}
<script src="{$staticResourcePath}/bower_components/webcomponentsjs/webcomponents-lite.js"></script>{\n}
// Content between webcomponents-lite and the load of the main app element
// run before polymer-resin is installed so may have security consequences.
// Contact your local security engineer if you have any questions, and
// CC them on any changes that load content before gr-app.html.
//
// github.com/Polymer/polymer-resin/blob/master/getting-started.md#integrating
<link rel="preload" href="{$staticResourcePath}/elements/gr-app.js" as="script" crossorigin="anonymous">{\n}
<link rel="import" href="{$staticResourcePath}/elements/gr-app.html">{\n}

@ -173,6 +173,15 @@ def define_bower_components():
deps = [ ":webcomponentsjs" ],
seed = True,
)
bower_component(
name = "polymer-resin",
license = "//lib:LICENSE-polymer",
deps = [
":polymer",
":webcomponentsjs",
],
seed = True,
)
bower_component(
name = "promise-polyfill",
license = "//lib:LICENSE-promise-polyfill",

@ -21,6 +21,7 @@ bower_component_bundle(
"//lib/js:moment",
"//lib/js:page",
"//lib/js:polymer",
"//lib/js:polymer-resin",
"//lib/js:promise-polyfill",
],
)

@ -15,6 +15,13 @@ limitations under the License.
-->
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/polymer-resin/standalone/polymer-resin.html">
<script>
security.polymer_resin.install({
allowedIdentifierPrefixes: [''],
reportHandler: security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER,
});
</script>
<link rel="import" href="./admin/gr-admin-view/gr-admin-view.html">
<link rel="import" href="./change-list/gr-change-list-view/gr-change-list-view.html">

@ -29,6 +29,14 @@ RobotoMono fonts are used in styles/fonts.css
<link rel="stylesheet" href="/styles/fonts.css">
<link rel="stylesheet" href="/styles/main.css">
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<!--
- Content between webcomponents-lite and the load of the main app element
- run before polymer-resin is installed so may have security consequences.
- Contact your local security engineer if you have any questions, and
- CC them on any changes that load content before gr-app.html.
-
- github.com/Polymer/polymer-resin/blob/master/getting-started.md#integrating
-->
<link rel="preload" href="/elements/gr-app.js" as="script" crossorigin="anonymous">
<link rel="import" href="/elements/gr-app.html">

@ -15,5 +15,24 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
<link rel="import" href="../bower_components/iron-test-helpers/iron-test-helpers.html" />
<link rel="import"
href="../bower_components/polymer-resin/standalone/polymer-resin.html" />
<script>
security.polymer_resin.install({
allowedIdentifierPrefixes: [''],
reportHandler(isViolation, fmt, ...args) {
const log = security.polymer_resin.CONSOLE_LOGGING_REPORT_HANDLER;
log(isViolation, fmt, ...args);
if (isViolation) {
// This will cause the test to fail if there is a data binding
// violation.
throw new Error(
'polymer-resin violation: ' + fmt
+ JSON.stringify(args));
}
},
});
</script>
<link rel="import"
href="../bower_components/iron-test-helpers/iron-test-helpers.html" />
<link rel="import" href="test-router.html" />