mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #45227 from nextcloud/fix/set-reminder-trash
fix: Remove reminder action from trash
This commit is contained in:
commit
2b2a866b05
5 changed files with 26 additions and 9 deletions
|
|
@ -19,7 +19,10 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
import { FileAction, Node } from '@nextcloud/files'
|
||||
|
||||
import type { Node, View } from '@nextcloud/files'
|
||||
|
||||
import { FileAction } from '@nextcloud/files'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import CalendarClockSvg from '@mdi/svg/svg/calendar-clock.svg?raw'
|
||||
|
||||
|
|
@ -32,7 +35,10 @@ export const action = new FileAction({
|
|||
title: () => t('files_reminders', 'Set reminder at custom date & time'),
|
||||
iconSvgInline: () => CalendarClockSvg,
|
||||
|
||||
enabled: () => true,
|
||||
enabled: (_nodes: Node[], view: View) => {
|
||||
return view.id !== 'trashbin'
|
||||
},
|
||||
|
||||
parent: SET_REMINDER_MENU_ID,
|
||||
|
||||
async exec(file: Node) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
import type { Node, View } from '@nextcloud/files'
|
||||
|
||||
import { FileAction } from '@nextcloud/files'
|
||||
import { translate as t } from '@nextcloud/l10n'
|
||||
import AlarmSvg from '@mdi/svg/svg/alarm.svg?raw'
|
||||
|
|
@ -30,7 +33,9 @@ export const action = new FileAction({
|
|||
displayName: () => t('files_reminders', 'Set reminder'),
|
||||
iconSvgInline: () => AlarmSvg,
|
||||
|
||||
enabled: () => true,
|
||||
enabled: (_nodes: Node[], view: View) => {
|
||||
return view.id !== 'trashbin'
|
||||
},
|
||||
|
||||
async exec() {
|
||||
return null
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
*/
|
||||
|
||||
import Vue from 'vue'
|
||||
import type { Node } from '@nextcloud/files'
|
||||
import type { Node, View } from '@nextcloud/files'
|
||||
|
||||
import { FileAction } from '@nextcloud/files'
|
||||
import { emit } from '@nextcloud/event-bus'
|
||||
|
|
@ -91,7 +91,13 @@ const generateFileAction = (option: ReminderOption): FileAction|null => {
|
|||
// Empty svg to hide the icon
|
||||
iconSvgInline: () => '<svg></svg>',
|
||||
|
||||
enabled: () => Boolean(getDateTime(option.dateTimePreset)),
|
||||
enabled: (_nodes: Node[], view: View) => {
|
||||
if (view.id === 'trashbin') {
|
||||
return false
|
||||
}
|
||||
return Boolean(getDateTime(option.dateTimePreset))
|
||||
},
|
||||
|
||||
parent: SET_REMINDER_MENU_ID,
|
||||
|
||||
async exec(node: Node) {
|
||||
|
|
|
|||
6
dist/files_reminders-init.js
vendored
6
dist/files_reminders-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files_reminders-init.js.map
vendored
2
dist/files_reminders-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue