Add support for Enterprise logos in notifications
This commit is contained in:
parent
6fe579119b
commit
84ad1d83e1
2 changed files with 8 additions and 4 deletions
|
@ -71,8 +71,12 @@ angular.module('quay').factory('Config', ['Features', function(Features) {
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
|
||||||
config.getEnterpriseLogo = function() {
|
config.getEnterpriseLogo = function(defaultValue) {
|
||||||
if (!config.ENTERPRISE_LOGO_URL) {
|
if (!config.ENTERPRISE_LOGO_URL) {
|
||||||
|
if (defaultValue) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
if (Features.BILLING) {
|
if (Features.BILLING) {
|
||||||
return '/static/img/quay-horizontal-color.svg';
|
return '/static/img/quay-horizontal-color.svg';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -288,7 +288,6 @@ function($rootScope, $interval, UserService, ApiService, StringBuilderService, P
|
||||||
mostRecentTimestamp = new Date(notificationService.notifications[0].created).getTime();
|
mostRecentTimestamp = new Date(notificationService.notifications[0].created).getTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const newNotifications = notificationService.notifications
|
const newNotifications = notificationService.notifications
|
||||||
.filter(obj => new Date(obj.created).getTime() > mostRecentTimestamp);
|
.filter(obj => new Date(obj.created).getTime() > mostRecentTimestamp);
|
||||||
|
|
||||||
|
@ -299,8 +298,9 @@ function($rootScope, $interval, UserService, ApiService, StringBuilderService, P
|
||||||
}
|
}
|
||||||
|
|
||||||
new Notification(message, {
|
new Notification(message, {
|
||||||
icon: window.location.origin + '/static/img/quay-logo.png',
|
// Chrome doesn't display SVGs for notifications, so we'll use a default if we don't have an enterprise logo
|
||||||
image: window.location.origin + '/static/img/quay-logo.png',
|
icon: window.location.origin + Config.getEnterpriseLogo('/static/img/quay-logo.png'),
|
||||||
|
image: window.location.origin + Config.getEnterpriseLogo('/static/img/quay-logo.png'),
|
||||||
});
|
});
|
||||||
|
|
||||||
const newTimestamp = new Date(newNotifications[0].created).getTime();
|
const newTimestamp = new Date(newNotifications[0].created).getTime();
|
||||||
|
|
Reference in a new issue