From 757a4759f8e32b6a163faea71b57e3a4d39bdc6b Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Wed, 15 May 2024 16:48:19 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Small=20fixes=20and=20improvements?= =?UTF-8?q?=20(#522)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tdrive/frontend/public/locales/en.json | 1 - tdrive/frontend/public/locales/fr.json | 1 - tdrive/frontend/public/locales/ru.json | 1 - tdrive/frontend/public/locales/vn.json | 1 - .../frontend/src/app/features/auth/auth-service.ts | 6 +++++- .../src/app/views/client/body/drive/header-path.tsx | 6 +++--- .../src/app/views/client/body/drive/shared.tsx | 2 +- .../frontend/src/app/views/client/common/search.tsx | 13 ------------- 8 files changed, 9 insertions(+), 22 deletions(-) diff --git a/tdrive/frontend/public/locales/en.json b/tdrive/frontend/public/locales/en.json index f30bdc84..12e28e67 100644 --- a/tdrive/frontend/public/locales/en.json +++ b/tdrive/frontend/public/locales/en.json @@ -163,7 +163,6 @@ "components.searchpopup.no_results_for": "There were no results for", "components.searchpopup.try_new_search": "Try a new search", "components.searchpopup.recent_files": "Recent files", - "components.searchpopup.soon": "This feature is coming soon \uD83D\uDE80", "components.userlistmanager.no_users": "No users.", "components.notifications.hidden_notifications_button.children": "New messages", "scenes.app.popup.adduserfromtdriveconsole.current_users_state": "{{$1}} email(s) will be added", diff --git a/tdrive/frontend/public/locales/fr.json b/tdrive/frontend/public/locales/fr.json index dde4b2a5..16c42c4d 100644 --- a/tdrive/frontend/public/locales/fr.json +++ b/tdrive/frontend/public/locales/fr.json @@ -279,7 +279,6 @@ "components.side_menu.home": "Disque partagé", "components.side_menu.shared_with_me": "Partagé avec moi", "components.side_menu.my_drive": "Mon disque", - "components.searchpopup.soon": "Cette fonctionnalité arrive bientôt 🚀", "components.side_menu.buttons.upload": "Télécharger", "components.side_menu.buttons.create": "Créer", "components.side_menu.buttons.empty_trash": "Vider la corbeille", diff --git a/tdrive/frontend/public/locales/ru.json b/tdrive/frontend/public/locales/ru.json index 3ac3e760..17b1ce1c 100644 --- a/tdrive/frontend/public/locales/ru.json +++ b/tdrive/frontend/public/locales/ru.json @@ -272,7 +272,6 @@ "components.searchpopup.try_new_search": "Искать еще раз", "components.searchpopup.recent_files": "Последние файлы", "components.searchpopup.header_title": "Поиск", - "components.searchpopup.soon": "Эта функциональность будет доступна скоро \uD83D\uDE80", "components.searchpopup.start_search": "Введите ключевые слова, чтобы начать поиск.", "scenes.apps.account.on_console": "Чтобы изменить глобальные настройки учетной записи, нажмите «Перейти к консоли».", "general.user.deactivated": "Пользователь больше не состоит в этой компании", diff --git a/tdrive/frontend/public/locales/vn.json b/tdrive/frontend/public/locales/vn.json index b4a66500..4d3f4f93 100644 --- a/tdrive/frontend/public/locales/vn.json +++ b/tdrive/frontend/public/locales/vn.json @@ -158,7 +158,6 @@ "components.searchpopup.no_results_for": "Không có kết quả nào cho", "components.searchpopup.try_new_search": "Thử tìm kiếm mới", "components.searchpopup.recent_files": "Các tệp gần đây", - "components.searchpopup.soon": "Tính năng này sẽ sớm ra mắt \uD83D\uDE80", "components.userlistmanager.no_users": "Không có người dùng.", "components.notifications.hidden_notifications_button.children": "Tin nhắn mới", "scenes.app.popup.adduserfromtdriveconsole.current_users_state": "{{$1}} email(s) sẽ được thêm", diff --git a/tdrive/frontend/src/app/features/auth/auth-service.ts b/tdrive/frontend/src/app/features/auth/auth-service.ts index 18bcead4..03ca3401 100644 --- a/tdrive/frontend/src/app/features/auth/auth-service.ts +++ b/tdrive/frontend/src/app/features/auth/auth-service.ts @@ -132,7 +132,11 @@ class AuthService { if (token) { this.logger.info("Save auth token to storage and cookie") JWT.updateJWT(token); - this.cookies.set(AuthService.AUTH_TOKEN_COOKIE, JWT.getJWT(), { path: "/" }); + this.cookies.set(AuthService.AUTH_TOKEN_COOKIE, JWT.getJWT(), { + path: '/', + secure: true, + sameSite: 'none', + }); // TODO: Update the user from API? // this.updateUser(); } else { 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 8ea5e1da..a7408a83 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 @@ -163,9 +163,9 @@ const PathItem = ({ MenusManager.openMenu(trashMenuItems, { x: evt.clientX, y: evt.clientY }, 'center'); } else { if (viewId === 'root') { - onClick('root', '') + onClick('root', ''); } else if (viewId === 'user_' + user?.id) { - onClick('user_' + user?.id, '') + onClick('user_' + user?.id, ''); } } } else { @@ -173,7 +173,7 @@ const PathItem = ({ } }} > - + <Title noColor={last} className={last ? 'text-blue-500' : ''}> {(() => { const isTrash = viewId?.includes('trash_') || viewId === 'trash'; const fileName = cutFileName(item?.name) || ''; diff --git a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx index 0246cdd8..79876a9e 100755 --- a/tdrive/frontend/src/app/views/client/body/drive/shared.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/shared.tsx @@ -80,7 +80,7 @@ export default () => { </a> </div> </div> - <div className="h-full main-view public p-4"> + <div className="h-full main-view public p-4 pb-16"> <AccessChecker folderId={documentId} token={token}> <Drive initialParentId={documentId} inPublicSharing /> </AccessChecker> diff --git a/tdrive/frontend/src/app/views/client/common/search.tsx b/tdrive/frontend/src/app/views/client/common/search.tsx index 4370c2d9..c1e5c303 100644 --- a/tdrive/frontend/src/app/views/client/common/search.tsx +++ b/tdrive/frontend/src/app/views/client/common/search.tsx @@ -31,19 +31,6 @@ export default (): JSX.Element => { prefix={() => ( <SearchIcon className={'h-5 w-5 absolute m-auto top-0 bottom-0 left-3 text-blue-500'} /> )} - suffix={() => ( - <Button - theme="white" - size="sm" - className={ - 'rounded-full h-7 w-7 absolute m-auto top-0 bottom-0 right-3 text-zinc-500' - } - icon={() => <AdjustmentsIcon className="w-5 h-5 text-zinc-500" />} - onClick={() => { - ToasterService.info(Languages.t('components.searchpopup.soon')); - }} - /> - )} input={({ className }) => ( <Input value={searchState.query}