From 45f909ef33056ac8f429d2a1707d1d7da96d2970 Mon Sep 17 00:00:00 2001 From: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:42:46 +0900 Subject: enhance(frontend): ドライブのファイル・フォルダをドラッグしなくても移動できるように (#14318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(drive): ファイルをフォルダに移動するメニューを実装 (cherry picked from commit b89c2af6945c6a9f9f10e83f54d2bcf0f240b0b4) * tweak ui * Update Changelog * ファイル詳細からも移動できるように * feat(drive) フォルダのネストを移動するメニューを実装 (cherry picked from commit 8a7d710c6acb83f50c83f050bd1423c764d60a99) * Update Changelog * Update Changelog * lint * tweak ui --------- Co-authored-by: nafu-at Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- packages/frontend/src/scripts/get-drive-file-menu.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'packages/frontend/src/scripts') diff --git a/packages/frontend/src/scripts/get-drive-file-menu.ts b/packages/frontend/src/scripts/get-drive-file-menu.ts index 7c6c4b4db4..108648d640 100644 --- a/packages/frontend/src/scripts/get-drive-file-menu.ts +++ b/packages/frontend/src/scripts/get-drive-file-menu.ts @@ -41,6 +41,15 @@ function describe(file: Misskey.entities.DriveFile) { }); } +function move(file: Misskey.entities.DriveFile) { + os.selectDriveFolder(false).then(folder => { + misskeyApi('drive/files/update', { + fileId: file.id, + folderId: folder[0] ? folder[0].id : null, + }); + }); +} + function toggleSensitive(file: Misskey.entities.DriveFile) { misskeyApi('drive/files/update', { fileId: file.id, @@ -88,6 +97,10 @@ export function getDriveFileMenu(file: Misskey.entities.DriveFile, folder?: Miss text: i18n.ts.rename, icon: 'ti ti-forms', action: () => rename(file), + }, { + text: i18n.ts.move, + icon: 'ti ti-folder-symlink', + action: () => move(file), }, { text: file.isSensitive ? i18n.ts.unmarkAsSensitive : i18n.ts.markAsSensitive, icon: file.isSensitive ? 'ti ti-eye' : 'ti ti-eye-exclamation', -- cgit v1.2.3-freya