Skip to content

Commit f42a7a2

Browse files
authored
Merge pull request #1031 from TechnologyEnhancedLearning/Develop/Fixes/TD-5170-Issue-showing-console-errors-on-few-of-the-create-new-account-flow-screens-&-Notifications
TD-5170: Fixed console errors on Notifications page.
2 parents d2eae57 + fc4c697 commit f42a7a2

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notification.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
<i :class="['fal fa-envelope' + (notification.readOnDate != null ? '-open text-success' : '')]">&nbsp;</i>
7575
<a href="#" @click="showNotification(notification)">{{ notification.title }}</a>
7676
</div>
77-
78-
<a href="#deleteModalButton" data-toggle="modal" @click="deleteNotification()" aria-label="Delete" v-if="notification.userDismissable">
77+
78+
<a href="#deleteModalButton" data-toggle="modal" @click="selectNotification(notification)" aria-label="Delete" v-if="notification.userDismissable">
7979
<i class="fas fa-ellipsis-h fa-lg" style="color: #435563;"></i>
8080
</a>
8181
</div>
@@ -173,7 +173,7 @@
173173
.catch(e => console.log(e));
174174
}
175175
},
176-
async deleteNotification() {
176+
async deleteNotification() {
177177
await axios.delete(
178178
'/api/notification/' + this.selectedNotification.notificationId + '?userNotificationId=' + this.selectedNotification.id)
179179
.catch(e => console.log(e));

LearningHub.Nhs.WebUI/Scripts/vuesrc/notification/notifications.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<div class="modal-dialog modal-dialog-centered" role="document">
8888
<div class="modal-content">
8989
<div class="modal-header pr-0 pt-0">
90-
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
90+
<button type="button" class="close" @click="closeConfirmation" aria-label="Close">
9191
<i class="fa-solid fa-xmark"></i>
9292
</button>
9393
</div>
@@ -98,7 +98,7 @@
9898
</p>
9999
</div>
100100
<div class="modal-footer justify-content-center">
101-
<button type="button" class="nhsuk-button nhsuk-button--secondary mr-4" data-dismiss="modal">Cancel</button>
101+
<button type="button" class="nhsuk-button nhsuk-button--secondary mr-4" @click="closeConfirmation">Cancel</button>
102102
<button type="button" class="nhsuk-button" @click="deleteNotification">Delete</button>
103103
</div>
104104
</div>
@@ -143,6 +143,13 @@
143143
$('#deleteModalButton').modal('hide');
144144
$('#deleteModal').modal();
145145
},
146+
closeConfirmation() {
147+
if (document.activeElement instanceof HTMLElement) {
148+
document.activeElement.blur();
149+
}
150+
document.body.focus();
151+
setTimeout(() => { $('#deleteModal').modal('hide'); }, 10);
152+
},
146153
showNotification(notification: NotificationModel) {
147154
this.selectedNotification = notification;
148155
this.showMessage = true;
@@ -155,7 +162,7 @@
155162
},
156163
async deleteNotification() {
157164
await this.getSelectedComponent().deleteNotification();
158-
$('#deleteModal').modal('hide');
165+
this.closeConfirmation();
159166
this.showMessage = false;
160167
},
161168
notificationTypeContent() {

0 commit comments

Comments
 (0)