From 181ac6da7f61bec627a9b58e92b9c7bb880c5f58 Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Fri, 6 Dec 2019 14:48:48 +0100 Subject: [PATCH 1/7] Wrap file names into multiple lines if its too long Increase the small screen breakpoint to 55em (~768px - 14px font size) Change-Id: I38d0c10666a2546b8505f9ba1b4f93cdfca25998 (cherry picked from commit 3d6ca103eef208d9c9e5181f8e3810ea0815395e) --- .../elements/change/gr-file-list/gr-file-list.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html index 0668e14900..649aa5311b 100644 --- a/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html +++ b/polygerrit-ui/app/elements/change/gr-file-list/gr-file-list.html @@ -116,6 +116,9 @@ limitations under the License. cursor: pointer; flex: 1; text-decoration: none; + /* Wrap it into multiple lines if too long. */ + white-space: normal; + word-break: break-word; } .path:hover :first-child { text-decoration: underline; @@ -197,10 +200,6 @@ limitations under the License. .truncatedFileName { display: none; } - .expanded .fullFileName { - white-space: normal; - word-wrap: break-word; - } .mobile { display: none; } @@ -247,7 +246,9 @@ limitations under the License. margin: -2px 0; padding: var(--spacing-s) 0; } - @media screen and (max-width: 50em) { + + /** small screen breakpoint: 768px */ + @media screen and (max-width: 55em) { .desktop { display: none; } From dc4c7be0cbbdc4dc45739ce0e5d3182975e6d27c Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Thu, 21 Nov 2019 16:15:30 -0800 Subject: [PATCH 2/7] `shift+r` should only be triggered on `keyup` to prevent multiple invocations when users hold the `shift+r`, also prevent extra invocations on `r` as when you, loose the shift first then `r:keyup` will trigger the toggle on review Change-Id: I3c7559863269477e1395a2831c76e47a209c31b1 (cherry picked from commit db13f975a5792c6f1d6587359ccdaf6fd4969ac6) --- polygerrit-ui/app/elements/gr-app-element.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polygerrit-ui/app/elements/gr-app-element.js b/polygerrit-ui/app/elements/gr-app-element.js index d5d944a8c0..0a0a80af7e 100644 --- a/polygerrit-ui/app/elements/gr-app-element.js +++ b/polygerrit-ui/app/elements/gr-app-element.js @@ -201,7 +201,7 @@ this.bindShortcut( this.Shortcut.TOGGLE_CHANGE_STAR, 's:keyup'); this.bindShortcut( - this.Shortcut.REFRESH_CHANGE_LIST, 'shift+r'); + this.Shortcut.REFRESH_CHANGE_LIST, 'shift+r:keyup'); this.bindShortcut( this.Shortcut.EDIT_TOPIC, 't'); @@ -214,7 +214,7 @@ this.bindShortcut( this.Shortcut.COLLAPSE_ALL_MESSAGES, 'z'); this.bindShortcut( - this.Shortcut.REFRESH_CHANGE, 'shift+r'); + this.Shortcut.REFRESH_CHANGE, 'shift+r:keyup'); this.bindShortcut( this.Shortcut.UP_TO_DASHBOARD, 'u'); this.bindShortcut( From 2f74179a9d68136d337b462396ec6a827bf59c06 Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Thu, 21 Nov 2019 13:25:33 -0800 Subject: [PATCH 3/7] Replace 'Menlo' with 'SF Mono' 'Menlo' was replaced by 'SF Mono' from Mac OS 10.11, And Menlo is not rendering symbols and characters correctly. Change-Id: Ibe6805fd66bb838aeb91ada8f96badb3ba5ca430 (cherry picked from commit 4416b1b55ef6a9d55b7190be16c2569fb9445879) --- polygerrit-ui/app/styles/themes/app-theme.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polygerrit-ui/app/styles/themes/app-theme.html b/polygerrit-ui/app/styles/themes/app-theme.html index 56add09216..bb477c28a0 100644 --- a/polygerrit-ui/app/styles/themes/app-theme.html +++ b/polygerrit-ui/app/styles/themes/app-theme.html @@ -74,7 +74,7 @@ html { /* fonts */ --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; - --monospace-font-family: 'Roboto Mono', Menlo, 'Lucida Console', Monaco, monospace; + --monospace-font-family: 'Roboto Mono', 'SF Mono', 'Lucida Console', Monaco, monospace; --font-size-code: 12px; /* 12px mono */ --font-size-mono: .929rem; /* 13px mono */ --font-size-small: .857rem; /* 12px */ From 11924d57021d5d9e81323b418ddd8d11de15328c Mon Sep 17 00:00:00 2001 From: Tao Zhou Date: Wed, 18 Dec 2019 13:59:10 +0100 Subject: [PATCH 4/7] Fix parse error from repo settings page Polymer 2 will run computed methods with `undefined` value and `JSON.parse` will throw error for that. Change-Id: Ie9282269e912ec571b7f2b6f04d8914f4df34100 (cherry picked from commit b9190ca51ef8e3094360d27eed661cd787166d70) --- .../admin/gr-repo-plugin-config/gr-repo-plugin-config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polygerrit-ui/app/elements/admin/gr-repo-plugin-config/gr-repo-plugin-config.js b/polygerrit-ui/app/elements/admin/gr-repo-plugin-config/gr-repo-plugin-config.js index 883a4e1ef7..bfa8832a99 100644 --- a/polygerrit-ui/app/elements/admin/gr-repo-plugin-config/gr-repo-plugin-config.js +++ b/polygerrit-ui/app/elements/admin/gr-repo-plugin-config/gr-repo-plugin-config.js @@ -71,7 +71,10 @@ return editable === 'false'; }, - _computeChecked(value) { + /** + * @param {string} value - fallback to 'false' if undefined + */ + _computeChecked(value = 'false') { return JSON.parse(value); }, From 85eb97817caaeb18c98a8f90a61dfefc8a1cb7a6 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 14:47:17 +0100 Subject: [PATCH 5/7] Bazel: Replace deprecated dependency mode LOOSE with PRUNE_LEGACY This fixes this warning in closure_js_binary rule: dependency_mode=LOOSE is deprecated and will be removed soon; prefer to use its equivalent PRUNE_LEGACY that was added in this PR: [1]. [1] https://github.com/bazelbuild/rules_closure/pull/444 Change-Id: I648f581a8f585402543b97ce7a7ef056ca298c3e --- polygerrit-ui/app/rules.bzl | 1 + tools/bzl/js.bzl | 1 + 2 files changed, 2 insertions(+) diff --git a/polygerrit-ui/app/rules.bzl b/polygerrit-ui/app/rules.bzl index ca8c402227..075e34a39d 100644 --- a/polygerrit-ui/app/rules.bzl +++ b/polygerrit-ui/app/rules.bzl @@ -20,6 +20,7 @@ def polygerrit_bundle(name, srcs, outs, app): ], language = "ECMASCRIPT5", deps = [name + "_closure_lib"], + dependency_mode = "PRUNE_LEGACY", ) # TODO(davido): Remove JSC_REFERENCE_BEFORE_DECLARE when this is fixed upstream: diff --git a/tools/bzl/js.bzl b/tools/bzl/js.bzl index 2726f4154c..e6c48709df 100644 --- a/tools/bzl/js.bzl +++ b/tools/bzl/js.bzl @@ -484,6 +484,7 @@ def polygerrit_plugin(name, app, srcs = [], deps = [], assets = None, plugin_nam deps = [ name + "_closure_lib", ], + dependency_mode = "PRUNE_LEGACY", ) if html_plugin: From 61786574816a69aaad50ccf04f51e478f70120f5 Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 17:04:44 +0100 Subject: [PATCH 6/7] Bazel: Make maven_jar rule forward compatible Force loading the Java rules from the rules_java repo, as pointed out in: [1]. Note that even with this change, gerrit cannot be built with --incompatible_load_java_rules_from_bzl option passed yet: $ bazel build --incompatible_load_java_rules_from_bzl :release The other transitive dependencies must be fixed first, most notably rules_closure: [2], or more generally, Bazel's own: jvm_import_external and java_import_external rules: [3]. [1] https://github.com/bazelbuild/bazel/issues/8741 [2] https://github.com/bazelbuild/rules_closure/issues/449 [3] https://github.com/bazelbuild/bazel/issues/10046 Bug: Issue 11738 Change-Id: I153b6d3c14d6df465034041c3bf81c245df0aa04 --- tools/bzl/maven_jar.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/bzl/maven_jar.bzl b/tools/bzl/maven_jar.bzl index 0bad778fe6..7730804e88 100644 --- a/tools/bzl/maven_jar.bzl +++ b/tools/bzl/maven_jar.bzl @@ -74,6 +74,7 @@ def _generate_build_files(ctx, binjar, srcjar): srcjar_attr = 'srcjar = "%s",' % srcjar contents = """ {header} +load("@rules_java//java:defs.bzl", "java_import") package(default_visibility = ['//visibility:public']) java_import( name = 'jar', From 235eccffe0e062e6c1e018da390dbfffa1a63a2b Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Tue, 24 Dec 2019 21:02:17 +0100 Subject: [PATCH 7/7] Bazel: Remove unused polygerrit-ui/app:bower_components rule The last usage was removed in I21f3ed67ade1, but the rule itself was missed to be removed. Bug: Issue 12110 Change-Id: Ib595e8ab2d3dd0e8ecd8635ad48670d9610062ed --- polygerrit-ui/app/BUILD | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD index bba0640e92..17c45a4881 100644 --- a/polygerrit-ui/app/BUILD +++ b/polygerrit-ui/app/BUILD @@ -45,16 +45,6 @@ filegroup( ), ) -filegroup( - name = "bower_components", - srcs = glob( - [ - "bower_components/**/*.html", - "bower_components/**/*.js", - ], - ), -) - genrule2( name = "pg_code_zip", srcs = [":pg_code"],