Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/lib/account/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class SessionData {
/// Set image size to NxN pixels for faster loading, see:
/// https://developers.google.com/people/image-sizing
String imageUrlOfSize(int layoutSize) {
if (imageUrl == null) {
if (imageUrl == null || imageUrl == staticUrls.defaultProfilePng) {
return staticUrls.defaultProfilePng;
}
// Double the layout size, for better quality on higher dpi displays.
Expand Down
14 changes: 3 additions & 11 deletions app/lib/fake/backend/fake_auth_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import 'dart:convert';

import 'package:clock/clock.dart';
import 'package:crypto/crypto.dart';
import 'package:gcloud/service_scope.dart' as ss;
import 'package:googleapis/oauth2/v2.dart' as oauth2_v2;
import 'package:http/http.dart' as http;
Expand All @@ -20,6 +19,7 @@ import '../../account/auth_provider.dart';
import '../../account/default_auth_provider.dart';
import '../../account/session_cookie.dart';
import '../../frontend/handlers/pubapi.client.dart';
import '../../frontend/static_files.dart';
import '../../service/openid/gcp_openid.dart';
import '../../service/openid/github_openid.dart';
import '../../service/openid/jwt.dart';
Expand Down Expand Up @@ -144,13 +144,9 @@ class FakeAuthProvider extends BaseAuthProvider {
final name =
email.split('@').first.replaceAll('-', ' ').replaceAll('.', ' ');

// gravatar image with retro face
final emailMd5 = md5.convert(utf8.encode(email.trim())).toString();
final imageUrl = 'https://www.gravatar.com/avatar/$emailMd5?d=retro&s=200';

return AccountProfile(
name: name,
imageUrl: imageUrl,
imageUrl: staticUrls.defaultProfilePng,
);
}

Expand Down Expand Up @@ -201,16 +197,12 @@ class FakeAuthProvider extends BaseAuthProvider {
final name =
email.split('@').first.replaceAll('-', ' ').replaceAll('.', ' ');

// gravatar image with retro face
final emailMd5 = md5.convert(utf8.encode(email.trim())).toString();
final imageUrl = 'https://www.gravatar.com/avatar/$emailMd5?d=retro&s=200';

return AuthResult(
oauthUserId: token.payload['sub'] as String,
email: email,
audience: token.payload['aud'] as String,
name: name,
imageUrl: imageUrl,
imageUrl: staticUrls.defaultProfilePng,
accessToken: _createGcpToken(
email: email,
audience: activeConfiguration.pubServerAudience!,
Expand Down
6 changes: 3 additions & 3 deletions app/test/frontend/golden/my_activity_log_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">admin</div>
<div class="nav-account-email">[email protected]</div>
Expand All @@ -139,7 +139,7 @@ <h3 class="foldable-button">
<div class="detail-container">
<div class="detail-header-outer-block">
<div class="detail-header-image-block">
<img class="detail-header-image" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200=s400" alt="user profile picture" width="200" height="200"/>
<img class="detail-header-image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="user profile picture" width="200" height="200"/>
</div>
<div class="detail-header-content-block">
<h1 class="title pub-monochrome-icon-hoverable">admin</h1>
Expand Down
6 changes: 3 additions & 3 deletions app/test/frontend/golden/my_liked_packages.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">user</div>
<div class="nav-account-email">[email protected]</div>
Expand All @@ -140,7 +140,7 @@ <h3 class="foldable-button">
<div class="detail-container">
<div class="detail-header-outer-block">
<div class="detail-header-image-block">
<img class="detail-header-image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200=s400" alt="user profile picture" width="200" height="200"/>
<img class="detail-header-image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="user profile picture" width="200" height="200"/>
</div>
<div class="detail-header-content-block">
<h1 class="title pub-monochrome-icon-hoverable">user</h1>
Expand Down
6 changes: 3 additions & 3 deletions app/test/frontend/golden/my_packages.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">user</div>
<div class="nav-account-email">[email protected]</div>
Expand All @@ -139,7 +139,7 @@ <h3 class="foldable-button">
<div class="detail-container">
<div class="detail-header-outer-block">
<div class="detail-header-image-block">
<img class="detail-header-image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200=s400" alt="user profile picture" width="200" height="200"/>
<img class="detail-header-image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="user profile picture" width="200" height="200"/>
</div>
<div class="detail-header-content-block">
<h1 class="title pub-monochrome-icon-hoverable">user</h1>
Expand Down
6 changes: 3 additions & 3 deletions app/test/frontend/golden/my_publishers.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">user</div>
<div class="nav-account-email">[email protected]</div>
Expand All @@ -139,7 +139,7 @@ <h3 class="foldable-button">
<div class="detail-container">
<div class="detail-header-outer-block">
<div class="detail-header-image-block">
<img class="detail-header-image" src="https://www.gravatar.com/avatar/f1983c9193966b63c29c141c02db9a34?d=retro&amp;s=200=s400" alt="user profile picture" width="200" height="200"/>
<img class="detail-header-image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="user profile picture" width="200" height="200"/>
</div>
<div class="detail-header-content-block">
<h1 class="title pub-monochrome-icon-hoverable">user</h1>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pkg_activity_log_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">admin</div>
<div class="nav-account-email">[email protected]</div>
Expand Down
4 changes: 2 additions & 2 deletions app/test/frontend/golden/pkg_admin_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ <h3 class="foldable-button">
</div>
</div>
<div class="nav-container nav-profile-container hoverable">
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image"/>
<input class="nav-profile-img nav-profile-image-desktop" type="image" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image"/>
<div class="nav-hover-popup">
<div class="nav-table-column">
<div class="nav-account-title-mobile">
<img class="nav-profile-img nav-profile-img-mobile" src="https://www.gravatar.com/avatar/92c525024f1911332fe1d0f7dd750977?d=retro&amp;s=200" alt="Profile Image" width="30" height="30"/>
<img class="nav-profile-img nav-profile-img-mobile" src="/static/hash-%%etag%%/img/material-icon-twotone-account-circle-white-24dp.png" alt="Profile Image" width="30" height="30"/>
<div class="nav-account-title">
<div class="nav-account-name">admin</div>
<div class="nav-account-email">[email protected]</div>
Expand Down
Loading