mirror of
https://github.com/nextcloud/server.git
synced 2026-03-19 17:13:56 -04:00
Merge pull request #54260 from nextcloud/fix/less-useless-toasts
fix: Remove redundant toast notifications
This commit is contained in:
commit
2a96042db1
21 changed files with 18 additions and 36 deletions
|
|
@ -2,10 +2,8 @@
|
|||
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
import { showInfo } from '@nextcloud/dialogs'
|
||||
import { Permission, Node, View, FileAction } from '@nextcloud/files'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import PQueue from 'p-queue'
|
||||
|
||||
import CloseSvg from '@mdi/svg/svg/close.svg?raw'
|
||||
|
|
@ -64,7 +62,6 @@ export const action = new FileAction({
|
|||
|
||||
// If the user cancels the deletion, we don't want to do anything
|
||||
if (confirm === false) {
|
||||
showInfo(t('files', 'Deletion cancelled'))
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +85,6 @@ export const action = new FileAction({
|
|||
|
||||
// If the user cancels the deletion, we don't want to do anything
|
||||
if (confirm === false) {
|
||||
showInfo(t('files', 'Deletion cancelled'))
|
||||
return Promise.all(nodes.map(() => null))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,6 @@ export const handleCopyMoveNodeTo = async (node: Node, destination: Folder, meth
|
|||
}
|
||||
} catch (error) {
|
||||
// User cancelled
|
||||
showError(t('files', 'Move cancelled'))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
@ -330,7 +329,6 @@ export const action = new FileAction({
|
|||
return false
|
||||
}
|
||||
if (result === false) {
|
||||
showInfo(t('files', 'Cancelled move or copy of "{filename}".', { filename: node.displayname }))
|
||||
return null
|
||||
}
|
||||
|
||||
|
|
@ -352,10 +350,6 @@ export const action = new FileAction({
|
|||
const result = await openFilePickerForAction(action, dir, nodes)
|
||||
// Handle cancellation silently
|
||||
if (result === false) {
|
||||
showInfo(nodes.length === 1
|
||||
? t('files', 'Cancelled move or copy of "{filename}".', { filename: nodes[0].displayname })
|
||||
: t('files', 'Cancelled move or copy operation'),
|
||||
)
|
||||
return nodes.map(() => null)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { basename } from 'path'
|
|||
import { emit } from '@nextcloud/event-bus'
|
||||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { Permission, Folder } from '@nextcloud/files'
|
||||
import { showError, showInfo, showSuccess } from '@nextcloud/dialogs'
|
||||
import { showError, showSuccess } from '@nextcloud/dialogs'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import axios from '@nextcloud/axios'
|
||||
|
||||
|
|
@ -51,7 +51,6 @@ export const entry = {
|
|||
async handler(context: Folder, content: Node[]) {
|
||||
const name = await newNodeName(t('files', 'New folder'), content)
|
||||
if (name === null) {
|
||||
showInfo(t('files', 'New folder creation cancelled'))
|
||||
return
|
||||
}
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -115,17 +115,14 @@ describe('files_trashbin: file list actions - empty trashbin', () => {
|
|||
|
||||
it('can cancel the deletion by closing the dialog', async () => {
|
||||
const apiSpy = vi.spyOn(api, 'emptyTrash')
|
||||
const dialogSpy = vi.spyOn(ncDialogs, 'showInfo')
|
||||
|
||||
dialogBuilder.build.mockImplementationOnce(() => ({ show: async () => false }))
|
||||
expect(await emptyTrashAction.exec(trashbinView, nodes, root)).toBe(null)
|
||||
expect(apiSpy).not.toBeCalled()
|
||||
expect(dialogSpy).toBeCalledWith('Deletion cancelled')
|
||||
})
|
||||
|
||||
it('can cancel the deletion', async () => {
|
||||
const apiSpy = vi.spyOn(api, 'emptyTrash')
|
||||
const dialogSpy = vi.spyOn(ncDialogs, 'showInfo')
|
||||
|
||||
dialogBuilder.build.mockImplementationOnce(() => ({
|
||||
show: async () => {
|
||||
|
|
@ -136,7 +133,6 @@ describe('files_trashbin: file list actions - empty trashbin', () => {
|
|||
}))
|
||||
expect(await emptyTrashAction.exec(trashbinView, nodes, root)).toBe(null)
|
||||
expect(apiSpy).not.toBeCalled()
|
||||
expect(dialogSpy).toBeCalledWith('Deletion cancelled')
|
||||
})
|
||||
|
||||
it('will trigger the API request if confirmed', async () => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { t } from '@nextcloud/l10n'
|
|||
import {
|
||||
DialogSeverity,
|
||||
getDialogBuilder,
|
||||
showInfo,
|
||||
} from '@nextcloud/dialogs'
|
||||
import { emptyTrash } from '../services/api.ts'
|
||||
import { TRASHBIN_VIEW_ID } from '../files_views/trashbinView.ts'
|
||||
|
|
@ -71,7 +70,6 @@ export const emptyTrashAction = new FileListAction({
|
|||
return null
|
||||
}
|
||||
|
||||
showInfo(t('files_trashbin', 'Deletion cancelled'))
|
||||
return null
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ import { emit } from '@nextcloud/event-bus'
|
|||
import { getCurrentUser } from '@nextcloud/auth'
|
||||
import { getLanguage, n, t } from '@nextcloud/l10n'
|
||||
import { loadState } from '@nextcloud/initial-state'
|
||||
import { showError, showInfo } from '@nextcloud/dialogs'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
import debounce from 'debounce'
|
||||
import domPurify from 'dompurify'
|
||||
import escapeHTML from 'escape-html'
|
||||
|
|
@ -553,7 +553,6 @@ export default defineComponent({
|
|||
|
||||
onCancel() {
|
||||
this.opened = false
|
||||
showInfo(t('systemtags', 'File tags modification canceled'))
|
||||
this.$emit('close', null)
|
||||
},
|
||||
|
||||
|
|
|
|||
2
dist/3596-3596.js
vendored
Normal file
2
dist/3596-3596.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/3596-3596.js.map
vendored
Normal file
1
dist/3596-3596.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/3596-3596.js.map.license
vendored
Symbolic link
1
dist/3596-3596.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
3596-3596.js.license
|
||||
2
dist/9498-9498.js
vendored
2
dist/9498-9498.js
vendored
File diff suppressed because one or more lines are too long
1
dist/9498-9498.js.map
vendored
1
dist/9498-9498.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/9498-9498.js.map.license
vendored
1
dist/9498-9498.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
9498-9498.js.license
|
||||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files-main.js
vendored
4
dist/files-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-main.js.map
vendored
2
dist/files-main.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/files_trashbin-init.js
vendored
4
dist/files_trashbin-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_trashbin-init.js.map
vendored
2
dist/files_trashbin-init.js.map
vendored
File diff suppressed because one or more lines are too long
4
dist/systemtags-init.js
vendored
4
dist/systemtags-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/systemtags-init.js.map
vendored
2
dist/systemtags-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue