diff options
author | Vincent Ambo <mail@tazj.in> | 2021-08-30T17·04+0300 |
---|---|---|
committer | tazjin <mail@tazj.in> | 2021-08-31T15·18+0000 |
commit | 0a98d09a93624f706fbb602a8cfabf2e64de5d88 (patch) | |
tree | 6a0336169c58aadb965933e11a84bb5e11f294de /third_party/gerrit | |
parent | 83c8716afd872180fb59abac70ad74412ac04d77 (diff) |
chore(3p/gerrit): Remove avatar padding patch r/2802
In the current config, Gerrit doesn't actually seem to realise that avatars are not enabled (this changed in 3.4 somehow). Either way we don't need to maintain this fix since there's an actual upstream one now: https://gerrit-review.googlesource.com/313982 Change-Id: I7efab7b8fa5e9e38bddae86acd8d8a7852b27bb6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3465 Tested-by: BuildkiteCI Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to 'third_party/gerrit')
-rw-r--r-- | third_party/gerrit/0007-Keep-left-padding-on-account-chip-if-no-avatar-provi.patch | 111 | ||||
-rw-r--r-- | third_party/gerrit/default.nix | 1 |
2 files changed, 0 insertions, 112 deletions
diff --git a/third_party/gerrit/0007-Keep-left-padding-on-account-chip-if-no-avatar-provi.patch b/third_party/gerrit/0007-Keep-left-padding-on-account-chip-if-no-avatar-provi.patch deleted file mode 100644 index 63f269167a0a..000000000000 --- a/third_party/gerrit/0007-Keep-left-padding-on-account-chip-if-no-avatar-provi.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 9062a3705c67f576a2484fe69a39847ae7ff293a Mon Sep 17 00:00:00 2001 -From: Luke Granger-Brown <git@lukegb.com> -Date: Sun, 20 Dec 2020 14:29:22 +0000 -Subject: [PATCH 7/7] Keep left padding on account chip if no avatar provider - present - -At the moment, if there's no plugin that provides avatars then the left -padding is still removed if there *would* be an avatar there, which -leads to some weirdly offset text. - -Change-Id: I1ff0745aa267d7fb227e39460c8ea80ef5ec2f55 ---- - .../gr-account-label/gr-account-label.ts | 6 ++ - .../gr-account-label/gr-account-label_test.js | 63 +++++++++++++++++++ - 2 files changed, 69 insertions(+) - -diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts -index 64bae58c41..220fcf413b 100644 ---- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts -+++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts -@@ -151,7 +151,13 @@ export class GrAccountLabel extends PolymerElement { - change: ChangeInfo, - force: boolean - ) { -+ const avatarsAvailable = ( -+ !!config && -+ !!config.change && -+ !!config.plugin.has_avatars -+ ); - return ( -+ avatarsAvailable && - !hideAvatar && - !this._hasAttention(config, highlight, account, change, force) - ); -diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.js b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.js -index f37aa01a2d..4a21222dca 100644 ---- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.js -+++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.js -@@ -44,6 +44,69 @@ suite('gr-account-label tests', () => { - }); - }); - -+ suite('_computeCancelLeftPadding', () => { -+ test('config not ready', () => { -+ assert.isFalse( -+ element._computeCancelLeftPadding( -+ /*hideAvatar=*/false, -+ /*config=*/undefined, -+ /*highlight=*/false, -+ /*account=*/element.account, -+ /*change=*/element.change, -+ /*force=*/false)); -+ }); -+ -+ test('no avatar provider', () => { -+ const config = { -+ plugin: {}, -+ }; -+ assert.isFalse( -+ element._computeCancelLeftPadding( -+ /*hideAvatar=*/false, -+ /*config=*/config, -+ /*highlight=*/false, -+ /*account=*/element.account, -+ /*change=*/element.change, -+ /*force=*/false)); -+ }); -+ -+ test('avatar provider present', () => { -+ const config = { -+ plugin: { -+ has_avatars: true, -+ }, -+ }; -+ assert.isTrue( -+ element._computeCancelLeftPadding( -+ /*hideAvatar=*/false, -+ /*config=*/config, -+ /*highlight=*/false, -+ /*account=*/element.account, -+ /*change=*/element.change, -+ /*force=*/false)); -+ }); -+ -+ test('has attention', () => { -+ const config = { -+ change: {enable_attention_set: true}, -+ user: {anonymous_coward_name: 'Anonymous Coward'}, -+ plugin: {has_avatars: true}, -+ }; -+ const selfAccount = createAccount('kermit', 31); -+ const account = createAccount('ernie', 42); -+ const change = {attention_set: {42: {}}}; -+ -+ assert.isFalse( -+ element._computeCancelLeftPadding( -+ /*hideAvatar=*/false, -+ /*config=*/config, -+ /*highlight=*/true, -+ /*account=*/account, -+ /*change=*/change, -+ /*force=*/false)); -+ }); -+ }); -+ - suite('_computeName', () => { - test('not showing anonymous', () => { - const account = {name: 'Wyatt'}; --- -2.32.0 - diff --git a/third_party/gerrit/default.nix b/third_party/gerrit/default.nix index 6afc8813a936..f886a0426d52 100644 --- a/third_party/gerrit/default.nix +++ b/third_party/gerrit/default.nix @@ -49,7 +49,6 @@ pkgs.lib.makeOverridable pkgs.buildBazelPackage { ./0004-Add-titles-to-CLs-over-HTTP.patch ./0005-When-using-local-fonts-always-assume-Gerrit-is-mount.patch ./0006-Always-use-Google-Fonts.patch - ./0007-Keep-left-padding-on-account-chip-if-no-avatar-provi.patch ]; bazelTarget = "release api-skip-javadoc"; |