From 942030614f64976a29460e51b3f5615e7cfc3778 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Fri, 1 Jul 2022 12:33:46 +0300 Subject: [PATCH] Fix Bug 57840: add community forum and help center buttons --- .../public/locales/en/NavMenu.json | 4 ++- .../NavMenu/sub-components/header-nav.js | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/web/ASC.Web.Client/public/locales/en/NavMenu.json b/web/ASC.Web.Client/public/locales/en/NavMenu.json index 531a288fa1..16108c9c75 100644 --- a/web/ASC.Web.Client/public/locales/en/NavMenu.json +++ b/web/ASC.Web.Client/public/locales/en/NavMenu.json @@ -6,5 +6,7 @@ "RecoverDescribeYourProblemPlaceholder": "Describe your problem", "RecoverTextBody": "If you can't log in with your existing account or want to be registered as a new user, contact the portal administrator.", "RecoverTitle": "Access recovery", - "TurnOnDesktopVersion": "Turn on desktop version" + "TurnOnDesktopVersion": "Turn on desktop version", + "CommunityForum": "Community forum", + "HelpCenter": "Help center" } diff --git a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js index e39917ced8..8be3f377a7 100644 --- a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js +++ b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js @@ -26,6 +26,9 @@ const PROFILE_SELF_URL = combineUrl( "/products/people/view/@self" ); const PROFILE_MY_URL = combineUrl(PROXY_HOMEPAGE_URL, "/my"); +const COMMUNITY_URL = "https://forum.onlyoffice.com/c/personal/43"; +const HELP_URL = + "https://helpcenter.onlyoffice.com/userguides/workspace-personal.aspx"; const StyledNav = styled.nav` display: flex; @@ -101,6 +104,14 @@ const HeaderNav = ({ setHotkeyPanelVisible(true); }, []); + const onCommunityClick = useCallback(() => { + window.open(COMMUNITY_URL, "_blank"); + }, []); + + const onHelpClick = useCallback(() => { + window.open(HELP_URL, "_blank"); + }, []); + const onCloseDialog = () => setVisibleDialog(false); const onDebugClick = useCallback(() => { setVisibleDebugDialog(true); @@ -154,6 +165,21 @@ const HeaderNav = ({ } } + const communityForum = isPersonal + ? { + key: "CommunityBtn", + label: t("CommunityForum"), + onClick: onCommunityClick, + } + : null; + + const helpCenter = isPersonal + ? { + key: "HelpBtn", + label: t("HelpCenter"), + onClick: onHelpClick, + } + : null; const actions = [ { key: "ProfileBtn", @@ -172,6 +198,8 @@ const HeaderNav = ({ }), }, hotkeys, + communityForum, + helpCenter, { key: "AboutBtn", label: t("AboutCompanyTitle"),