Skip to content

Commit

Permalink
task/DSAPP-43: Remove data depot notifs from top-right notif bell (#1459
Browse files Browse the repository at this point in the history
)

* remove data depot notifs from top-right notif bell

* remove "WEB" event type

---------

Co-authored-by: Wesley B <[email protected]>
  • Loading branch information
rstijerina and wesleyboar authored Oct 16, 2024
1 parent aa08e32 commit a330250
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function NotificationBadgeCtrl(
};

$scope.list = function() {
NotificationService.list().then(function(resp) {
NotificationService.list({'eventTypes[]': ['interactive_session_ready', 'job']}).then(function(resp) {
$scope.data.notifications = resp.notifs;
if (angular.element('#notification-container').hasClass('open')) {
$scope.data.unread = 0;
Expand Down Expand Up @@ -62,10 +62,13 @@ export function NotificationBadgeCtrl(
'notificationsurl': '/notifications'
};

$scope.count = function() {
$http.get('/api/notifications/badge/').then(
function(resp) {
$scope.data.unread = resp.data.unread;
$scope.count = function () {
$http({
url: '/api/notifications/badge/',
method: 'GET',
params: { 'eventTypes[]': ['interactive_session_ready', 'job'] },
}).then(function (resp) {
$scope.data.unread = resp.data.unread;
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ function NotificationService(
* @param {Object} msg
*/
function processMessage(e, msg) {
processors.notifs.process(msg);
$rootScope.$broadcast('notification', msg);
const eventType = msg.event_type.toLowerCase();
if (eventType === 'job' || eventType === 'interactive_session_ready') {
processors.notifs.process(msg);
}

if (typeof processors[eventType] !== 'undefined' &&
typeof processors[eventType].process !== 'undefined' &&
Expand Down Expand Up @@ -119,7 +121,7 @@ function NotificationService(
* @param {Object} msg
*/
function processToastr(e, msg) {
if (msg.event_type === 'job' || msg.event_type ==='WEB' || msg.event_type === 'interactive_session_ready') {
if (msg.event_type === 'job' || msg.event_type === 'interactive_session_ready') {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion designsafe/static/scripts/notifications/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ angular.module('designsafe').controller('NotificationListCtrl', ['$scope','$root

$scope.list = function(page=0){
$scope.data.pagination = {'limit': 10}
var params = {'limit': $scope.data.pagination.limit, page: page}
var params = {'limit': $scope.data.pagination.limit, page: page, 'eventTypes[]': ['interactive_session_ready', 'job']}

NotificationService.list(params).then(function(resp) {
$scope.data.pagination.show = false;
Expand Down

0 comments on commit a330250

Please sign in to comment.