Merge changes Ia1f80d5b,Ic98530bf
* changes:
Fix token highlighting after surrogate pairs
Make assertAnnotation calls more obvious
diff --git a/polygerrit-ui/app/elements/core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.ts b/polygerrit-ui/app/elements/core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.ts
index 25173b4..45ba33b 100644
--- a/polygerrit-ui/app/elements/core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.ts
+++ b/polygerrit-ui/app/elements/core/gr-keyboard-shortcuts-dialog/gr-keyboard-shortcuts-dialog.ts
@@ -61,7 +61,6 @@
display: block;
max-height: 100vh;
min-width: 60vw;
- overflow-y: auto;
}
main {
display: flex;
diff --git a/polygerrit-ui/app/elements/shared/gr-textarea/gr-textarea.ts b/polygerrit-ui/app/elements/shared/gr-textarea/gr-textarea.ts
index 169cd59..dd08544 100644
--- a/polygerrit-ui/app/elements/shared/gr-textarea/gr-textarea.ts
+++ b/polygerrit-ui/app/elements/shared/gr-textarea/gr-textarea.ts
@@ -234,9 +234,7 @@
hiddenText in order to correctly position the dropdown. After being moved,
it is set as the positionTarget for the emojiSuggestions dropdown. -->
<span id="caratSpan"></span>
- ${this.renderEmojiDropdown()}
- ${this.renderMentionsDropdown()}
- </gr-autocomplete-dropdown>
+ ${this.renderEmojiDropdown()} ${this.renderMentionsDropdown()}
<iron-autogrow-textarea
id="textarea"
class=${classMap({noBorder: this.hideBorder})}
diff --git a/polygerrit-ui/app/tsconfig.json b/polygerrit-ui/app/tsconfig.json
index 0ddf130..98aaf0f 100644
--- a/polygerrit-ui/app/tsconfig.json
+++ b/polygerrit-ui/app/tsconfig.json
@@ -47,7 +47,7 @@
"lib": [
"dom",
"dom.iterable",
- "es2020",
+ "es2021",
"webworker"
],
diff --git a/polygerrit-ui/app/utils/string-util.ts b/polygerrit-ui/app/utils/string-util.ts
index 9955f68..81dcde1 100644
--- a/polygerrit-ui/app/utils/string-util.ts
+++ b/polygerrit-ui/app/utils/string-util.ts
@@ -40,7 +40,7 @@
* contain spaces and colons.
*/
export function escapeAndWrapSearchOperatorValue(value: string): string {
- return `"${value.replace('\\', '\\\\').replace('"', '\\"')}"`;
+ return `"${value.replaceAll('\\', '\\\\').replaceAll('"', '\\"')}"`;
}
/**
diff --git a/polygerrit-ui/app/utils/string-util_test.ts b/polygerrit-ui/app/utils/string-util_test.ts
index c6c65b1..d6c4187 100644
--- a/polygerrit-ui/app/utils/string-util_test.ts
+++ b/polygerrit-ui/app/utils/string-util_test.ts
@@ -10,6 +10,7 @@
ordinal,
listForSentence,
diffFilePaths,
+ escapeAndWrapSearchOperatorValue,
} from './string-util';
suite('string-util tests', () => {
@@ -84,4 +85,11 @@
fileName: 'COMMIT_MSG',
});
});
+
+ test('escapeAndWrapSearchOperatorValue', () => {
+ assert.equal(
+ escapeAndWrapSearchOperatorValue('"value of \\: \\"something"'),
+ '"\\"value of \\\\: \\\\\\"something\\""'
+ );
+ });
});
diff --git a/polygerrit-ui/app/workers/service-worker-class.ts b/polygerrit-ui/app/workers/service-worker-class.ts
index f9cc591..1c54158 100644
--- a/polygerrit-ui/app/workers/service-worker-class.ts
+++ b/polygerrit-ui/app/workers/service-worker-class.ts
@@ -131,9 +131,12 @@
// User can have different service workers for different origins/hosts.
// TODO(milutin): Check if this works properly with getBaseUrl()
const data = {url: `${self.location.origin}${changeUrl}`};
-
- // TODO(milutin): Add gerrit host icon
- this.ctx.registration.showNotification(change.subject, {body, data});
+ const icon = `${self.location.origin}/favicon.ico`;
+ this.ctx.registration.showNotification(change.subject, {
+ body,
+ data,
+ icon,
+ });
this.sendReport('notify about 1 change');
}
@@ -141,7 +144,8 @@
const title = `You are in the attention set for ${numOfChangesToNotifyAbout} changes.`;
const dashboardUrl = createDashboardUrl({});
const data = {url: `${self.location.origin}${dashboardUrl}`};
- this.ctx.registration.showNotification(title, {data});
+ const icon = `${self.location.origin}/favicon.ico`;
+ this.ctx.registration.showNotification(title, {data, icon});
this.sendReport(`notify about ${numOfChangesToNotifyAbout} changes`);
}