diff --git a/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.story.js b/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.story.js
new file mode 100644
index 000000000..35724fe7e
--- /dev/null
+++ b/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.story.js
@@ -0,0 +1,18 @@
+import { storiesOf } from '@storybook/vue'
+import { withA11y } from '@storybook/addon-a11y'
+import { action } from '@storybook/addon-actions'
+import NotificationsDropdownFilter from '~/components/NotificationsDropdownFilter/NotificationsDropdownFilter'
+import helpers from '~/storybook/helpers'
+
+helpers.init()
+
+storiesOf('NotificationsDropdownFilter', module)
+ .addDecorator(withA11y)
+ .addDecorator(helpers.layout)
+ .add('filter dropdown', () => ({
+ components: { NotificationsDropdownFilter },
+ methods: {
+ filterNotifications: action('filterNotifications'),
+ },
+ template: '',
+ }))
diff --git a/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.vue b/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.vue
index b0d1deb7d..7c5e0a42a 100644
--- a/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.vue
+++ b/webapp/components/NotificationsDropdownFilter/NotificationsDropdownFilter.vue
@@ -1,5 +1,5 @@
-
+
-
+
{{ selected }}
@@ -15,7 +15,7 @@
slot="popover"
slot-scope="{ toggleMenu }"
class="locale-menu-popover"
- :routes="routes"
+ :routes="filterOptions"
>
@@ -39,28 +39,17 @@ export default {
},
data() {
return {
- selected: this.$t('notifications.sortingLabel.all'),
- sortingOptions: [
- { label: this.$t('notifications.sortingLabel.all'), value: null },
- { label: this.$t('notifications.sortingLabel.read'), value: true },
- { label: this.$t('notifications.sortingLabel.unread'), value: false },
+ selected: this.$t('notifications.filterLabel.all'),
+ filterOptions: [
+ { label: this.$t('notifications.filterLabel.all'), value: null },
+ { label: this.$t('notifications.filterLabel.read'), value: true },
+ { label: this.$t('notifications.filterLabel.unread'), value: false },
],
}
},
- computed: {
- routes() {
- let routes = this.sortingOptions.map(option => {
- return {
- label: option.label,
- value: option.value,
- }
- })
- return routes
- },
- },
methods: {
- sortNotifications(option, toggleMenu) {
- this.$emit('sortNotifications', option)
+ filterNotifications(option, toggleMenu) {
+ this.$emit('filterNotifications', option.value)
this.selected = option.label
toggleMenu()
},
diff --git a/webapp/locales/de.json b/webapp/locales/de.json
index 534ef819f..c5ea3d818 100644
--- a/webapp/locales/de.json
+++ b/webapp/locales/de.json
@@ -181,7 +181,7 @@
"post": "Beitrag",
"user": "Benutzer",
"content": "Inhalt",
- "sortingLabel": {
+ "filterLabel": {
"all": "Alle",
"read": "Lesen ",
"unread": "Ungelesen"
diff --git a/webapp/locales/en.json b/webapp/locales/en.json
index 775132eab..e591b3b68 100644
--- a/webapp/locales/en.json
+++ b/webapp/locales/en.json
@@ -182,7 +182,7 @@
"post": "Post",
"user": "User",
"content": "Content",
- "sortingLabel": {
+ "filterLabel": {
"all": "All",
"read": "Read",
"unread": "Unread"
diff --git a/webapp/locales/pt.json b/webapp/locales/pt.json
index 8ff168b72..d2d753527 100644
--- a/webapp/locales/pt.json
+++ b/webapp/locales/pt.json
@@ -194,7 +194,7 @@
"post": "Post",
"user": "Usuário",
"content": "Conteúdo",
- "sortingLabel": {
+ "filterLabel": {
"all": "Todos",
"read": "Lido",
"unread": "Não lido"
diff --git a/webapp/pages/notifications/index.vue b/webapp/pages/notifications/index.vue
index 9e2346061..59d63b5e3 100644
--- a/webapp/pages/notifications/index.vue
+++ b/webapp/pages/notifications/index.vue
@@ -6,7 +6,7 @@
-
+
@@ -48,8 +48,8 @@ export default {
},
},
methods: {
- sortNotifications(option) {
- this.notificationRead = option.value
+ filterNotifications(value) {
+ this.notificationRead = value
this.$apollo.queries.notifications.refresh()
},
async markNotificationAsRead(notificationSourceId) {