Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable27] Fix (visually) removing first notification when executing an action #1662

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/notifications-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/notifications-main.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/Components/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
default: false,
required: true,
},
notificationIndex: {
type: Number,
required: true,
},
},

data() {
Expand Down Expand Up @@ -118,12 +122,12 @@

// emit event to current app
this.$parent._$el.fadeOut(OC.menuSpeed)
this.$parent.$emit('remove')
this.$parent.$emit('remove', this.notificationIndex)

emit('notifications:action:executed', event)

try {
$('body').trigger(new $.Event('OCA.Notification.Action', {

Check warning on line 130 in src/Components/Action.vue

View workflow job for this annotation

GitHub Actions / eslint

The global property or function $ was deprecated in Nextcloud 19.0.0

Check warning on line 130 in src/Components/Action.vue

View workflow job for this annotation

GitHub Actions / eslint

The global property or function $ was deprecated in Nextcloud 19.0.0
notification: this.$parent,
action: {
url: this.link,
Expand Down
5 changes: 4 additions & 1 deletion src/Components/Notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@
</div>

<div v-if="actions.length" class="notification-actions">
<Action v-for="(a, i) in actions" :key="i" v-bind="a" />
<Action v-for="(a, i) in actions"
:key="i"
v-bind="a"
:notification-index="index" />
</div>
<div v-else-if="externalLink" class="notification-actions">
<NcButton type="primary"
Expand Down Expand Up @@ -84,7 +87,7 @@
import Action from './Action.vue'
import { generateOcsUrl, generateFilePath } from '@nextcloud/router'
import moment from '@nextcloud/moment'
import RichText from '@nextcloud/vue-richtext'

Check warning on line 90 in src/Components/Notification.vue

View workflow job for this annotation

GitHub Actions / eslint

Using exported name 'RichText' as identifier for default export
import DefaultParameter from './Parameters/DefaultParameter.vue'
import File from './Parameters/File.vue'
import User from './Parameters/User.vue'
Expand Down Expand Up @@ -243,7 +246,7 @@
},

mounted() {
this._$el = $(this.$el)

Check warning on line 249 in src/Components/Notification.vue

View workflow job for this annotation

GitHub Actions / eslint

The global property or function $ was deprecated in Nextcloud 19.0.0

// Parents: TransitionGroup > Transition > HeaderMenu
if (typeof this.$parent.$parent.$parent.showBrowserNotifications === 'undefined') {
Expand Down
Loading