Browse Source

fix(files): better wording and catch single action run

Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
pull/36534/head
John Molakvoæ 3 years ago
parent
commit
ea3e77d6b9
No known key found for this signature in database GPG Key ID: 60C25B8C072916CF
  1. 11
      apps/files/src/components/FileEntry.vue
  2. 4
      apps/files/src/components/FilesListHeaderActions.vue
  3. 4
      dist/files-main.js
  4. 2
      dist/files-main.js.map
  5. 4
      dist/files_trashbin-main.js
  6. 2
      dist/files_trashbin-main.js.map
  7. 4
      dist/settings-vue-settings-personal-security.js
  8. 2
      dist/settings-vue-settings-personal-security.js.map

11
apps/files/src/components/FileEntry.vue

@ -103,7 +103,7 @@ import { debounce } from 'debounce'
import { formatFileSize } from '@nextcloud/files'
import { Fragment } from 'vue-fragment'
import { join } from 'path'
import { showError } from '@nextcloud/dialogs'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { translate } from '@nextcloud/l10n'
import CancelablePromise from 'cancelable-promise'
import FileIcon from 'vue-material-design-icons/File.vue'
@ -434,10 +434,15 @@ export default Vue.extend({
const displayName = action.displayName([this.source], this.currentView)
try {
this.loading = action.id
await action.exec(this.source, this.currentView)
const success = await action.exec(this.source, this.currentView)
if (success) {
showSuccess(this.t('files', '"{displayName}" action executed successfully', { displayName }))
return
}
showError(this.t('files', '"{displayName}" action failed', { displayName }))
} catch (e) {
logger.error('Error while executing action', { action, e })
showError(this.t('files', 'Error while executing action "{displayName}"', { displayName }))
showError(this.t('files', '"{displayName}" action failed', { displayName }))
} finally {
this.loading = ''
}

4
apps/files/src/components/FilesListHeaderActions.vue

@ -136,11 +136,11 @@ export default Vue.extend({
}
// Show success message and clear selection
showSuccess(this.t('files', '"{displayName}" batch action successfully executed', { displayName }))
showSuccess(this.t('files', '"{displayName}" batch action executed successfully', { displayName }))
this.selectionStore.reset()
} catch (e) {
logger.error('Error while executing action', { action, e })
showError(this.t('files', 'Error while executing action "{displayName}"', { displayName }))
showError(this.t('files', '"{displayName}" action failed', { displayName }))
} finally {
this.loading = null
}

4
dist/files-main.js
File diff suppressed because it is too large
View File

2
dist/files-main.js.map
File diff suppressed because it is too large
View File

4
dist/files_trashbin-main.js
File diff suppressed because it is too large
View File

2
dist/files_trashbin-main.js.map
File diff suppressed because it is too large
View File

4
dist/settings-vue-settings-personal-security.js
File diff suppressed because it is too large
View File

2
dist/settings-vue-settings-personal-security.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save