From 8d9a74644021193dc1f8bb1a55e628c52acfc5f5 Mon Sep 17 00:00:00 2001 From: Tim Bula Date: Thu, 30 Jun 2022 17:40:54 -0500 Subject: [PATCH] Feat 155 custom app name (#155) * fix: app name and html title * fix: change how to determine platform name * feat: platform name for html title, no defaults --- src/ApiServer/fixtures/platformConfig.js | 3 ++- src/Features/Actions/Actions.tsx | 4 ++-- src/Features/App/Navbar/Navbar.tsx | 21 +++++++++++++++++---- src/Types/index.tsx | 2 ++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/ApiServer/fixtures/platformConfig.js b/src/ApiServer/fixtures/platformConfig.js index 3c2801b2e..a6d21da74 100644 --- a/src/ApiServer/fixtures/platformConfig.js +++ b/src/ApiServer/fixtures/platformConfig.js @@ -3,7 +3,8 @@ const platformNavigation = { version: "7.1.0", name: "Boomerang Core", signOutUrl: "https://launch.boomerangplatform.net/oauth/sign_out?rd=/oauth/sign_out", - platformName: "Essentials@IBM", + platformName: "Boomerang", + appName: "Flow", displayLogo: false, privateTeams: false, sendMail: true, diff --git a/src/Features/Actions/Actions.tsx b/src/Features/Actions/Actions.tsx index baa4ca1dd..d7d83c2d9 100644 --- a/src/Features/Actions/Actions.tsx +++ b/src/Features/Actions/Actions.tsx @@ -304,12 +304,12 @@ function Actions() { - Actions - Approvals + Approvals - Actions - Actions - Manual Tasks + Manual - Actions diff --git a/src/Features/App/Navbar/Navbar.tsx b/src/Features/App/Navbar/Navbar.tsx index acacc8dcd..fba5dd8d8 100644 --- a/src/Features/App/Navbar/Navbar.tsx +++ b/src/Features/App/Navbar/Navbar.tsx @@ -16,7 +16,6 @@ import { navigationIcons } from "Utils/navigationIcons"; import { FlowData16 } from "@carbon/icons-react"; const ACTIVE_CLASS_NAME = "bx--side-nav__link--current"; -const BOOMERANG_FALLBACK = "Boomerang"; function isInternalLink(navUrl: string) { return navUrl.includes(APP_ROOT); @@ -101,9 +100,12 @@ export default function Navbar({ }: NavbarProps) { const defaultUIShellProps = { baseServiceUrl: "", - renderLogo: true, }; - const appTitle = `${BOOMERANG_FALLBACK} Flow`; + + const { platform } = platformConfigData; + const appTitle = getAppTitle(platform); + const appName = platform.appName; + const platformName = platform.platformName; return ( <> @@ -112,13 +114,24 @@ export default function Navbar({ {...defaultUIShellProps} isFlowApp renderFlowDocs - appName="Flow" + appName={appName} headerConfig={platformConfigData} onMenuClick={handleOnMenuClick(flowNavigationData)} onTutorialClick={handleOnTutorialClick} + platformName={platformName} skipToContentProps={skipToContentProps} user={userData} /> ); } + +function getAppTitle(platformData: PlatformConfig["platform"]) { + let appTitle = platformData.platformName; + + if (platformData.appName) { + appTitle = `${platformData.appName} - ${platformData.platformName}`; + } + + return appTitle; +} diff --git a/src/Types/index.tsx b/src/Types/index.tsx index 7b9c5ab12..a4005fcae 100644 --- a/src/Types/index.tsx +++ b/src/Types/index.tsx @@ -556,11 +556,13 @@ export interface PlatformConfig { }; navigation: Array<{ name: string; url: string }>; platform: { + appName?: string; baseEnvUrl?: string; baseServicesUrl?: string; communityUrl?: string; displayLogo: boolean; name: string; + platformName: string; privateTeams: boolean; sendMail: boolean; signOutUrl: string;