Merge pull request #35271 from nextcloud/enh/a11y-share-success

Show success on share actions
pull/35249/head
Simon L 2022-12-03 19:55:16 +07:00 committed by GitHub
commit 31ec83f2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

@ -300,7 +300,7 @@
<script>
import { generateUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { Type as ShareTypes } from '@nextcloud/sharing'
import Vue from 'vue'
@ -774,6 +774,7 @@ export default {
if (typeof this.share.newLabel === 'string') {
this.share.label = this.share.newLabel
this.$delete(this.share, 'newLabel')
showSuccess(t('files_sharing', 'Share label saved'))
this.queueUpdate('label')
}
},
@ -840,6 +841,7 @@ export default {
onPasswordSubmit() {
if (this.hasUnsavedPassword) {
this.share.password = this.share.newPassword.trim()
showSuccess(t('files_sharing', 'Share password saved'))
this.queueUpdate('password')
}
},

@ -25,6 +25,7 @@
*
*/
import { showSuccess } from '@nextcloud/dialogs'
import { getCurrentUser } from '@nextcloud/auth'
// eslint-disable-next-line import/no-unresolved, node/no-missing-import
import PQueue from 'p-queue'
@ -211,6 +212,7 @@ export default {
if (this.share.newNote) {
this.share.note = this.share.newNote
this.$delete(this.share, 'newNote')
showSuccess(t('files_sharing', 'Share note saved'))
this.queueUpdate('note')
}
},
@ -224,6 +226,10 @@ export default {
this.open = false
await this.deleteShare(this.share.id)
console.debug('Share deleted', this.share.id)
const message = this.share.itemType === 'file'
? t('files_sharing', 'File "{path}" has been unshared', { path: this.share.path })
: t('files_sharing', 'Folder "{path}" has been unshared', { path: this.share.path })
showSuccess(message)
this.$emit('remove:share', this.share)
} catch (error) {
// re-open menu if error

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long