Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
funkwhale
funkwhale
Commits
9e6bbb48
Verified
Commit
9e6bbb48
authored
Mar 07, 2019
by
Eliot Berriot
Browse files
Fix
#729
: Display new notifications immediatly on notifications page
parent
99b8ef2d
Pipeline
#3463
passed with stages
in 2 minutes and 42 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
changes/changelog.d/729.bugfix
0 → 100644
View file @
9e6bbb48
Display new notifications immediatly on notifications page (#729)
front/src/views/Notifications.vue
View file @
9e6bbb48
<
template
>
<main
class=
"main pusher"
v-title=
"labels.title"
>
<section
class=
"ui vertical aligned stripe segment"
>
<div
v-if=
"isLoading"
:class=
"['ui',
{'active': isLoading}, 'inverted', 'dimmer']">
<div
class=
"ui text loader"
><translate>
Loading notifications…
</translate></div>
</div>
<div
v-else
class=
"ui container"
>
<div
class=
"ui container"
>
<h1
class=
"ui header"
><translate>
Your notifications
</translate></h1>
<div
class=
"ui toggle checkbox"
>
<input
v-model=
"filters.is_read"
type=
"checkbox"
>
...
...
@@ -18,7 +15,12 @@
<translate>
Mark all as read
</translate>
</div>
<div
class=
"ui hidden divider"
/>
<table
v-if=
"notifications.count > 0"
class=
"ui table"
>
<div
v-if=
"isLoading"
:class=
"['ui',
{'active': isLoading}, 'inverted', 'dimmer']">
<div
class=
"ui text loader"
><translate>
Loading notifications…
</translate></div>
</div>
<table
v-else-if=
"notifications.count > 0"
class=
"ui table"
>
<tbody>
<notification-row
:item=
"item"
v-for=
"item in notifications.results"
:key=
"item.id"
/>
</tbody>
...
...
@@ -42,7 +44,7 @@ export default {
data
()
{
return
{
isLoading
:
false
,
notifications
:
null
,
notifications
:
{
count
:
0
,
results
:
[]}
,
filters
:
{
is_read
:
false
}
...
...
@@ -76,7 +78,8 @@ export default {
}
},
methods
:
{
handleNewNotification
(
event
)
{
handleNewNotification
(
event
)
{
this
.
notifications
.
count
+=
1
this
.
notifications
.
results
.
unshift
(
event
.
item
)
},
fetch
(
params
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment