Merge changes If38fa09e,I70e1c50f
* changes:
Replace `GerritNav.navigateToRelativeUrl()` by new `setUrl()` service
Replace `GerritNav.navigateToDiff()` by new `setUrl()` service
diff --git a/Documentation/user-upload.txt b/Documentation/user-upload.txt
index 2bfc62d..8c51207 100644
--- a/Documentation/user-upload.txt
+++ b/Documentation/user-upload.txt
@@ -340,7 +340,7 @@
To avoid confusion in parsing the git ref, at least the following characters
must be percent-encoded: " %^@.~-+_:/!". Note that some of the reserved
characters (like tilde) are not escaped in the standard URL encoding rules,
-so a language-provided function (e.g. encodeURIComponent(), in javascript)
+so a language-provided function (e.g. encodeURIComponent(), in JavaScript)
might not suffice. To be safest, you might consider percent-encoding all
non-alphanumeric characters (and all multibyte UTF-8 code points).
diff --git a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
index ee6948a..17edc19 100644
--- a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
+++ b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar.ts
@@ -21,7 +21,6 @@
query as queryDec,
} from 'lit/decorators.js';
import {Shortcut, ShortcutController} from '../../lit/shortcut-controller';
-import {query as queryUtil} from '../../../utils/common-util';
import {assertIsDefined} from '../../../utils/common-util';
import {configModelToken} from '../../../models/config/config-model';
import {resolve} from '../../../models/dependency';
@@ -295,14 +294,6 @@
*/
private preventDefaultAndNavigateToInputVal(e: Event) {
e.preventDefault();
- const target = e.composedPath()[0] as HTMLElement;
- // If the target is the #searchInput or has a sub-input component, that
- // is what holds the focus as opposed to the target from the DOM event.
- if (queryUtil(target, '#input')) {
- queryUtil<HTMLElement>(target, '#input')!.blur();
- } else {
- target.blur();
- }
if (!this.inputVal) return;
const trimmedInput = this.inputVal.trim();
if (trimmedInput) {
diff --git a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
index f7e8b8e..dbb3db9 100644
--- a/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
+++ b/polygerrit-ui/app/elements/core/gr-search-bar/gr-search-bar_test.ts
@@ -134,26 +134,6 @@
await promise;
});
- test('input blurred after commit', async () => {
- const blurSpy = sinon.spy(
- queryAndAssert<PaperInputElement>(
- queryAndAssert<GrAutocomplete>(element, '#searchInput'),
- '#input'
- ),
- 'blur'
- );
- queryAndAssert<GrAutocomplete>(element, '#searchInput').text = 'fate/stay';
- await element.updateComplete;
- pressKey(
- queryAndAssert<PaperInputElement>(
- queryAndAssert<GrAutocomplete>(element, '#searchInput'),
- '#input'
- ),
- Key.ENTER
- );
- await waitUntil(() => blurSpy.called);
- });
-
test('empty search query does not trigger nav', async () => {
const searchSpy = sinon.spy();
element.addEventListener('handle-search', searchSpy);