diff --git a/tdrive/frontend/public/locales/en.json b/tdrive/frontend/public/locales/en.json index 2ec357bc..5853ab0e 100644 --- a/tdrive/frontend/public/locales/en.json +++ b/tdrive/frontend/public/locales/en.json @@ -267,6 +267,7 @@ "components.side_menu.buttons.empty_trash": "Empty trash", "components.header_path.shared_trash": "Shared Trash", "components.header_path.my_trash": "My Trash", + "components.header_path.shared_with_me": "Shared with me", "scenes.app.drive.nothing": "Nothing here.", "scenes.app.drive.drag_and_drop": "Drag and drop files to upload them or click on the 'Add document' button.", "scenes.app.drive.add_doc": "Add document or folder", diff --git a/tdrive/frontend/public/locales/fr.json b/tdrive/frontend/public/locales/fr.json index 94cef709..2552b4bf 100644 --- a/tdrive/frontend/public/locales/fr.json +++ b/tdrive/frontend/public/locales/fr.json @@ -266,7 +266,8 @@ "components.side_menu.buttons.create": "Créer", "components.side_menu.buttons.empty_trash": "Vider la corbeille", "components.header_path.shared_trash": "Corbeille partagée", - "components.header_path.my_trash": "Ma corbeille", + "components.header_path.my_trash": "Ma corbeille", + "components.header_path.shared_with_me": "Partagé avec moi", "scenes.app.drive.nothing": "Rien ici.", "scenes.app.drive.drag_and_drop": "Faites glisser et déposez des fichiers pour les télécharger ou cliquez sur le bouton 'Ajouter un document'.", "scenes.app.drive.add_doc": "Ajouter un document ou un dossier", diff --git a/tdrive/frontend/public/locales/ru.json b/tdrive/frontend/public/locales/ru.json index 9378b8e8..e91f0de4 100644 --- a/tdrive/frontend/public/locales/ru.json +++ b/tdrive/frontend/public/locales/ru.json @@ -267,6 +267,7 @@ "components.side_menu.buttons.empty_trash": "Очистить козину", "components.header_path.shared_trash": "Корзина \"Общего диска\"", "components.header_path.my_trash": "Корзина \"Моего диска\"", + "components.header_path.shared_with_me": "Поделено со мной", "scenes.app.drive.nothing": "Здесь ничего нет.", "scenes.app.drive.drag_and_drop": "Перенесите сюда файлы чтобы загрузить их или нажмите кнопку \"Добавить файл\"", "scenes.app.drive.add_doc": "Добавить файл или папку", diff --git a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx index 7ba1afaf..0cbb3a07 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx @@ -128,12 +128,14 @@ const PathItem = ({ const { user } = useCurrentUser(); const { viewId } = RouterServices.getStateFromRoute(); const { access: trashAccess } = useDriveItem('trash'); + const isInSharedWithMe = viewId === "shared_with_me"; return (
{ + evt.preventDefault(); const driveMenuItems = [ { type: 'menu', @@ -160,6 +162,10 @@ const PathItem = ({ hide: trashAccess === 'read', }, ]; + if (first && isInSharedWithMe) { + onClick(viewId || '', ''); + return; + } if (first && user?.id) { if (viewId?.includes('trash')) { @@ -173,18 +179,30 @@ const PathItem = ({ }} > - {viewId?.includes('trash_') && first && Languages.t('components.header_path.my_trash')} - {viewId === 'trash' && first && Languages.t('components.header_path.shared_trash')} - {(viewId === 'trash' || viewId?.includes('trash_')) && - !first && - (cutFileName(item?.name) || '')} - {!viewId?.includes('trash') && (cutFileName(item?.name) || '')} + {(() => { + const isTrash = viewId?.includes('trash_') || viewId === 'trash'; + const fileName = cutFileName(item?.name) || ''; + + if (first) { + if (isTrash) { + return viewId?.includes('trash_') + ? Languages.t('components.header_path.my_trash') + : Languages.t('components.header_path.shared_trash'); + } else { + return isInSharedWithMe + ? Languages.t('components.header_path.shared_with_me') + : fileName; + } + } else { + return isTrash ? fileName : fileName; + } + })()} {item?.access_info?.public?.level && item?.access_info?.public?.level !== 'none' && ( )} - {first && !!user?.id && ( + {first && !!user?.id && viewId != "shared_with_me" && (