From fbda39866a27a3790e081459b6134b42b74943ff Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Fri, 16 Aug 2024 12:59:35 +0300 Subject: [PATCH] Client: PortalSettings: WhiteLabel: fix show about --- .../categories/common/Branding/whitelabel.js | 162 ++++++++++-------- 1 file changed, 86 insertions(+), 76 deletions(-) diff --git a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js index 056e5150a7..c54f301bb5 100644 --- a/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js +++ b/packages/client/src/pages/PortalSettings/categories/common/Branding/whitelabel.js @@ -77,6 +77,7 @@ const WhiteLabel = (props) => { isWhitelableLoaded, isCustomizationAvailable, + isEnterprise, } = props; const navigate = useNavigate(); const location = useLocation(); @@ -86,6 +87,7 @@ const WhiteLabel = (props) => { const [isEmpty, setIsEmpty] = useState(isWhitelableLoaded && !logoText); const isMobileView = deviceType === DeviceType.mobile; + const showAbout = isManagement() && isCustomizationAvailable && isEnterprise; const init = async () => { const isWhiteLabelPage = standalone @@ -173,6 +175,7 @@ const WhiteLabel = (props) => { ); if (options.isEditor && !isCustomizationAvailable) continue; + if (!showAbout && logoUrlsWhiteLabel[i].name === "AboutPage") continue; const isDocsEditorName = logoUrlsWhiteLabel[i].name === "DocsEditor"; @@ -448,39 +451,42 @@ const WhiteLabel = (props) => { -
- - {t("LogoAbout")} ({logoUrlsWhiteLabel[6].size.width}x - {logoUrlsWhiteLabel[6].size.height}) - -
- - -
-
- + {showAbout && ( + <> +
+ + {t("LogoAbout")} ({logoUrlsWhiteLabel[6].size.width}x + {logoUrlsWhiteLabel[6].size.height}) + +
+ + +
+
+ + )}
{ ); }; -export default inject(({ settingsStore, common, currentQuotaStore }) => { - const { - setLogoText, - whiteLabelLogoText, - getWhiteLabelLogoText, - restoreWhiteLabelSettings, - initSettings, - saveWhiteLabelSettings, - logoUrlsWhiteLabel, - setLogoUrlsWhiteLabel, - defaultLogoTextWhiteLabel, - enableRestoreButton, - resetIsInit, - isWhitelableLoaded, - } = common; +export default inject( + ({ settingsStore, common, currentQuotaStore, currentTariffStatusStore }) => { + const { + setLogoText, + whiteLabelLogoText, + getWhiteLabelLogoText, + restoreWhiteLabelSettings, + initSettings, + saveWhiteLabelSettings, + logoUrlsWhiteLabel, + setLogoUrlsWhiteLabel, + defaultLogoTextWhiteLabel, + enableRestoreButton, + resetIsInit, + isWhitelableLoaded, + } = common; - const { - whiteLabelLogoUrls: defaultWhiteLabelLogoUrls, - deviceType, - standalone, - } = settingsStore; - const { isBrandingAndCustomizationAvailable, isCustomizationAvailable } = - currentQuotaStore; + const { + whiteLabelLogoUrls: defaultWhiteLabelLogoUrls, + deviceType, + standalone, + } = settingsStore; + const { isBrandingAndCustomizationAvailable, isCustomizationAvailable } = + currentQuotaStore; + const { isEnterprise } = currentTariffStatusStore; - return { - setLogoText, - theme: settingsStore.theme, - logoText: whiteLabelLogoText, - getWhiteLabelLogoText, - saveWhiteLabelSettings, - restoreWhiteLabelSettings, - defaultWhiteLabelLogoUrls, - isSettingPaid: isBrandingAndCustomizationAvailable, - initSettings, - logoUrlsWhiteLabel, - setLogoUrlsWhiteLabel, - defaultLogoTextWhiteLabel, - enableRestoreButton, + return { + setLogoText, + theme: settingsStore.theme, + logoText: whiteLabelLogoText, + getWhiteLabelLogoText, + saveWhiteLabelSettings, + restoreWhiteLabelSettings, + defaultWhiteLabelLogoUrls, + isSettingPaid: isBrandingAndCustomizationAvailable, + initSettings, + logoUrlsWhiteLabel, + setLogoUrlsWhiteLabel, + defaultLogoTextWhiteLabel, + enableRestoreButton, - deviceType, - resetIsInit, - standalone, + deviceType, + resetIsInit, + standalone, - isWhitelableLoaded, - isCustomizationAvailable, - }; -})(withTranslation(["Settings", "Profile", "Common"])(observer(WhiteLabel))); + isWhitelableLoaded, + isCustomizationAvailable, + isEnterprise, + }; + }, +)(withTranslation(["Settings", "Profile", "Common"])(observer(WhiteLabel)));