From a6f0d273ef3742fbd74737d1c19141a9608a3282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 15:59:28 +0100 Subject: [PATCH 1/7] refactor: Remove unused PortaledQueue --- .../Toolbar/components/PortaledQueue.jsx | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/modules/drive/Toolbar/components/PortaledQueue.jsx diff --git a/src/modules/drive/Toolbar/components/PortaledQueue.jsx b/src/modules/drive/Toolbar/components/PortaledQueue.jsx deleted file mode 100644 index b82fb18e37..0000000000 --- a/src/modules/drive/Toolbar/components/PortaledQueue.jsx +++ /dev/null @@ -1,25 +0,0 @@ -import React, { Component } from 'react' -import ReactDOM from 'react-dom' - -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import { DumbUploadQueue as UploadQueue } from 'modules/upload/UploadQueue' - -class PortaledQueue extends Component { - render() { - const { file, doneCount, successCount, t, onClear } = this.props - - return ReactDOM.createPortal( - , - document.querySelector('[role=application]') - ) - } -} - -export default translate()(PortaledQueue) From 22ce30614ef2ff7b84a2eaaf2200e854219025d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 15:59:40 +0100 Subject: [PATCH 2/7] refactor: Remove unused UploadButtonItem --- src/locales/ar.json | 1 - src/locales/de.json | 1 - src/locales/en.json | 1 - src/locales/es.json | 1 - src/locales/fr.json | 1 - src/locales/it.json | 1 - src/locales/ja.json | 1 - src/locales/nl.json | 1 - src/locales/nl_NL.json | 1 - src/locales/pl.json | 1 - src/locales/ru.json | 1 - src/locales/zh_CN.json | 1 - src/locales/zh_TW.json | 1 - .../Toolbar/components/UploadButtonItem.jsx | 26 ------------------- src/styles/toolbar.styl | 16 ------------ 15 files changed, 55 deletions(-) delete mode 100644 src/modules/drive/Toolbar/components/UploadButtonItem.jsx diff --git a/src/locales/ar.json b/src/locales/ar.json index 9ae67cd32b..00c00a4df8 100644 --- a/src/locales/ar.json +++ b/src/locales/ar.json @@ -21,7 +21,6 @@ "more": "المزيد" }, "toolbar": { - "item_upload": "تحميل", "item_more": "المزيد", "menu_select": "تحديد العناصر", "menu_download_folder": "مُجلّد التنزيل", diff --git a/src/locales/de.json b/src/locales/de.json index 3ee5b7776a..8b56b332b2 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -33,7 +33,6 @@ "more": "Mehr" }, "toolbar": { - "item_upload": "Hochladen", "menu_upload": "Dateien hochladen", "item_more": "Mehr", "menu_new_folder": "Ordner", diff --git a/src/locales/en.json b/src/locales/en.json index 5c49ab3010..aa7f67a731 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -41,7 +41,6 @@ "more": "More" }, "toolbar": { - "item_upload": "Upload", "menu_upload": "Upload files", "item_more": "More", "menu_new_folder": "Folder", diff --git a/src/locales/es.json b/src/locales/es.json index b7dae07fb3..fb64417558 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -33,7 +33,6 @@ "more": "Más" }, "toolbar": { - "item_upload": "Subir", "menu_upload": "Cargar archivos", "item_more": "Más", "menu_new_folder": "Carpeta", diff --git a/src/locales/fr.json b/src/locales/fr.json index 59b5a9c861..fc1f460eaa 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -41,7 +41,6 @@ "more": "Plus" }, "toolbar": { - "item_upload": "Importer des fichiers", "menu_upload": "Importer des fichiers", "item_more": "Plus", "menu_new_folder": "Dossier", diff --git a/src/locales/it.json b/src/locales/it.json index 43edef1e1b..26944b7227 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -34,7 +34,6 @@ "more": "Altro" }, "toolbar": { - "item_upload": "Carica", "menu_upload": "Carica files", "item_more": "Altro", "menu_new_folder": "Cartella", diff --git a/src/locales/ja.json b/src/locales/ja.json index 7262522243..8b0a9e33c6 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -33,7 +33,6 @@ "more": "さらに" }, "toolbar": { - "item_upload": "アップロード", "item_more": "さらに", "menu_select": "アイテムを選択", "menu_share_folder": "フォルダーを共有", diff --git a/src/locales/nl.json b/src/locales/nl.json index b2542b8ac7..89ecdd8016 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -7,7 +7,6 @@ "title_trash": "Prullenbak" }, "toolbar": { - "item_upload": "Upload", "menu_select": "Selecteer items", "empty_trash": "Leeg de prullenbak" }, diff --git a/src/locales/nl_NL.json b/src/locales/nl_NL.json index e7124f6412..f8c6d297ff 100644 --- a/src/locales/nl_NL.json +++ b/src/locales/nl_NL.json @@ -34,7 +34,6 @@ "more": "Meer" }, "toolbar": { - "item_upload": "Uploaden", "menu_upload": "Bestanden uploaden", "item_more": "Meer", "menu_new_folder": "Map", diff --git a/src/locales/pl.json b/src/locales/pl.json index ae3036753e..21dfc84fa9 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -24,7 +24,6 @@ "more": "Więcej" }, "toolbar": { - "item_upload": "Prześlij", "item_more": "Więcej", "menu_select": "Wybierz elementy", "menu_download_folder": "Pobierz folder", diff --git a/src/locales/ru.json b/src/locales/ru.json index 310b5fc23f..c832aa095c 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -28,7 +28,6 @@ "more": "Еще" }, "toolbar": { - "item_upload": "Загрузить", "item_more": "Еще", "menu_select": "Выбранное", "menu_download_folder": "Скачать каталог", diff --git a/src/locales/zh_CN.json b/src/locales/zh_CN.json index a22a69eebd..29f061708a 100644 --- a/src/locales/zh_CN.json +++ b/src/locales/zh_CN.json @@ -28,7 +28,6 @@ "more": "更多" }, "toolbar": { - "item_upload": "上传", "menu_upload": "上传文件", "item_more": "更多", "menu_new_folder": "文件夹", diff --git a/src/locales/zh_TW.json b/src/locales/zh_TW.json index 4ab04fa3ac..f195925df5 100644 --- a/src/locales/zh_TW.json +++ b/src/locales/zh_TW.json @@ -26,7 +26,6 @@ "more": "更多" }, "toolbar": { - "item_upload": "上傳", "item_more": "更多", "menu_select": "選擇項目", "menu_download_folder": "下載資料夾", diff --git a/src/modules/drive/Toolbar/components/UploadButtonItem.jsx b/src/modules/drive/Toolbar/components/UploadButtonItem.jsx deleted file mode 100644 index 39b46ad093..0000000000 --- a/src/modules/drive/Toolbar/components/UploadButtonItem.jsx +++ /dev/null @@ -1,26 +0,0 @@ -import classNames from 'classnames' -import { useDisplayedFolder } from 'hooks' -import React from 'react' -import { compose } from 'redux' - -import { translate } from 'cozy-ui/transpiled/react/providers/I18n' - -import UploadButton from 'modules/upload/UploadButton' - -import styles from 'styles/toolbar.styl' - -const UploadButtonItem = ({ t, isDisabled, onUploaded }) => { - const { displayedFolder } = useDisplayedFolder() - - return ( - - ) -} - -export default compose(translate())(UploadButtonItem) diff --git a/src/styles/toolbar.styl b/src/styles/toolbar.styl index b745f8518d..9743ba2ec5 100644 --- a/src/styles/toolbar.styl +++ b/src/styles/toolbar.styl @@ -3,22 +3,6 @@ @require 'settings/z-index.styl' @require 'utilities/display.styl' -.c-btn - @extend $button - -.c-btn--regular - @extend $button--regular - -.c-btn--secondary - @extend $button--secondary - -.c-btn--danger - @extend $button--danger - -.c-btn--danger-outline - @extend $button--danger-outline - - .fil-toolbar-files .fil-toolbar-trash margin-left auto From a1032851b6d641d0bdb633a719a823dfe7a68ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 16:00:42 +0100 Subject: [PATCH 3/7] refactor: Remove unused ScrollToTop --- src/modules/navigation/ScrollToTop.jsx | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 src/modules/navigation/ScrollToTop.jsx diff --git a/src/modules/navigation/ScrollToTop.jsx b/src/modules/navigation/ScrollToTop.jsx deleted file mode 100644 index cf125e55e6..0000000000 --- a/src/modules/navigation/ScrollToTop.jsx +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' - -class ScrollToTop extends React.Component { - componentDidMount() { - window.scrollTo(0, 0) - } - - render() { - return null - } -} - -export default ScrollToTop From 04c52024b02ddb67e11feb0bf1c84a368e44b4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 16:02:48 +0100 Subject: [PATCH 4/7] refactor: Remove unused OpenInCozyButton --- src/locales/de.json | 1 - src/locales/en.json | 1 - src/locales/es.json | 1 - src/locales/fr.json | 1 - src/locales/it.json | 1 - src/locales/ja.json | 1 - src/locales/nl_NL.json | 1 - src/locales/ru.json | 1 - src/locales/zh_CN.json | 1 - src/locales/zh_TW.json | 1 - src/modules/public/OpenInCozyButton.jsx | 18 ------------------ 11 files changed, 28 deletions(-) delete mode 100644 src/modules/public/OpenInCozyButton.jsx diff --git a/src/locales/de.json b/src/locales/de.json index 8b56b332b2..2ebd5f78ad 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -44,7 +44,6 @@ "add_to_mine": "Meinem Cozy hinzufügen", "menu_download_folder": "Ordner herunterladen", "menu_download_file": "Diese Datei herunterladen", - "menu_open_cozy": "In meinem Cozy öffnen", "menu_create_note": "Notizen", "menu_create_shortcut": "Abkürzung", "empty_trash": "Papierkorb leeren", diff --git a/src/locales/en.json b/src/locales/en.json index aa7f67a731..ec878cfb49 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -52,7 +52,6 @@ "add_to_mine": "Add to my Cozy", "menu_download_folder": "Download folder", "menu_download_file": "Download this file", - "menu_open_cozy": "Open in my Cozy", "menu_create_note": "Note", "menu_create_shortcut": "Shortcut", "share": "Share", diff --git a/src/locales/es.json b/src/locales/es.json index fb64417558..47479250fb 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -43,7 +43,6 @@ "add_to_mine": "Añadir a mi Cozy", "menu_download_folder": "Descargar carpeta", "menu_download_file": "Descargar este archivo", - "menu_open_cozy": "Abrir en mi Cozy", "menu_create_note": "Nota", "empty_trash": "Vaciar la papelera", "share": "Compartir", diff --git a/src/locales/fr.json b/src/locales/fr.json index fc1f460eaa..1534e24ab1 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -52,7 +52,6 @@ "add_to_mine": "Ajouter à mon Cozy", "menu_download_folder": "Télécharger le dossier", "menu_download_file": "Télécharger ce fichier", - "menu_open_cozy": "Ouvrir dans mon Cozy", "menu_create_note": "Note", "menu_create_shortcut": "Raccourci", "share": "Partager", diff --git a/src/locales/it.json b/src/locales/it.json index 26944b7227..ef0202f62d 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -45,7 +45,6 @@ "add_to_mine": "Aggiungi al mio Cozy", "menu_download_folder": "Cartella download", "menu_download_file": "Scarica questo file", - "menu_open_cozy": "Apri nel mio Cozy", "menu_create_note": "Nota", "menu_create_shortcut": "Collegamento", "empty_trash": "Svuota cestino", diff --git a/src/locales/ja.json b/src/locales/ja.json index 8b0a9e33c6..f6fadafac0 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -38,7 +38,6 @@ "menu_share_folder": "フォルダーを共有", "menu_download_folder": "ダウンロードフォルダー", "menu_download_file": "このファイルをダウンロード", - "menu_open_cozy": "自分の Cozy で開く", "empty_trash": "ゴミ箱を空にする", "share": "共有", "trash": "削除", diff --git a/src/locales/nl_NL.json b/src/locales/nl_NL.json index f8c6d297ff..6a6b980631 100644 --- a/src/locales/nl_NL.json +++ b/src/locales/nl_NL.json @@ -45,7 +45,6 @@ "add_to_mine": "Toevoegen aan mijn Cozy", "menu_download_folder": "Map downloaden", "menu_download_file": "Download dit bestand", - "menu_open_cozy": "Openen in mijn Cozy", "menu_create_note": "Notitie", "menu_create_shortcut": "Snelkoppeling", "empty_trash": "Prullenbak legen", diff --git a/src/locales/ru.json b/src/locales/ru.json index c832aa095c..514ab2ac18 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -31,7 +31,6 @@ "item_more": "Еще", "menu_select": "Выбранное", "menu_download_folder": "Скачать каталог", - "menu_open_cozy": "Открыть в моем Cozy", "empty_trash": "Очистить корзину", "share": "Поделится", "trash": "Удалить", diff --git a/src/locales/zh_CN.json b/src/locales/zh_CN.json index 29f061708a..6903522059 100644 --- a/src/locales/zh_CN.json +++ b/src/locales/zh_CN.json @@ -39,7 +39,6 @@ "add_to_mine": "添加到我的 Cozy", "menu_download_folder": "下载文件夹", "menu_download_file": "下载这个文件", - "menu_open_cozy": "在我的Cozy中打开", "menu_create_note": "便签", "empty_trash": "清空垃圾桶", "share": "分享", diff --git a/src/locales/zh_TW.json b/src/locales/zh_TW.json index f195925df5..52cf4b0237 100644 --- a/src/locales/zh_TW.json +++ b/src/locales/zh_TW.json @@ -30,7 +30,6 @@ "menu_select": "選擇項目", "menu_download_folder": "下載資料夾", "menu_download_file": "下載這個檔案", - "menu_open_cozy": "在我的 Cozy 開啟", "empty_trash": "清空垃圾桶", "share": "分享", "trash": "移除", diff --git a/src/modules/public/OpenInCozyButton.jsx b/src/modules/public/OpenInCozyButton.jsx deleted file mode 100644 index c76871441a..0000000000 --- a/src/modules/public/OpenInCozyButton.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' - -import { ButtonLink } from 'cozy-ui/transpiled/react' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -const OpenInCozyButton = ({ size = 'normal', href = '' }) => { - const { t } = useI18n() - return ( - - ) -} - -export default OpenInCozyButton From f2818bf65acbab6a6ff4f6560bc9f169f800f290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 16:05:15 +0100 Subject: [PATCH 5/7] refactor: Remove unused UploaderComponent.styles --- .../views/Upload/UploaderComponent.styles.ts | 21 ------------------- 1 file changed, 21 deletions(-) delete mode 100644 src/modules/views/Upload/UploaderComponent.styles.ts diff --git a/src/modules/views/Upload/UploaderComponent.styles.ts b/src/modules/views/Upload/UploaderComponent.styles.ts deleted file mode 100644 index 873d725dc1..0000000000 --- a/src/modules/views/Upload/UploaderComponent.styles.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Theme } from '@material-ui/core' - -export const styles = (theme: Theme): Record => ({ - paper: { - height: '100%', - '& .MuiDialogContent-root': { - padding: '0' - }, - '& .MuiDialogTitle-root': { - padding: '0', - [theme.breakpoints.down('sm')]: { - width: '100%', - overflow: 'visible', - // back button - '& .MuiButtonBase-root': { - display: 'none' - } - } - } - } -}) From 68dcfe4aef8ef7b79786070399f85217838b802c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 16:07:50 +0100 Subject: [PATCH 6/7] refactor: Remove unused PublicNoteRedirectView --- .../views/Public/PublicNoteRedirectView.tsx | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 src/modules/views/Public/PublicNoteRedirectView.tsx diff --git a/src/modules/views/Public/PublicNoteRedirectView.tsx b/src/modules/views/Public/PublicNoteRedirectView.tsx deleted file mode 100644 index fac84e2662..0000000000 --- a/src/modules/views/Public/PublicNoteRedirectView.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import React, { FC, useEffect, useState } from 'react' -import { useParams } from 'react-router-dom' - -import { useClient } from 'cozy-client' -import { fetchURL } from 'cozy-client/dist/models/note' -import Empty from 'cozy-ui/transpiled/react/Empty' -import Sprite from 'cozy-ui/transpiled/react/Icon/Sprite' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -import EmptyIcon from 'assets/icons/icon-folder-broken.svg' -import { joinPath } from 'lib/path' - -const PublicNoteRedirectView: FC = () => { - const { t } = useI18n() - const { fileId } = useParams() - const client = useClient() - - const [noteUrl, setNoteUrl] = useState(null) - const [fetchStatus, setFetchStatus] = useState< - 'failed' | 'loading' | 'pending' | 'loaded' - >('pending') - - useEffect(() => { - const fetchNoteUrl = async (fileId: string): Promise => { - setFetchStatus('loading') - try { - const url = await fetchURL( - client, - { - id: fileId - }, - { - pathname: joinPath(location.pathname, '') - } - ) - setNoteUrl(url) - setFetchStatus('loaded') - } catch (error) { - setFetchStatus('failed') - } - } - - if (fileId) { - void fetchNoteUrl(fileId) - } - }, [fileId, client]) - - if (noteUrl) { - window.location.href = noteUrl - } - - return ( - <> - - {fetchStatus === 'failed' && ( - - )} - {fetchStatus !== 'failed' && ( - - )} - - ) -} - -export { PublicNoteRedirectView } From ca3052dd7b31445c1001095afcc19decd5832ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Tue, 14 Jan 2025 16:09:36 +0100 Subject: [PATCH 7/7] refactor: Remove unused ReadOnly --- .../views/OnlyOffice/Toolbar/ReadOnly.jsx | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/modules/views/OnlyOffice/Toolbar/ReadOnly.jsx diff --git a/src/modules/views/OnlyOffice/Toolbar/ReadOnly.jsx b/src/modules/views/OnlyOffice/Toolbar/ReadOnly.jsx deleted file mode 100644 index ced0a8ad6e..0000000000 --- a/src/modules/views/OnlyOffice/Toolbar/ReadOnly.jsx +++ /dev/null @@ -1,47 +0,0 @@ -import React from 'react' - -import Icon from 'cozy-ui/transpiled/react/Icon' -import LockIcon from 'cozy-ui/transpiled/react/Icons/Lock' -import Tooltip from 'cozy-ui/transpiled/react/Tooltip' -import Typography from 'cozy-ui/transpiled/react/Typography' -import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints' -import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' - -const ReadOnly = () => { - const { t } = useI18n() - const { isMobile } = useBreakpoints() - - if (isMobile) - return ( -
- -
- ) - - return ( - - - - - {t('OnlyOffice.readOnly.title')} - - - - ) -} - -export default ReadOnly