Skip to content

Commit 0c32bf2

Browse files
committed
Address review comments
1 parent 0879d0b commit 0c32bf2

File tree

20 files changed

+298
-179
lines changed

20 files changed

+298
-179
lines changed

client/web/admin/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ export default (options = {}) => {
154154
this.$store.dispatch('notifications/addNotification', msg['@value'])
155155
break
156156

157+
case 'notification.read':
158+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
159+
break
160+
161+
case 'notification.read.all':
162+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
163+
break
164+
165+
case 'notification.delete':
166+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
167+
break
168+
157169
case 'error':
158170
this.toastDanger('Websocket message with error', msg['@value'])
159171
}

client/web/compose/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,18 @@ export default (options = {}) => {
160160
this.$store.dispatch('notifications/addNotification', msg['@value'])
161161
break
162162

163+
case 'notification.read':
164+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
165+
break
166+
167+
case 'notification.read.all':
168+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
169+
break
170+
171+
case 'notification.delete':
172+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
173+
break
174+
163175
case 'error':
164176
this.toastDanger('Websocket message with error', msg['@value'])
165177
}

client/web/discovery/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ export default (options = {}) => {
9292
this.$store.dispatch('notifications/addNotification', msg['@value'])
9393
break
9494

95+
case 'notification.read':
96+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
97+
break
98+
99+
case 'notification.read.all':
100+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
101+
break
102+
103+
case 'notification.delete':
104+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
105+
break
106+
95107
case 'error':
96108
this.toastDanger('Websocket message with error', msg['@value'])
97109
}

client/web/one/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ export default (options = {}) => {
104104
this.$store.dispatch('notifications/addNotification', msg['@value'])
105105
break
106106

107+
case 'notification.read':
108+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
109+
break
110+
111+
case 'notification.read.all':
112+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
113+
break
114+
115+
case 'notification.delete':
116+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
117+
break
118+
107119
case 'error':
108120
this.toastDanger('Websocket message with error', msg['@value'])
109121
}

client/web/privacy/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ export default (options = {}) => {
9696
this.$store.dispatch('notifications/addNotification', msg['@value'])
9797
break
9898

99+
case 'notification.read':
100+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
101+
break
102+
103+
case 'notification.read.all':
104+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
105+
break
106+
107+
case 'notification.delete':
108+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
109+
break
110+
99111
case 'error':
100112
this.toastDanger('Websocket message with error', msg['@value'])
101113
}

client/web/reporter/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ export default (options = {}) => {
101101
this.$store.dispatch('notifications/addNotification', msg['@value'])
102102
break
103103

104+
case 'notification.read':
105+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
106+
break
107+
108+
case 'notification.read.all':
109+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
110+
break
111+
112+
case 'notification.delete':
113+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
114+
break
115+
104116
case 'error':
105117
this.toastDanger('Websocket message with error', msg['@value'])
106118
}

client/web/workflow/src/app.js

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ export default (options = {}) => {
9393
this.$store.dispatch('notifications/addNotification', msg['@value'])
9494
break
9595

96+
case 'notification.read':
97+
this.$store.dispatch('notifications/updateReadNotification', msg['@value'])
98+
break
99+
100+
case 'notification.read.all':
101+
this.$store.dispatch('notifications/updateAllReadNotifications', msg['@value'])
102+
break
103+
104+
case 'notification.delete':
105+
this.$store.dispatch('notifications/removeNotification', msg['@value'])
106+
break
107+
96108
case 'error':
97109
this.toastDanger('Websocket message with error', msg['@value'])
98110
}

lib/js/src/api-clients/system.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4282,7 +4282,7 @@ export default class System {
42824282
}
42834283

42844284
notificationMarkAllAsReadEndpoint (): string {
4285-
return '/notification/read/all'
4285+
return '/notification/all/read'
42864286
}
42874287

42884288
// Attachment details

lib/vue/src/components/notifications/NotificationItem.vue

-20
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
role="button"
77
tabindex="0"
88
@click="$emit('click', notification)"
9-
@keydown.enter="$emit('click', notification)"
109
>
1110
<div
1211
class="action-menu bg-white pb-2 pl-2"
@@ -57,7 +56,6 @@
5756
:is="notificationComponent"
5857
:notification="notification"
5958
class="notification-item-content"
60-
@notification-click="$emit('click', notification)"
6159
/>
6260
</b-list-group-item>
6361

@@ -137,22 +135,4 @@ export default {
137135
transition: opacity 0.2s ease;
138136
}
139137
}
140-
141-
/* Remove default dropdown button styling */
142-
::v-deep .dropdown-toggle {
143-
&::after {
144-
display: none;
145-
}
146-
147-
&:focus {
148-
box-shadow: none;
149-
}
150-
}
151-
152-
/* Add hover effect to dropdown items */
153-
::v-deep .dropdown-item {
154-
&:active {
155-
background-color: rgba(0, 0, 0, 0.05);
156-
}
157-
}
158138
</style>

lib/vue/src/components/notifications/Notifications.vue

+28-33
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,35 @@
1313
class="d-flex align-items-center justify-content-end"
1414
style="min-width: 6rem;"
1515
>
16-
<li v-if="hasUnread">
17-
<b-button
18-
v-b-tooltip.hover
19-
variant="outline-light"
20-
class="p-2 border-0 d-flex align-items-center justify-content-center"
21-
style="width: 2rem; height: 2rem;"
22-
:title="$t('markAllAsRead')"
23-
@click="handleMarkAllAsRead"
24-
>
25-
<font-awesome-icon
26-
:icon="['fas', 'check-double']"
27-
class="h6 mb-0 text-primary"
28-
/>
29-
</b-button>
30-
</li>
16+
<b-button
17+
v-if="hasUnread"
18+
v-b-tooltip.hover
19+
variant="outline-light"
20+
class="p-2 border-0 d-flex align-items-center justify-content-center"
21+
style="width: 2rem; height: 2rem;"
22+
:title="$t('markAllAsRead')"
23+
@click="handleMarkAllAsRead"
24+
>
25+
<font-awesome-icon
26+
:icon="['fas', 'check-double']"
27+
class="h6 mb-0 text-primary"
28+
/>
29+
</b-button>
3130

32-
<li>
33-
<b-button
34-
v-b-tooltip.hover
35-
variant="outline-light"
36-
class="p-2 border-0 d-flex align-items-center justify-content-center"
37-
style="width: 2rem; height: 2rem;"
38-
:title="$t(muted ? 'unmute' : 'mute')"
39-
@click="toggleMuted"
40-
>
41-
<font-awesome-icon
42-
:icon="['fas', muted ? 'bell-slash' : 'bell']"
43-
class="h6 mb-0"
44-
:class="{ 'text-secondary': muted, 'text-primary': !muted }"
45-
/>
46-
</b-button>
47-
</li>
31+
<b-button
32+
v-b-tooltip.hover
33+
variant="outline-light"
34+
class="p-2 border-0 d-flex align-items-center justify-content-center"
35+
style="width: 2rem; height: 2rem;"
36+
:title="$t(muted ? 'unmute' : 'mute')"
37+
@click="toggleMuted"
38+
>
39+
<font-awesome-icon
40+
:icon="['fas', muted ? 'bell-slash' : 'bell']"
41+
class="h6 mb-0"
42+
:class="{ 'text-secondary': muted, 'text-primary': !muted }"
43+
/>
44+
</b-button>
4845
</div>
4946
</template>
5047

@@ -262,8 +259,6 @@ export default {
262259
},
263260
264261
loadNotifications () {
265-
this.setPageCursor(null)
266-
267262
return this.fetchNotifications({ unreadOnly: this.activeTab === 0 })
268263
},
269264

0 commit comments

Comments
 (0)