From 47fb9bde63078ee2c9923ebb40ce1501443e5c01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 06:44:05 +0000 Subject: [PATCH 01/14] chore(deps): bump minimatch and recursive-readdir Bumps [minimatch](https://github.com/isaacs/minimatch) and [recursive-readdir](https://github.com/jergason/recursive-readdir). These dependencies needed to be updated together. Updates `minimatch` from 3.0.4 to 3.1.2 - [Release notes](https://github.com/isaacs/minimatch/releases) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2) Updates `recursive-readdir` from 2.2.2 to 2.2.3 - [Release notes](https://github.com/jergason/recursive-readdir/releases) - [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md) - [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect - dependency-name: recursive-readdir dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e51f99..cd011ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15489,27 +15489,15 @@ } }, "node_modules/recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", - "dev": true, - "dependencies": { - "minimatch": "3.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/recursive-readdir/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "minimatch": "^3.0.5" }, "engines": { - "node": "*" + "node": ">=6.0.0" } }, "node_modules/redent": { @@ -29644,23 +29632,12 @@ } }, "recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, "requires": { - "minimatch": "3.0.4" - }, - "dependencies": { - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } + "minimatch": "^3.0.5" } }, "redent": { From eafdce387785f5b42806e846e6b9b7c31aea71de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 06:40:27 +0000 Subject: [PATCH 02/14] chore(deps): bump loader-utils from 2.0.2 to 2.0.3 Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.3. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.3/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.3) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7e5287a..2e51f99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12455,9 +12455,9 @@ } }, "node_modules/loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz", + "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==", "dev": true, "dependencies": { "big.js": "^5.2.2", @@ -27590,9 +27590,9 @@ "dev": true }, "loader-utils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz", - "integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.3.tgz", + "integrity": "sha512-THWqIsn8QRnvLl0shHYVBN9syumU8pYWEHPTmkiVGd+7K5eFNVSY6AJhRvgGF70gg1Dz+l/k8WicvFCxdEs60A==", "dev": true, "requires": { "big.js": "^5.2.2", From 3b6aacd15da18ced548322ce0749de9e6f653506 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 06:44:05 +0000 Subject: [PATCH 03/14] chore(deps): bump minimatch and recursive-readdir Bumps [minimatch](https://github.com/isaacs/minimatch) and [recursive-readdir](https://github.com/jergason/recursive-readdir). These dependencies needed to be updated together. Updates `minimatch` from 3.0.4 to 3.1.2 - [Release notes](https://github.com/isaacs/minimatch/releases) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2) Updates `recursive-readdir` from 2.2.2 to 2.2.3 - [Release notes](https://github.com/jergason/recursive-readdir/releases) - [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md) - [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect - dependency-name: recursive-readdir dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 41 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e51f99..cd011ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15489,27 +15489,15 @@ } }, "node_modules/recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", - "dev": true, - "dependencies": { - "minimatch": "3.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/recursive-readdir/node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "minimatch": "^3.0.5" }, "engines": { - "node": "*" + "node": ">=6.0.0" } }, "node_modules/redent": { @@ -29644,23 +29632,12 @@ } }, "recursive-readdir": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", - "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", "dev": true, "requires": { - "minimatch": "3.0.4" - }, - "dependencies": { - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } + "minimatch": "^3.0.5" } }, "redent": { From 38ade64036c43d6abef84fb78736a0b39752231e Mon Sep 17 00:00:00 2001 From: minpeter Date: Fri, 11 Nov 2022 02:25:47 +0900 Subject: [PATCH 04/14] =?UTF-8?q?lastModifed=20=ED=95=84=EB=93=9C=EB=AA=85?= =?UTF-8?q?=20uploadDate=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- src/components/common/FileListBox/index.tsx | 8 ++++---- src/pages/download/index.tsx | 4 ++-- src/pages/filelist/index.tsx | 8 ++++---- src/state/reducers/DownloadFileProps.ts | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.env b/.env index 8d35330..14d549b 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ PUBLIC_URL=/tempfiles-frontend REACT_APP_BACKEND_BASEURL=http://localhost:5000 # dev - http://localhost:5000 -# main - https://tfb.minpeter.cf \ No newline at end of file +# main - https://tfb.minpeter.cf diff --git a/src/components/common/FileListBox/index.tsx b/src/components/common/FileListBox/index.tsx index 21e3624..3368ff3 100644 --- a/src/components/common/FileListBox/index.tsx +++ b/src/components/common/FileListBox/index.tsx @@ -6,7 +6,7 @@ import * as S from './styled'; type FileListBoxProps = { filename: string; size: string; - LastModified: any; + uploadDate: any; isEncrypted: boolean; click: () => void; }; @@ -14,13 +14,13 @@ type FileListBoxProps = { export const FileListBox: React.FC = ({ filename, size, - LastModified, + uploadDate, isEncrypted, click, }) => ( {isEncrypted ? : <>} - 파일이름: {filename} / 크기:{size} / 업로드날짜:{LastModified.year}-{LastModified.month}- - {LastModified.day} + 파일이름: {filename} / 크기:{size} / 업로드날짜:{uploadDate.year}-{uploadDate.month}- + {uploadDate.day} ); diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index 96eaef1..2cad98d 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -12,13 +12,13 @@ import * as S from './styled'; export const DownloadPage: React.FC = () => { const navigate = useNavigate(); const downloadFileProps: any = useSelector((state: RootState) => state.DownloadFileProps); - const { year, month, day } = getDate(downloadFileProps.lastModified); + const { year, month, day } = getDate(downloadFileProps.uploadDate); const [move] = useDeletePageNavigator(downloadFileProps.filename, downloadFileProps.token); useEffect(() => { if ( downloadFileProps.filename === null || downloadFileProps.size === null || - downloadFileProps.lastModified === null + downloadFileProps.uploadDate === null ) { navigate('/'); } diff --git a/src/pages/filelist/index.tsx b/src/pages/filelist/index.tsx index 2071454..e8b9a90 100644 --- a/src/pages/filelist/index.tsx +++ b/src/pages/filelist/index.tsx @@ -48,21 +48,21 @@ export const FileListPage: React.FC = () => { key={index} filename={getShortFileName(item.filename)} size={getFileSize(item.size)} - LastModified={getDate(item.lastModified)} + uploadDate={getDate(item.uploadDate)} isEncrypted={item.isEncrypted} click={() => { if (item.isEncrypted) { SetCheckPasswordFileProps({ filename: item.filename, size: getFileSize(item.size), - lastModified: item.lastModified, + uploadDate: item.uploadDate, }); navigate('/checkpw'); } else { SetDownloadFileProps({ filename: item.filename, size: getFileSize(item.size), - lastModified: item.lastModified, + uploadDate: item.uploadDate, token: null, }); navigate('/download'); @@ -70,7 +70,7 @@ export const FileListPage: React.FC = () => { // SetDownloadFileProps({ // Name: item.filename, // Size: item.size, - // LastModified: item.lastModified, + // uploadDate: item.uploadDate, // //passowrd 유무 추가예정 // }); }} diff --git a/src/state/reducers/DownloadFileProps.ts b/src/state/reducers/DownloadFileProps.ts index 4790f0f..94cbfee 100644 --- a/src/state/reducers/DownloadFileProps.ts +++ b/src/state/reducers/DownloadFileProps.ts @@ -2,7 +2,7 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, size: null, lastModified: null, token: null, donwload_url: null }, + state: any = { filename: null, size: null, uploadDate: null, token: null, donwload_url: null }, action: Action, ): any => { switch (action.type) { From 0de3e12bff71f226b329ec6bcf67b470a9e56b1d Mon Sep 17 00:00:00 2001 From: minpeter Date: Fri, 11 Nov 2022 02:38:28 +0900 Subject: [PATCH 05/14] =?UTF-8?q?lastModifed=20=ED=95=84=EB=93=9C=EB=AA=85?= =?UTF-8?q?=20uploadDate=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FileListBox/index.tsx | 8 ++++---- src/pages/download/index.tsx | 4 ++-- src/pages/filelist/index.tsx | 8 ++++---- src/state/reducers/DownloadFileProps.ts | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/common/FileListBox/index.tsx b/src/components/common/FileListBox/index.tsx index 21e3624..3368ff3 100644 --- a/src/components/common/FileListBox/index.tsx +++ b/src/components/common/FileListBox/index.tsx @@ -6,7 +6,7 @@ import * as S from './styled'; type FileListBoxProps = { filename: string; size: string; - LastModified: any; + uploadDate: any; isEncrypted: boolean; click: () => void; }; @@ -14,13 +14,13 @@ type FileListBoxProps = { export const FileListBox: React.FC = ({ filename, size, - LastModified, + uploadDate, isEncrypted, click, }) => ( {isEncrypted ? : <>} - 파일이름: {filename} / 크기:{size} / 업로드날짜:{LastModified.year}-{LastModified.month}- - {LastModified.day} + 파일이름: {filename} / 크기:{size} / 업로드날짜:{uploadDate.year}-{uploadDate.month}- + {uploadDate.day} ); diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index 96eaef1..2cad98d 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -12,13 +12,13 @@ import * as S from './styled'; export const DownloadPage: React.FC = () => { const navigate = useNavigate(); const downloadFileProps: any = useSelector((state: RootState) => state.DownloadFileProps); - const { year, month, day } = getDate(downloadFileProps.lastModified); + const { year, month, day } = getDate(downloadFileProps.uploadDate); const [move] = useDeletePageNavigator(downloadFileProps.filename, downloadFileProps.token); useEffect(() => { if ( downloadFileProps.filename === null || downloadFileProps.size === null || - downloadFileProps.lastModified === null + downloadFileProps.uploadDate === null ) { navigate('/'); } diff --git a/src/pages/filelist/index.tsx b/src/pages/filelist/index.tsx index 2071454..e8b9a90 100644 --- a/src/pages/filelist/index.tsx +++ b/src/pages/filelist/index.tsx @@ -48,21 +48,21 @@ export const FileListPage: React.FC = () => { key={index} filename={getShortFileName(item.filename)} size={getFileSize(item.size)} - LastModified={getDate(item.lastModified)} + uploadDate={getDate(item.uploadDate)} isEncrypted={item.isEncrypted} click={() => { if (item.isEncrypted) { SetCheckPasswordFileProps({ filename: item.filename, size: getFileSize(item.size), - lastModified: item.lastModified, + uploadDate: item.uploadDate, }); navigate('/checkpw'); } else { SetDownloadFileProps({ filename: item.filename, size: getFileSize(item.size), - lastModified: item.lastModified, + uploadDate: item.uploadDate, token: null, }); navigate('/download'); @@ -70,7 +70,7 @@ export const FileListPage: React.FC = () => { // SetDownloadFileProps({ // Name: item.filename, // Size: item.size, - // LastModified: item.lastModified, + // uploadDate: item.uploadDate, // //passowrd 유무 추가예정 // }); }} diff --git a/src/state/reducers/DownloadFileProps.ts b/src/state/reducers/DownloadFileProps.ts index 4790f0f..94cbfee 100644 --- a/src/state/reducers/DownloadFileProps.ts +++ b/src/state/reducers/DownloadFileProps.ts @@ -2,7 +2,7 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, size: null, lastModified: null, token: null, donwload_url: null }, + state: any = { filename: null, size: null, uploadDate: null, token: null, donwload_url: null }, action: Action, ): any => { switch (action.type) { From 5191e0a0a7f584f1ab988dea668b6702e5f0209d Mon Sep 17 00:00:00 2001 From: minpeter Date: Fri, 11 Nov 2022 02:39:15 +0900 Subject: [PATCH 06/14] =?UTF-8?q?=EB=AD=94=EC=A7=80=20=EB=AA=A8=EB=A5=BC?= =?UTF-8?q?=20=EB=B3=80=EB=8F=99=EC=82=AC=ED=95=AD=20=EC=B7=A8=EC=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 +- package-lock.json | 41 ++++++++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 14d549b..8d35330 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ PUBLIC_URL=/tempfiles-frontend REACT_APP_BACKEND_BASEURL=http://localhost:5000 # dev - http://localhost:5000 -# main - https://tfb.minpeter.cf +# main - https://tfb.minpeter.cf \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cd011ae..2e51f99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15489,15 +15489,27 @@ } }, "node_modules/recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", "dev": true, "dependencies": { - "minimatch": "^3.0.5" + "minimatch": "3.0.4" }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" + } + }, + "node_modules/recursive-readdir/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, "node_modules/redent": { @@ -29632,12 +29644,23 @@ } }, "recursive-readdir": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", - "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.2.tgz", + "integrity": "sha512-nRCcW9Sj7NuZwa2XvH9co8NPeXUBhZP7CRKJtU+cS6PW9FpCIFoI5ib0NT1ZrbNuPoRy0ylyCaUL8Gih4LSyFg==", "dev": true, "requires": { - "minimatch": "^3.0.5" + "minimatch": "3.0.4" + }, + "dependencies": { + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + } } }, "redent": { From 470c22825d5509a7db9ab386ade817844dd4a56f Mon Sep 17 00:00:00 2001 From: minpeter Date: Fri, 11 Nov 2022 02:56:53 +0900 Subject: [PATCH 07/14] =?UTF-8?q?delete=5Furl=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useDeletePageNavigate.ts | 4 ++-- src/pages/checkpw/index.tsx | 6 +++--- src/pages/delete/index.tsx | 2 +- src/pages/download/index.tsx | 6 +++++- src/pages/main/index.tsx | 6 ++++-- src/state/reducers/CheckPasswordFileProps.ts | 2 +- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/hooks/useDeletePageNavigate.ts b/src/hooks/useDeletePageNavigate.ts index 8f178aa..9e4c6a9 100644 --- a/src/hooks/useDeletePageNavigate.ts +++ b/src/hooks/useDeletePageNavigate.ts @@ -4,12 +4,12 @@ import { bindActionCreators } from 'redux'; import { actionCreators } from '../state'; -export const useDeletePageNavigator = (filename: string, token: string) => { +export const useDeletePageNavigator = (filename: string, delete_url: string, token: string) => { const navigate = useNavigate(); const dispatch = useDispatch(); const { SetDeleteFileProps } = bindActionCreators(actionCreators, dispatch); const move = () => { - SetDeleteFileProps({ filename: filename, token: token }); + SetDeleteFileProps({ filename: filename, delete_url: delete_url, token: token }); navigate('/delete'); }; return [move]; diff --git a/src/pages/checkpw/index.tsx b/src/pages/checkpw/index.tsx index 3247333..b5225ec 100644 --- a/src/pages/checkpw/index.tsx +++ b/src/pages/checkpw/index.tsx @@ -15,7 +15,7 @@ import * as S from './styled'; export const CheckPasswordPage: React.FC = () => { const checkPasswordFileProps = useSelector((state: RootState) => state.CheckPasswordFileProps); const [password, setPassword] = useState(''); - const { year, month, day } = getDate(checkPasswordFileProps.lastModified); + const { year, month, day } = getDate(checkPasswordFileProps.uploadDate); const dispatch = useDispatch(); const { SetDownloadFileProps } = bindActionCreators(actionCreators, dispatch); @@ -36,7 +36,7 @@ export const CheckPasswordPage: React.FC = () => { SetDownloadFileProps({ filename: checkPasswordFileProps.filename, size: checkPasswordFileProps.size, - lastModified: checkPasswordFileProps.lastModified, + uploadDate: checkPasswordFileProps.uploadDate, token: res.data.token, }); navigate('/download'); @@ -58,7 +58,7 @@ export const CheckPasswordPage: React.FC = () => { if ( checkPasswordFileProps.filename === null || checkPasswordFileProps.size === null || - checkPasswordFileProps.lastModified === null + checkPasswordFileProps.uploadDate === null ) { navigate('/'); } diff --git a/src/pages/delete/index.tsx b/src/pages/delete/index.tsx index 8b5d30c..89b25f3 100644 --- a/src/pages/delete/index.tsx +++ b/src/pages/delete/index.tsx @@ -20,7 +20,7 @@ export const DeletePage: React.FC = () => { const deleteFile = async () => { await axios({ method: 'delete', - url: `${process.env.REACT_APP_BACKEND_BASEURL}/del/${DeleteFileProps.filename}${ + url: `${DeleteFileProps.delete_url}${ DeleteFileProps.token != null ? `?token=${DeleteFileProps.token}` : '' }`, }) diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index 2cad98d..4ce51bd 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -13,7 +13,11 @@ export const DownloadPage: React.FC = () => { const navigate = useNavigate(); const downloadFileProps: any = useSelector((state: RootState) => state.DownloadFileProps); const { year, month, day } = getDate(downloadFileProps.uploadDate); - const [move] = useDeletePageNavigator(downloadFileProps.filename, downloadFileProps.token); + const [move] = useDeletePageNavigator( + downloadFileProps.filename, + downloadFileProps.delete_url, + downloadFileProps.token, + ); useEffect(() => { if ( downloadFileProps.filename === null || diff --git a/src/pages/main/index.tsx b/src/pages/main/index.tsx index 2431571..2e21bd3 100644 --- a/src/pages/main/index.tsx +++ b/src/pages/main/index.tsx @@ -72,18 +72,20 @@ export const MainPage: React.FC = () => { SetDownloadFileProps({ filename: res.data.filename, size: getFileSize(res.data.size), - lastModified: res.data.lastModified, + uploadDate: res.data.uploadDate, token: res.data.token, download_url: res.data.download_url, + delete_url: res.data.delete_url, //추후에 기한,다운로드횟수 추가예정 }); } else { SetDownloadFileProps({ filename: res.data.filename, size: getFileSize(res.data.size), - lastModified: res.data.lastModified, + uploadDate: res.data.uploadDate, token: null, download_url: res.data.download_url, + delete_url: res.data.delete_url, //추후에 기한,다운로드횟수 추가예정 }); } diff --git a/src/state/reducers/CheckPasswordFileProps.ts b/src/state/reducers/CheckPasswordFileProps.ts index 687646d..38d0907 100644 --- a/src/state/reducers/CheckPasswordFileProps.ts +++ b/src/state/reducers/CheckPasswordFileProps.ts @@ -2,7 +2,7 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, size: null, lastModified: null }, + state: any = { filename: null, size: null, uploadDate: null }, action: Action, ): any => { switch (action.type) { From 4ef18b4366ac7968cd7daf406096b9cca84c0613 Mon Sep 17 00:00:00 2001 From: minpeter Date: Fri, 11 Nov 2022 03:15:30 +0900 Subject: [PATCH 08/14] =?UTF-8?q?=EC=83=88=EB=A1=9C=EC=9A=B4=20list=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/FileListBox/index.tsx | 6 ++++-- src/pages/checkpw/index.tsx | 11 +++-------- src/pages/filelist/index.tsx | 13 +++---------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/components/common/FileListBox/index.tsx b/src/components/common/FileListBox/index.tsx index 3368ff3..96f08a0 100644 --- a/src/components/common/FileListBox/index.tsx +++ b/src/components/common/FileListBox/index.tsx @@ -5,6 +5,7 @@ import * as S from './styled'; type FileListBoxProps = { filename: string; + fileId: string; size: string; uploadDate: any; isEncrypted: boolean; @@ -13,6 +14,7 @@ type FileListBoxProps = { export const FileListBox: React.FC = ({ filename, + fileId, size, uploadDate, isEncrypted, @@ -20,7 +22,7 @@ export const FileListBox: React.FC = ({ }) => ( {isEncrypted ? : <>} - 파일이름: {filename} / 크기:{size} / 업로드날짜:{uploadDate.year}-{uploadDate.month}- - {uploadDate.day} + ID: {fileId} / 파일이름: {filename} / 크기:{size} / 업로드날짜:{uploadDate.year}- + {uploadDate.month}-{uploadDate.day} ); diff --git a/src/pages/checkpw/index.tsx b/src/pages/checkpw/index.tsx index b5225ec..a4c41b3 100644 --- a/src/pages/checkpw/index.tsx +++ b/src/pages/checkpw/index.tsx @@ -30,13 +30,12 @@ export const CheckPasswordPage: React.FC = () => { } else { await axios({ method: 'get', - url: `${process.env.REACT_APP_BACKEND_BASEURL}/checkpw/${checkPasswordFileProps.filename}?pw=${password}`, + url: `${process.env.REACT_APP_BACKEND_BASEURL}/checkpw/${checkPasswordFileProps.fileId}/${checkPasswordFileProps.filename}?pw=${password}`, }) .then((res) => { SetDownloadFileProps({ filename: checkPasswordFileProps.filename, - size: checkPasswordFileProps.size, - uploadDate: checkPasswordFileProps.uploadDate, + fileId: checkPasswordFileProps.fileId, token: res.data.token, }); navigate('/download'); @@ -55,11 +54,7 @@ export const CheckPasswordPage: React.FC = () => { } }; useEffect(() => { - if ( - checkPasswordFileProps.filename === null || - checkPasswordFileProps.size === null || - checkPasswordFileProps.uploadDate === null - ) { + if (checkPasswordFileProps.filename === null || checkPasswordFileProps.fileId === null) { navigate('/'); } }); diff --git a/src/pages/filelist/index.tsx b/src/pages/filelist/index.tsx index e8b9a90..a00cbdc 100644 --- a/src/pages/filelist/index.tsx +++ b/src/pages/filelist/index.tsx @@ -47,6 +47,7 @@ export const FileListPage: React.FC = () => { { if (item.isEncrypted) { SetCheckPasswordFileProps({ filename: item.filename, - size: getFileSize(item.size), - uploadDate: item.uploadDate, + fileId: item.fileId, }); navigate('/checkpw'); } else { SetDownloadFileProps({ filename: item.filename, - size: getFileSize(item.size), - uploadDate: item.uploadDate, + fileId: item.fileId, token: null, }); navigate('/download'); } - // SetDownloadFileProps({ - // Name: item.filename, - // Size: item.size, - // uploadDate: item.uploadDate, - // //passowrd 유무 추가예정 - // }); }} /> ))} From 3f52c0d35cdcd79b036f221619e4a7dc09b29c6b Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 11 Nov 2022 18:33:21 +0900 Subject: [PATCH 09/14] =?UTF-8?q?fix:=20redux,delete=20=EA=B5=AC=EC=A1=B0?= =?UTF-8?q?=EA=B0=80=20=EB=B3=80=EA=B2=BD=EB=90=A8=EC=97=90=20=EB=94=B0?= =?UTF-8?q?=EB=9D=BC=20=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useDeletePageNavigate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useDeletePageNavigate.ts b/src/hooks/useDeletePageNavigate.ts index 9e4c6a9..60d028d 100644 --- a/src/hooks/useDeletePageNavigate.ts +++ b/src/hooks/useDeletePageNavigate.ts @@ -4,12 +4,12 @@ import { bindActionCreators } from 'redux'; import { actionCreators } from '../state'; -export const useDeletePageNavigator = (filename: string, delete_url: string, token: string) => { +export const useDeletePageNavigator = (delete_url: string, isEncrypted: boolean, token: string) => { const navigate = useNavigate(); const dispatch = useDispatch(); const { SetDeleteFileProps } = bindActionCreators(actionCreators, dispatch); const move = () => { - SetDeleteFileProps({ filename: filename, delete_url: delete_url, token: token }); + SetDeleteFileProps({ delete_url: delete_url, isEncrypted: isEncrypted, token: token }); navigate('/delete'); }; return [move]; From edbf96d29936fd91a347592bfbbf7de3ce6972d5 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 11 Nov 2022 18:34:24 +0900 Subject: [PATCH 10/14] =?UTF-8?q?fix:=20=ED=8E=98=EC=9D=B4=EC=A7=80=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EA=B0=92=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/state/reducers/CheckPasswordFileProps.ts | 2 +- src/state/reducers/DeleteFileProps.ts | 2 +- src/state/reducers/DownloadFileProps.ts | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/state/reducers/CheckPasswordFileProps.ts b/src/state/reducers/CheckPasswordFileProps.ts index 38d0907..2dbcc61 100644 --- a/src/state/reducers/CheckPasswordFileProps.ts +++ b/src/state/reducers/CheckPasswordFileProps.ts @@ -2,7 +2,7 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, size: null, uploadDate: null }, + state: any = { filename: null, fileId: null, size: null, uploadDate: null, isEncrypted: null }, action: Action, ): any => { switch (action.type) { diff --git a/src/state/reducers/DeleteFileProps.ts b/src/state/reducers/DeleteFileProps.ts index d1a5ed1..8185c79 100644 --- a/src/state/reducers/DeleteFileProps.ts +++ b/src/state/reducers/DeleteFileProps.ts @@ -2,7 +2,7 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, token: null, delete_url: null }, + state: any = { token: null, delete_url: null, isEncrypted: null }, action: Action, ): any => { switch (action.type) { diff --git a/src/state/reducers/DownloadFileProps.ts b/src/state/reducers/DownloadFileProps.ts index 94cbfee..1c67db0 100644 --- a/src/state/reducers/DownloadFileProps.ts +++ b/src/state/reducers/DownloadFileProps.ts @@ -2,7 +2,12 @@ import { ActionType } from '../action-types'; import { Action } from '../actions'; const reducer = ( - state: any = { filename: null, size: null, uploadDate: null, token: null, donwload_url: null }, + state: any = { + filename: null, + fileId: null, + token: null, + isEncrypted: null, + }, action: Action, ): any => { switch (action.type) { From 511408e93dc078f6921ebc2ec496c7e295d71727 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 11 Nov 2022 18:34:50 +0900 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20=EC=A0=84=EC=B2=B4=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/checkpw/index.tsx | 1 + src/pages/delete/index.tsx | 2 +- src/pages/download/index.tsx | 68 +++++++++++++++++++++++++++--------- src/pages/filelist/index.tsx | 7 ++-- src/pages/main/index.tsx | 28 ++++----------- 5 files changed, 66 insertions(+), 40 deletions(-) diff --git a/src/pages/checkpw/index.tsx b/src/pages/checkpw/index.tsx index a4c41b3..5046b3a 100644 --- a/src/pages/checkpw/index.tsx +++ b/src/pages/checkpw/index.tsx @@ -36,6 +36,7 @@ export const CheckPasswordPage: React.FC = () => { SetDownloadFileProps({ filename: checkPasswordFileProps.filename, fileId: checkPasswordFileProps.fileId, + isEncrypted: checkPasswordFileProps.isEncrypted, token: res.data.token, }); navigate('/download'); diff --git a/src/pages/delete/index.tsx b/src/pages/delete/index.tsx index 89b25f3..52b0c72 100644 --- a/src/pages/delete/index.tsx +++ b/src/pages/delete/index.tsx @@ -21,7 +21,7 @@ export const DeletePage: React.FC = () => { await axios({ method: 'delete', url: `${DeleteFileProps.delete_url}${ - DeleteFileProps.token != null ? `?token=${DeleteFileProps.token}` : '' + DeleteFileProps.isEncrypted ? `?token=${DeleteFileProps.token}` : '' }`, }) .then(() => { diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index 4ce51bd..b3b51a6 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -1,4 +1,5 @@ -import React, { useEffect } from 'react'; +import axios from 'axios'; +import React, { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import { toast } from 'react-toastify'; @@ -6,44 +7,79 @@ import { toast } from 'react-toastify'; import { Button, FileBox } from '../../components'; import { useDeletePageNavigator } from '../../hooks'; import { RootState } from '../../state/reducers'; -import { getDate } from '../../utils'; +import { getDate, getFileSize } from '../../utils'; import * as S from './styled'; export const DownloadPage: React.FC = () => { const navigate = useNavigate(); const downloadFileProps: any = useSelector((state: RootState) => state.DownloadFileProps); - const { year, month, day } = getDate(downloadFileProps.uploadDate); + const [fileProps, setFileProps] = useState({ + filename: '', + // fileId: '', + size: '', + uploadDate: { year: 0, month: 0, day: 0 }, + download_url: '', + delete_url: '', + isEncrypted: false, + }); const [move] = useDeletePageNavigator( - downloadFileProps.filename, - downloadFileProps.delete_url, + fileProps.delete_url, + fileProps.isEncrypted, downloadFileProps.token, ); + + //https://github.com/facebook/react/issues/14920 useEffect(() => { - if ( - downloadFileProps.filename === null || - downloadFileProps.size === null || - downloadFileProps.uploadDate === null - ) { + const getFileProps = async () => { + await axios({ + method: 'get', + url: `${process.env.REACT_APP_BACKEND_BASEURL}/file/${downloadFileProps.fileId}/${ + downloadFileProps.filename + }${downloadFileProps.isEncrypted ? `?token=${downloadFileProps.token}` : ''}`, + }) + .then((res) => { + setFileProps({ + filename: res.data.filename, + // fileId: res.data.fileId, + size: getFileSize(res.data.size), + uploadDate: getDate(res.data.uploadDate), + download_url: res.data.download_url, + delete_url: res.data.delete_url, + isEncrypted: res.data.isEncrypted, + }); + }) + .catch((err) => { + navigate(-1); + console.log(err); + }); + }; + if (downloadFileProps.filename != null || downloadFileProps.fileId != null) { + getFileProps(); + } else { navigate('/'); } - }, [navigate, downloadFileProps]); + }, [downloadFileProps, navigate]); return ( - 파일이름:{downloadFileProps.filename} / 크기:{downloadFileProps.size} / 업로드된 날짜: - {year}-{month}-{day} + 파일이름:{fileProps.filename} / 크기:{fileProps.size} / 업로드된 날짜: + {fileProps.uploadDate.year}-{fileProps.uploadDate.month}-{fileProps.uploadDate.day}