@enso-ui/notifications 3.2.12 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -52,6 +52,10 @@ Common imports:
|
|
|
52
52
|
- wraps the core renderless notifications controller
|
|
53
53
|
- renders unread count, dropdown items, and mark-all-as-read actions
|
|
54
54
|
|
|
55
|
+
Notification `data.path` accepts a URL path string or a Vue Router location
|
|
56
|
+
object, such as `{ name: "projects.show", params: { project: 42 } }`. The inbox,
|
|
57
|
+
navbar, and desktop notification clicks use the same destination format.
|
|
58
|
+
|
|
55
59
|
### Settings component
|
|
56
60
|
|
|
57
61
|
`src/bulma/components/settings/ToastrPosition.vue`
|
package/package.json
CHANGED
|
@@ -24,19 +24,13 @@
|
|
|
24
24
|
class="navbar-item"
|
|
25
25
|
@click="read(notification)">
|
|
26
26
|
<p class="is-notification"
|
|
27
|
-
:class="{
|
|
28
|
-
'has-text-grey-light': notification.read_at,
|
|
29
|
-
'is-bold': !notification.read_at,
|
|
30
|
-
}">
|
|
27
|
+
:class="{ 'has-text-weight-bold': !notification.read_at }">
|
|
31
28
|
<fa v-if="notification.data.icon"
|
|
32
29
|
:icon="notification.data.icon"/>
|
|
33
30
|
{{ notification.data.body }}
|
|
34
31
|
</p>
|
|
35
32
|
<p>
|
|
36
|
-
<small :class="{
|
|
37
|
-
'has-text-grey-light': notification.read_at,
|
|
38
|
-
'has-text-info': !notification.read_at,
|
|
39
|
-
}">
|
|
33
|
+
<small :class="{ 'has-text-info': !notification.read_at }">
|
|
40
34
|
{{ timeFromNow(notification.created_at) }}
|
|
41
35
|
</small>
|
|
42
36
|
</p>
|
|
@@ -48,7 +42,7 @@
|
|
|
48
42
|
class="level navbar-item">
|
|
49
43
|
<div class="level-left">
|
|
50
44
|
<div class="level-item">
|
|
51
|
-
<a class="button is-small
|
|
45
|
+
<a class="button is-small"
|
|
52
46
|
@click="visitNotifications();$refs.navbarItem.hide()">
|
|
53
47
|
<span>{{ i18n('See all') }}</span>
|
|
54
48
|
<span class="icon is-small">
|
|
@@ -59,7 +53,7 @@
|
|
|
59
53
|
</div>
|
|
60
54
|
<div class="level-right">
|
|
61
55
|
<div class="level-item">
|
|
62
|
-
<a class="button is-small is-
|
|
56
|
+
<a class="button is-small is-dark"
|
|
63
57
|
@click="readAll">
|
|
64
58
|
<span>{{ i18n('Mark all as read') }}</span>
|
|
65
59
|
<span class="icon is-small">
|
|
@@ -137,7 +137,7 @@ export default {
|
|
|
137
137
|
eventBus.$emit('read-notification', notification);
|
|
138
138
|
|
|
139
139
|
if (notification.data.path && notification.data.path !== '#') {
|
|
140
|
-
this.$router.push(
|
|
140
|
+
this.$router.push(notification.data.path)
|
|
141
141
|
.catch(this.routerErrorHandler);
|
|
142
142
|
}
|
|
143
143
|
}).catch(this.errorHandler);
|
|
@@ -110,7 +110,7 @@ export default {
|
|
|
110
110
|
|
|
111
111
|
notification.onclick = () => {
|
|
112
112
|
if (path) {
|
|
113
|
-
this.$router.push(
|
|
113
|
+
this.$router.push(path)
|
|
114
114
|
.catch(this.routerErrorHandler);
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -178,7 +178,7 @@ export default {
|
|
|
178
178
|
notification.read_at = data.read_at;
|
|
179
179
|
|
|
180
180
|
if (notification.data.path && notification.data.path !== '#') {
|
|
181
|
-
this.$router.push(
|
|
181
|
+
this.$router.push(notification.data.path)
|
|
182
182
|
.catch(this.routerErrorHandler);
|
|
183
183
|
}
|
|
184
184
|
}).catch(this.errorHandler);
|