From 644891c5af4f8e52cf0a2c75aeb030e7f8592a63 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Thu, 22 Jun 2023 19:34:29 +0200 Subject: [PATCH] notifications, settings, editor, event view fixes --- .../notifications/notifications.vue | 36 ++++++--- .../src/components/settings/settings.vue | 3 +- .../views/admin/events/EventsDetailsView.vue | 38 ++++++---- .../views/admin/events/TicketEditorView.vue | 74 ++++++++++++++++++- 4 files changed, 121 insertions(+), 30 deletions(-) diff --git a/src/webapp/src/components/notifications/notifications.vue b/src/webapp/src/components/notifications/notifications.vue index c2a7647..c6ba5a1 100644 --- a/src/webapp/src/components/notifications/notifications.vue +++ b/src/webapp/src/components/notifications/notifications.vue @@ -7,6 +7,7 @@ close progress_activity info + warning

{{ message }}

@@ -55,7 +56,7 @@ this.currentID[ 'low' ] += 1; id = this.currentID[ 'low' ]; } - this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority }; + this.notifications[ id ] = { 'message': message, 'showDuration': showDuration, 'messageType': messageType, 'priority': priority, 'id': id }; this.queue.push( id ); console.log( 'scheduled notification: ' + id + ' (' + message + ')' ); if ( this.displayTimeCurrentNotification >= this.notificationDisplayTime ) { @@ -67,8 +68,12 @@ /* This method deletes a notification and, in case the notification is being displayed, hides it. */ - delete notifications[ id ]; - delete this.queue[ this.queue.findIndex( id ) ]; + try { + delete notifications[ id ]; + delete this.queue[ this.queue.findIndex( id ) ]; + } catch ( error ) { + console.log( 'notification to be deleted is nonexistent or currently being displayed' ); + } if ( this.currentlyDisplayedNotificationID == id ) { this.handleNotifications(); } @@ -85,6 +90,7 @@ this.message = this.notifications[ this.queue[ 0 ] ][ 'message' ]; this.messageType = this.notifications[ this.queue[ 0 ] ][ 'messageType' ]; this.priority = this.notifications[ this.queue[ 0 ] ][ 'priority' ]; + this.currentlyDisplayedNotificationID = this.notifications[ this.queue[ 0 ] ][ 'id' ]; this.notificationDisplayTime = this.notifications[ this.queue[ 0 ] ][ 'showDuration' ]; this.queue.reverse(); this.queue.pop(); @@ -111,7 +117,7 @@ + \ No newline at end of file