diff --git a/locales/index.d.ts b/locales/index.d.ts index af30a68f8b..e254f2e9f2 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -79,6 +79,9 @@ export interface Locale { "files": string; "download": string; "driveFileDeleteConfirm": string; + "driveFilesDeleteConfirm": string; + "driveFilesSensitiveonConfirm": string; + "driveFilesSensitiveoffConfirm": string; "driveFolderDeleteConfirm": string; "unfollowConfirm": string; "exportRequested": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9f51fa5505..c332fd9bf6 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -76,6 +76,9 @@ export: "エクスポート" files: "ファイル" download: "ダウンロード" driveFileDeleteConfirm: "ファイル「{name}」を削除しますか?このファイルを使用した一部のコンテンツも削除されます。" +driveFilesDeleteConfirm: "{name}つのファイルを削除しますか?このファイルを使用した一部のコンテンツも削除されます。" +driveFilesSensitiveonConfirm: "{name}つのファイルをセンシティブにしますか?" +driveFilesSensitiveoffConfirm: "{name}つのファイルのセンシティブを解除しますか?" driveFolderDeleteConfirm: "フォルダ「{name}」を削除しますか?このフォルダの中に存在するファイルを使用した一部のコンテンツも削除されます。" unfollowConfirm: "{name}のフォローを解除しますか?" exportRequested: "エクスポートをリクエストしました。これには時間がかかる場合があります。エクスポートが終わると、「ドライブ」に追加されます。" 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 07fa06fb0e..f13cdb61a8 100644 --- a/packages/frontend/src/components/MkDrive.folder.vue +++ b/packages/frontend/src/components/MkDrive.folder.vue @@ -18,7 +18,6 @@ SPDX-License-Identifier: AGPL-3.0-only @drop.prevent.stop="onDrop" @dragstart="onDragstart" @dragend="onDragend" - >
@@ -45,7 +44,7 @@ const props = withDefaults(defineProps<{
folder: Misskey.entities.DriveFolder;
isSelected?: boolean;
selectMode?: boolean;
- multipleselect?;
+ selectedFiles?: string[];
}>(), {
isSelected: false,
selectMode: false,
@@ -145,8 +144,8 @@ function onDrop(ev: DragEvent) {
if (driveFile != null && driveFile !== '') {
const file = JSON.parse(driveFile);
emit('removeFile', file.id);
- if (props.multipleselect.length > 0) {
- props.multipleselect.forEach((e)=>{
+ if (props.selectedFiles.length > 0) {
+ props.selectedFiles.forEach((e)=>{
os.api('drive/files/update', {
fileId: e.id,
folderId: props.folder.id,
@@ -158,9 +157,7 @@ function onDrop(ev: DragEvent) {
folderId: props.folder.id,
});
}
-
-
- }
+ }
//#endregion
//#region ドライブのフォルダ
@@ -234,120 +231,120 @@ function rename() {
}
function deleteFolder() {
- os.api('drive/folders/show', {
+ 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) => {
+ }).then(async (r) =>{
+ if (r.filesCount > 0) {
- if (r.foldersCount > 0) {
- await os.alert({
- type: 'error',
- title: i18n.ts.unableToDelete,
- text: 'フォルダ内にフォルダが存在するため、削除できません。 \n フォルダ内のフォルダを削除してから試してみてください。',
- });
- }
+ 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})
+ })
- 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); // pushをconcatに変更
+ os.api('drive/folders/delete', {
+ folderId: props.folder.id,
+ }).then(() => {
+ if (defaultStore.state.uploadFolder === props.folder.id) {
+ defaultStore.set('uploadFolder', null);
}
- allResults.forEach((r,i)=>{
- console.log(r)
- os.api('drive/files/delete',{fileId: r.id})
- })
+ }).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,
- }).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,
});
-
- 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,
- });
- }
- });
- }
- })
+ 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 d960d86209..f3c4374997 100644
--- a/packages/frontend/src/components/MkDrive.navFolder.vue
+++ b/packages/frontend/src/components/MkDrive.navFolder.vue
@@ -26,7 +26,7 @@ import { i18n } from '@/i18n.js';
const props = defineProps<{
folder?: Misskey.entities.DriveFolder;
parentFolder: Misskey.entities.DriveFolder | null;
- multipleselect?;
+ selectedFiles: string[];
}>();
const emit = defineEmits<{
@@ -113,22 +113,19 @@ function onDrop(ev: DragEvent) {
if (driveFile != null && driveFile !== '') {
const file = JSON.parse(driveFile);
emit('removeFile', file.id);
-
- if (props.multipleselect.length > 0) {
-
- props.multipleselect.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,
- });
- }
+ 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 55f76a968f..6d15142d3d 100644
--- a/packages/frontend/src/components/MkDrive.vue
+++ b/packages/frontend/src/components/MkDrive.vue
@@ -4,12 +4,13 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
-
{{ i18n.t('empty-drive-description') }}
{{ i18n.t('empty-drive-description') }}
+