Skip to content

Commit

Permalink
Feat 155 custom app name (#155)
Browse files Browse the repository at this point in the history
* fix: app name and html title

* fix: change how to determine platform name

* feat: platform name for html title, no defaults
  • Loading branch information
timrbula authored Jun 30, 2022
1 parent bfd23e7 commit 8d9a746
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/ApiServer/fixtures/platformConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/Features/Actions/Actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ function Actions() {
<Switch>
<Route exact path={AppPath.ActionsApprovals}>
<Helmet>
<title>Actions - Approvals</title>
<title>Approvals - Actions</title>
</Helmet>
</Route>
<Route exact path={AppPath.ActionsManual}>
<Helmet>
<title>Actions - Manual Tasks</title>
<title>Manual - Actions</title>
</Helmet>
</Route>
<Redirect exact from={AppPath.Actions} to={AppPath.ActionsApprovals} />
Expand Down
21 changes: 17 additions & 4 deletions src/Features/App/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 (
<>
Expand All @@ -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;
}
2 changes: 2 additions & 0 deletions src/Types/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d9a746

Please sign in to comment.