diff --git a/locales/index.d.ts b/locales/index.d.ts
index 47e542d4e3..e254f2e9f2 100644
--- a/locales/index.d.ts
+++ b/locales/index.d.ts
@@ -79,6 +79,10 @@ export interface Locale {
"files": string;
"download": string;
"driveFileDeleteConfirm": string;
+ "driveFilesDeleteConfirm": string;
+ "driveFilesSensitiveonConfirm": string;
+ "driveFilesSensitiveoffConfirm": string;
+ "driveFolderDeleteConfirm": string;
"unfollowConfirm": string;
"exportRequested": string;
"importRequested": string;
diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index ed24aa9e85..c332fd9bf6 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -76,6 +76,10 @@ export: "エクスポート"
files: "ファイル"
download: "ダウンロード"
driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。"
+driveFilesDeleteConfirm: "{name}つのファイルを削除しますか?このファイルを使用した一部のコンテンツも削除されます。"
+driveFilesSensitiveonConfirm: "{name}つのファイルをセンシティブにしますか?"
+driveFilesSensitiveoffConfirm: "{name}つのファイルのセンシティブを解除しますか?"
+driveFolderDeleteConfirm: "フォルダ「{name}」を削除しますか?このフォルダの中に存在するファイルを使用した一部のコンテンツも削除されます。"
unfollowConfirm: "{name}のフォローを解除しますか?"
exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。"
importRequested: "インポートをリクエストしました。これには時間がかかる場合があります。"
diff --git a/package.json b/package.json
index af11e8e66e..0a7efa9f5e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "misskey",
- "version": "2023.9.3-prismisskey.2",
+ "version": "2023.9.3-prismisskey.3",
"codename": "nasubi",
"repository": {
"type": "git",
@@ -18,6 +18,7 @@
"build-assets": "node ./scripts/build-assets.mjs",
"build": "pnpm build-pre && pnpm -r build && pnpm build-assets",
"build-storybook": "pnpm --filter frontend build-storybook",
+ "build-and-start": "pnpm build && pnpm start",
"start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js",
"start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js",
"init": "pnpm migrate",
diff --git a/packages/frontend/src/components/MkDrive.folder.vue b/packages/frontend/src/components/MkDrive.folder.vue
index 5322664664..f13cdb61a8 100644
--- a/packages/frontend/src/components/MkDrive.folder.vue
+++ b/packages/frontend/src/components/MkDrive.folder.vue
@@ -44,6 +44,7 @@ const props = withDefaults(defineProps<{
folder: Misskey.entities.DriveFolder;
isSelected?: boolean;
selectMode?: boolean;
+ selectedFiles?: string[];
}>(), {
isSelected: false,
selectMode: false,
@@ -143,10 +144,19 @@ function onDrop(ev: DragEvent) {
if (driveFile != null && driveFile !== '') {
const file = JSON.parse(driveFile);
emit('removeFile', file.id);
- os.api('drive/files/update', {
- fileId: file.id,
- folderId: props.folder.id,
- });
+ if (props.selectedFiles.length > 0) {
+ props.selectedFiles.forEach((e)=>{
+ os.api('drive/files/update', {
+ fileId: e.id,
+ folderId: props.folder.id,
+ });
+ })
+ }else{
+ os.api('drive/files/update', {
+ fileId: file.id,
+ folderId: props.folder.id,
+ });
+ }
}
//#endregion
@@ -221,30 +231,120 @@ function rename() {
}
function deleteFolder() {
- os.api('drive/folders/delete', {
- folderId: props.folder.id,
- }).then(() => {
- if (defaultStore.state.uploadFolder === props.folder.id) {
- defaultStore.set('uploadFolder', null);
- }
- }).catch(err => {
- switch (err.id) {
- case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
- os.alert({
- type: 'error',
- title: i18n.ts.unableToDelete,
- text: i18n.ts.hasChildFilesOrFolders,
- });
- break;
- default:
- os.alert({
- type: 'error',
- text: i18n.ts.unableToDelete,
- });
- }
- });
+ os.api('drive/folders/show', {
+ folderId: props.folder.id,
+ }).then(async (r) => {
+
+ if (r.foldersCount > 0) {
+ await os.alert({
+ type: 'error',
+ title: i18n.ts.unableToDelete,
+ text: 'フォルダ内にフォルダが存在するため、削除できません。 \n フォルダ内のフォルダを削除してから試してみてください。',
+ });
+ }
+
+ if (r.filesCount > 0) {
+
+ const {canceled} = await os.confirm({
+ type: 'warning',
+ text: i18n.t('driveFolderDeleteConfirm', {name: props.folder.name}),
+ });
+
+ if (canceled) return;
+
+ let allResults = [];
+ let Result = await os.api('drive/files', {folderId: props.folder.id, limit: 31});
+ allResults = allResults.concat(Result)
+ while (Result.length >= 31) {
+ const untilId = Result[Result.length - 1].id;
+ Result = await os.api('drive/files', { folderId: props.folder.id, limit: 31, untilId });
+ allResults = allResults.concat(Result); // pushをconcatに変更
+ }
+ allResults.forEach((r,i)=>{
+ os.api('drive/files/delete',{fileId: r.id})
+ })
+
+
+ os.api('drive/folders/show', {
+ folderId: props.folder.id,
+ }).then(async (r) =>{
+ if (r.filesCount > 0) {
+
+ let allResults = [];
+ let Result = await os.api('drive/files', {folderId: props.folder.id, limit: 31});
+ allResults = allResults.concat(Result)
+ while (Result.length >= 31) {
+ const untilId = Result[Result.length - 1].id;
+ Result = await os.api('drive/files', { folderId: props.folder.id, limit: 31, untilId });
+ allResults = allResults.concat(Result);
+ }
+ allResults.forEach((r,i)=>{
+ os.api('drive/files/delete',{fileId: r.id})
+ })
+
+ os.api('drive/folders/delete', {
+ folderId: props.folder.id,
+ }).then(() => {
+ if (defaultStore.state.uploadFolder === props.folder.id) {
+ defaultStore.set('uploadFolder', null);
+ }
+ }).catch(err => {
+ switch (err.id) {
+ case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
+ os.alert({
+ type: 'error',
+ title: i18n.ts.unableToDelete,
+ text: i18n.ts.hasChildFilesOrFolders,
+ });
+ break;
+ default:
+ os.alert({
+ type: 'error',
+ text: i18n.ts.unableToDelete,
+ });
+ }
+ });
+
+ os.api('drive/folders/delete', {
+ folderId: props.folder.id,
+ })
+ }else{
+ os.api('drive/folders/delete', {
+ folderId: props.folder.id,
+ })
+ }
+ })
+
+ } else {
+
+ await os.api('drive/folders/delete', {
+ folderId: props.folder.id,
+ }).then(() => {
+ if (defaultStore.state.uploadFolder === props.folder.id) {
+ defaultStore.set('uploadFolder', null);
+ }
+ }).catch(err => {
+ switch (err.id) {
+ case 'b0fc8a17-963c-405d-bfbc-859a487295e1':
+ os.alert({
+ type: 'error',
+ title: i18n.ts.unableToDelete,
+ text: i18n.ts.hasChildFilesOrFolders,
+ });
+ break;
+ default:
+ os.alert({
+ type: 'error',
+ text: i18n.ts.unableToDelete,
+ });
+ }
+ });
+ }
+ })
+
}
+
function setAsUploadFolder() {
defaultStore.set('uploadFolder', props.folder.id);
}
diff --git a/packages/frontend/src/components/MkDrive.navFolder.vue b/packages/frontend/src/components/MkDrive.navFolder.vue
index 59458ad568..f3c4374997 100644
--- a/packages/frontend/src/components/MkDrive.navFolder.vue
+++ b/packages/frontend/src/components/MkDrive.navFolder.vue
@@ -26,6 +26,7 @@ import { i18n } from '@/i18n.js';
const props = defineProps<{
folder?: Misskey.entities.DriveFolder;
parentFolder: Misskey.entities.DriveFolder | null;
+ selectedFiles: string[];
}>();
const emit = defineEmits<{
@@ -112,10 +113,19 @@ function onDrop(ev: DragEvent) {
if (driveFile != null && driveFile !== '') {
const file = JSON.parse(driveFile);
emit('removeFile', file.id);
- os.api('drive/files/update', {
- fileId: file.id,
- folderId: props.folder ? props.folder.id : null,
- });
+ if (props.selectedFiles.length > 0) {
+ props.selectedFiles.forEach((e) => {
+ os.api('drive/files/update', {
+ fileId: e.id,
+ folderId: props.folder ? props.folder.id : null,
+ });
+ });
+ } else {
+ os.api('drive/files/update', {
+ fileId: file.id,
+ folderId: props.folder ? props.folder.id : null,
+ });
+ }
}
//#endregion
diff --git a/packages/frontend/src/components/MkDrive.vue b/packages/frontend/src/components/MkDrive.vue
index 648e4c4e3d..6d15142d3d 100644
--- a/packages/frontend/src/components/MkDrive.vue
+++ b/packages/frontend/src/components/MkDrive.vue
@@ -10,6 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only