From c03f302fa67afbe781cf08e6508a204b59ca1270 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Jun 2021 11:24:29 +0200 Subject: [PATCH] Added option to open links in the same tab for apps/bookamrs/search separately --- client/.env | 2 +- .../src/components/Apps/AppCard/AppCard.tsx | 2 +- .../Bookmarks/BookmarkCard/BookmarkCard.tsx | 2 +- .../Settings/OtherSettings/OtherSettings.tsx | 41 +++++++++++++++---- client/src/interfaces/Forms.ts | 4 +- client/src/utility/searchParser.ts | 2 +- utils/initialConfig.json | 10 ++++- 7 files changed, 50 insertions(+), 13 deletions(-) diff --git a/client/.env b/client/.env index 6079712..18588d5 100644 --- a/client/.env +++ b/client/.env @@ -1 +1 @@ -REACT_APP_VERSION=1.5.1 \ No newline at end of file +REACT_APP_VERSION=1.5.2 \ No newline at end of file diff --git a/client/src/components/Apps/AppCard/AppCard.tsx b/client/src/components/Apps/AppCard/AppCard.tsx index 79e09fe..43d7b72 100644 --- a/client/src/components/Apps/AppCard/AppCard.tsx +++ b/client/src/components/Apps/AppCard/AppCard.tsx @@ -16,7 +16,7 @@ const AppCard = (props: ComponentProps): JSX.Element => { return ( diff --git a/client/src/components/Bookmarks/BookmarkCard/BookmarkCard.tsx b/client/src/components/Bookmarks/BookmarkCard/BookmarkCard.tsx index b0536d9..f2535b5 100644 --- a/client/src/components/Bookmarks/BookmarkCard/BookmarkCard.tsx +++ b/client/src/components/Bookmarks/BookmarkCard/BookmarkCard.tsx @@ -19,7 +19,7 @@ const BookmarkCard = (props: ComponentProps): JSX.Element => { return ( {bookmark.icon && ( diff --git a/client/src/components/Settings/OtherSettings/OtherSettings.tsx b/client/src/components/Settings/OtherSettings/OtherSettings.tsx index 329b068..e3f3aef 100644 --- a/client/src/components/Settings/OtherSettings/OtherSettings.tsx +++ b/client/src/components/Settings/OtherSettings/OtherSettings.tsx @@ -36,7 +36,9 @@ const OtherSettings = (props: ComponentProps): JSX.Element => { hideCategories: 0, hideSearch: 0, useOrdering: 'createdAt', - openSameTab: 0 + appsSameTab: 0, + bookmarksSameTab: 0, + searchSameTab: 0 }) // Get config @@ -50,7 +52,9 @@ const OtherSettings = (props: ComponentProps): JSX.Element => { hideCategories: searchConfig('hideCategories', 0), hideSearch: searchConfig('hideSearch', 0), useOrdering: searchConfig('useOrdering', 'createdAt'), - openSameTab: searchConfig('openSameTab', 0) + appsSameTab: searchConfig('appsSameTab', 0), + bookmarksSameTab: searchConfig('bookmarksSameTab', 0), + searchSameTab: searchConfig('searchSameTab', 0) }) }, [props.loading]); @@ -139,18 +143,41 @@ const OtherSettings = (props: ComponentProps): JSX.Element => { - + + + + + + + + + - {/* MODULES OPTIONS */}

Modules

diff --git a/client/src/interfaces/Forms.ts b/client/src/interfaces/Forms.ts index b5e58ee..bba2d72 100644 --- a/client/src/interfaces/Forms.ts +++ b/client/src/interfaces/Forms.ts @@ -14,5 +14,7 @@ export interface SettingsForm { hideCategories: number; hideSearch: number; useOrdering: string; - openSameTab: number; + appsSameTab: number; + bookmarksSameTab: number; + searchSameTab: number; } \ No newline at end of file diff --git a/client/src/utility/searchParser.ts b/client/src/utility/searchParser.ts index 6cba533..1f1037a 100644 --- a/client/src/utility/searchParser.ts +++ b/client/src/utility/searchParser.ts @@ -11,7 +11,7 @@ export const searchParser = (searchQuery: string): boolean => { const query = queries.find((q: Query) => q.prefix === prefix); if (query) { - const sameTab = searchConfig('openSameTab', false); + const sameTab = searchConfig('searchSameTab', false); if (sameTab) { document.location.replace(`${query.template}${search}`); diff --git a/utils/initialConfig.json b/utils/initialConfig.json index fe68dfe..c4a76cb 100644 --- a/utils/initialConfig.json +++ b/utils/initialConfig.json @@ -37,7 +37,15 @@ "value": "createdAt" }, { - "key": "openSameTab", + "key": "appsSameTab", + "value": false + }, + { + "key": "bookmarksSameTab", + "value": false + }, + { + "key": "searchSameTab", "value": false }, {