refactor(files): move file action hotkeys to the file actions

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2025-11-11 17:24:55 +01:00
parent 8c9ae9f939
commit 74501ca66e
No known key found for this signature in database
GPG key ID: 45FAE7268762B400
7 changed files with 22 additions and 475 deletions

View file

@ -49,7 +49,6 @@ describe('CalDavSettings', () => {
Vue.prototype.$t = vi.fn((app, text) => text)
},
)
expect(TLUtils.container).toMatchSnapshot()
const sendInvitations = TLUtils.getByLabelText(
'Send invitations to attendees',
)

View file

@ -1,469 +0,0 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`CalDavSettings > interactions 1`] = `
<div>
<div
class="settings-section settings-section--limit-width"
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<h2
class="settings-section__name"
data-v-56b92b56=""
>
Calendar server
<a
aria-label="External documentation for Calendar server"
class="settings-section__info"
data-v-56b92b56=""
href="https://docs.nextcloud.com/server/23/go.php?to=user-sync-calendars"
rel="noreferrer nofollow"
target="_blank"
title="External documentation for Calendar server"
>
<span
aria-hidden="true"
class="material-design-icon help-circle-icon"
data-v-56b92b56=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="20"
viewBox="0 0 24 24"
width="20"
>
<path
d="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"
>
<!---->
</path>
</svg>
</span>
</a>
</h2>
<!---->
<p
class="settings-hint"
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Also install the
<a
href="../apps/office/calendar"
target="_blank"
>
Calendar app
</a>
, or
<a
href="https://docs.nextcloud.com/server/23/go.php?to=user-sync-calendars"
rel="noreferrer noopener"
target="_blank"
>
connect your desktop & mobile for syncing ↗
</a>
.
</p>
<p
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<span
class="checkbox-radio-switch checkbox-radio-switch-switch checkbox-radio-switch--checked"
data-v-24ed12a5=""
data-v-56b92b56=""
data-v-6b8d4c30=""
style="--1f97b3de: 36px; --be84d992: 16px;"
>
<input
aria-labelledby="wceav"
class="checkbox-radio-switch__input"
data-v-24ed12a5=""
id="caldavSendInvitations"
type="checkbox"
value=""
/>
<span
class="checkbox-content checkbox-radio-switch__content checkbox-content-switch checkbox-content--has-text"
data-v-24ed12a5=""
data-v-cfa76919=""
id="caldavSendInvitations-label"
>
<span
aria-hidden="true"
class="checkbox-content__icon checkbox-content__icon--checked checkbox-radio-switch__icon"
data-v-cfa76919=""
inert="inert"
>
<span
aria-hidden="true"
class="material-design-icon toggle-switch-icon"
data-v-cfa76919=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="36"
viewBox="0 0 24 24"
width="36"
>
<path
d="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"
>
<!---->
</path>
</svg>
</span>
</span>
<span
class="checkbox-content__wrapper"
data-v-cfa76919=""
>
<span
class="checkbox-content__text checkbox-radio-switch__text"
data-v-cfa76919=""
id="wceav"
>
Send invitations to attendees
</span>
<!---->
</span>
</span>
</span>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Please make sure to properly set up
<a
href="../admin#mail_general_settings"
>
the email server
</a>
.
</em>
</p>
<p
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<span
class="checkbox-radio-switch checkbox checkbox-radio-switch-switch checkbox-radio-switch--checked"
data-v-24ed12a5=""
data-v-56b92b56=""
data-v-6b8d4c30=""
style="--1f97b3de: 36px; --be84d992: 16px;"
>
<input
aria-labelledby="hxkyv"
class="checkbox-radio-switch__input"
data-v-24ed12a5=""
id="caldavGenerateBirthdayCalendar"
type="checkbox"
value=""
/>
<span
class="checkbox-content checkbox-radio-switch__content checkbox-content-switch checkbox-content--has-text"
data-v-24ed12a5=""
data-v-cfa76919=""
id="caldavGenerateBirthdayCalendar-label"
>
<span
aria-hidden="true"
class="checkbox-content__icon checkbox-content__icon--checked checkbox-radio-switch__icon"
data-v-cfa76919=""
inert="inert"
>
<span
aria-hidden="true"
class="material-design-icon toggle-switch-icon"
data-v-cfa76919=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="36"
viewBox="0 0 24 24"
width="36"
>
<path
d="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"
>
<!---->
</path>
</svg>
</span>
</span>
<span
class="checkbox-content__wrapper"
data-v-cfa76919=""
>
<span
class="checkbox-content__text checkbox-radio-switch__text"
data-v-cfa76919=""
id="hxkyv"
>
Automatically generate a birthday calendar
</span>
<!---->
</span>
</span>
</span>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Birthday calendars will be generated by a background job.
</em>
<br
data-v-56b92b56=""
data-v-6b8d4c30=""
/>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Hence they will not be available immediately after enabling but will show up after some time.
</em>
</p>
<p
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<span
class="checkbox-radio-switch checkbox-radio-switch-switch checkbox-radio-switch--checked"
data-v-24ed12a5=""
data-v-56b92b56=""
data-v-6b8d4c30=""
style="--1f97b3de: 36px; --be84d992: 16px;"
>
<input
aria-labelledby="mppqs"
class="checkbox-radio-switch__input"
data-v-24ed12a5=""
id="caldavSendEventReminders"
type="checkbox"
value=""
/>
<span
class="checkbox-content checkbox-radio-switch__content checkbox-content-switch checkbox-content--has-text"
data-v-24ed12a5=""
data-v-cfa76919=""
id="caldavSendEventReminders-label"
>
<span
aria-hidden="true"
class="checkbox-content__icon checkbox-content__icon--checked checkbox-radio-switch__icon"
data-v-cfa76919=""
inert="inert"
>
<span
aria-hidden="true"
class="material-design-icon toggle-switch-icon"
data-v-cfa76919=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="36"
viewBox="0 0 24 24"
width="36"
>
<path
d="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"
>
<!---->
</path>
</svg>
</span>
</span>
<span
class="checkbox-content__wrapper"
data-v-cfa76919=""
>
<span
class="checkbox-content__text checkbox-radio-switch__text"
data-v-cfa76919=""
id="mppqs"
>
Send notifications for events
</span>
<!---->
</span>
</span>
</span>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Please make sure to properly set up
<a
href="../admin#mail_general_settings"
>
the email server
</a>
.
</em>
<br
data-v-56b92b56=""
data-v-6b8d4c30=""
/>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Notifications are sent via background jobs, so these must occur often enough.
</em>
</p>
<p
class="indented"
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<span
class="checkbox-radio-switch checkbox-radio-switch-switch checkbox-radio-switch--checked"
data-v-24ed12a5=""
data-v-56b92b56=""
data-v-6b8d4c30=""
style="--1f97b3de: 36px; --be84d992: 16px;"
>
<input
aria-labelledby="szoux"
class="checkbox-radio-switch__input"
data-v-24ed12a5=""
id="caldavSendEventRemindersToSharedGroupMembers"
type="checkbox"
value=""
/>
<span
class="checkbox-content checkbox-radio-switch__content checkbox-content-switch checkbox-content--has-text"
data-v-24ed12a5=""
data-v-cfa76919=""
id="caldavSendEventRemindersToSharedGroupMembers-label"
>
<span
aria-hidden="true"
class="checkbox-content__icon checkbox-content__icon--checked checkbox-radio-switch__icon"
data-v-cfa76919=""
inert="inert"
>
<span
aria-hidden="true"
class="material-design-icon toggle-switch-icon"
data-v-cfa76919=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="36"
viewBox="0 0 24 24"
width="36"
>
<path
d="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"
>
<!---->
</path>
</svg>
</span>
</span>
<span
class="checkbox-content__wrapper"
data-v-cfa76919=""
>
<span
class="checkbox-content__text checkbox-radio-switch__text"
data-v-cfa76919=""
id="szoux"
>
Send reminder notifications to calendar sharees as well
</span>
<!---->
</span>
</span>
</span>
<em
data-v-56b92b56=""
data-v-6b8d4c30=""
>
Reminders are always sent to organizers and attendees.
</em>
</p>
<p
class="indented"
data-v-56b92b56=""
data-v-6b8d4c30=""
>
<span
class="checkbox-radio-switch checkbox-radio-switch-switch checkbox-radio-switch--checked"
data-v-24ed12a5=""
data-v-56b92b56=""
data-v-6b8d4c30=""
style="--1f97b3de: 36px; --be84d992: 16px;"
>
<input
aria-labelledby="mblaf"
class="checkbox-radio-switch__input"
data-v-24ed12a5=""
id="caldavSendEventRemindersPush"
type="checkbox"
value=""
/>
<span
class="checkbox-content checkbox-radio-switch__content checkbox-content-switch checkbox-content--has-text"
data-v-24ed12a5=""
data-v-cfa76919=""
id="caldavSendEventRemindersPush-label"
>
<span
aria-hidden="true"
class="checkbox-content__icon checkbox-content__icon--checked checkbox-radio-switch__icon"
data-v-cfa76919=""
inert="inert"
>
<span
aria-hidden="true"
class="material-design-icon toggle-switch-icon"
data-v-cfa76919=""
role="img"
>
<svg
class="material-design-icon__svg"
fill="currentColor"
height="36"
viewBox="0 0 24 24"
width="36"
>
<path
d="M17,7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7M17,15A3,3 0 0,1 14,12A3,3 0 0,1 17,9A3,3 0 0,1 20,12A3,3 0 0,1 17,15Z"
>
<!---->
</path>
</svg>
</span>
</span>
<span
class="checkbox-content__wrapper"
data-v-cfa76919=""
>
<span
class="checkbox-content__text checkbox-radio-switch__text"
data-v-cfa76919=""
id="mblaf"
>
Enable notifications for events via push
</span>
<!---->
</span>
</span>
</span>
</p>
</div>
</div>
`;

View file

@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later

View file

@ -9,10 +9,10 @@ import PQueue from 'p-queue'
import CloseSvg from '@mdi/svg/svg/close.svg?raw'
import NetworkOffSvg from '@mdi/svg/svg/network-off.svg?raw'
import TrashCanSvg from '@mdi/svg/svg/trash-can-outline.svg?raw'
import { TRASHBIN_VIEW_ID } from '../../../files_trashbin/src/files_views/trashbinView.ts'
import { askConfirmation, canDisconnectOnly, canUnshareOnly, deleteNode, displayName, shouldAskForConfirmation } from './deleteUtils.ts'
import logger from '../logger.ts'
import { t } from '@nextcloud/l10n'
const queue = new PQueue({ concurrency: 5 })
@ -110,4 +110,9 @@ export const action = new FileAction({
destructive: true,
order: 100,
hotkey: {
description: t('files', 'Delete'),
key: 'Delete',
},
})

View file

@ -116,4 +116,9 @@ export const action = new FileAction({
},
order: -50,
hotkey: {
description: t('files', 'Add or remove favorite'),
key: 'S',
},
})

View file

@ -47,4 +47,9 @@ export const action = new FileAction({
},
order: 10,
hotkey: {
description: t('files', 'Rename'),
key: 'F2',
},
})

View file

@ -66,11 +66,11 @@ const renderInline = async function(node: Node): Promise<HTMLElement> {
}
}
systemTagsElement.append(renderTag(tags[0]))
systemTagsElement.append(renderTag(tags[0]!))
if (tags.length === 2) {
// Special case only two tags:
// the overflow fake tag would take the same space as this, so render it
systemTagsElement.append(renderTag(tags[1]))
systemTagsElement.append(renderTag(tags[1]!))
} else if (tags.length > 1) {
// More tags than the one we're showing
// So we add a overflow element indicating there are more tags
@ -113,6 +113,10 @@ export const action = new FileAction({
renderInline,
order: 0,
hotkey: {
description: t('files', 'Manage tags'),
key: 'T',
},
})
// Update the system tags html when the node is updated