Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/WC-225 - DRP Notification Counter Fix #1079

Open
wants to merge 2 commits into
base: task/digital-rocks
Choose a base branch
from
Open
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 client/src/components/History/History.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Actions = () => {
},
});
}}
disabled={!unread}
disabled={unread}
>
Mark All as Viewed
</Button>
Expand Down
1 change: 1 addition & 0 deletions client/src/redux/sagas/notifications.sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export function* handleSocket(action) {
yield put({ type: 'ONBOARDING_EVENT', payload: action });
break;
case 'data_files':
case 'projects':
yield put({ type: 'ADD_TOAST', payload: action });
break;
default:
Expand Down
3 changes: 2 additions & 1 deletion client/src/utils/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export function getNumberOfUnreadNotifications(notifications) {
(n) =>
!n.read &&
n.event_type !== 'job' &&
n.event_type !== `interactive_session_ready`
n.event_type !== `interactive_session_ready` &&
n.event_type !== 'projects'
).length + getNumberOfUnreadJobNotifications(notifications)
);
}
Expand Down
6 changes: 3 additions & 3 deletions server/portal/apps/projects/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def process_file(self, project_id: str, path: str, user_access_token: str, encod
username = client.access_token.claims['tapis/username']

Notification.objects.create(**{
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: username,
Notification.MESSAGE: f'Generating Images for {Path(path).name}',
Expand Down Expand Up @@ -291,7 +291,7 @@ def process_file(self, project_id: str, path: str, user_access_token: str, encod
logger.error(f'Could not generate advanced image for {file_name} due to error: {e}')

Notification.objects.create(**{
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: username,
Notification.MESSAGE: f'Failed to Generate Images for {Path(path).name}',
Expand Down Expand Up @@ -339,7 +339,7 @@ def process_file(self, project_id: str, path: str, user_access_token: str, encod

with transaction.atomic():
Notification.objects.create(**{
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: username,
Notification.MESSAGE: f'Image generation complete. Please refresh the page.',
Expand Down
8 changes: 4 additions & 4 deletions server/portal/apps/publications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def post(self, request):

# Create notification
event_data = {
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: request.user.username,
Notification.MESSAGE: f'{source_workspace_id} submitted for review',
Expand Down Expand Up @@ -242,7 +242,7 @@ def post(self, request):

# Create notification
event_data = {
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: request.user.username,
Notification.MESSAGE: f'{project_id} submitted for publication',
Expand Down Expand Up @@ -296,7 +296,7 @@ def post(self, request):

# Create notification
event_data = {
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: request.user.username,
Notification.MESSAGE: f'{project_id} submitted for publication',
Expand Down Expand Up @@ -324,7 +324,7 @@ def post(self, request):

# Create notification
event_data = {
Notification.EVENT_TYPE: 'default',
Notification.EVENT_TYPE: 'projects',
Notification.STATUS: Notification.INFO,
Notification.USER: request.user.username,
Notification.MESSAGE: f'{full_project_id} was rejected',
Expand Down
Loading