From bf6f643a8cd58fd50eaf222a5849ffecffb6fdca Mon Sep 17 00:00:00 2001 From: Robb Hamilton Date: Fri, 5 Apr 2019 10:26:42 -0400 Subject: [PATCH] Cleanup up branding so there is consistency among the product name * standardize product names to include "Red Hat" and reduce the number of places product name is declared * remove product name from the about modal as it is redundant with the logo above * remove orphaned props from about modal --- frontend/public/branding.ts | 17 ---------- frontend/public/components/about-modal.jsx | 6 ++-- frontend/public/components/app.jsx | 4 +-- frontend/public/components/masthead.jsx | 24 +++++-------- frontend/public/index.html | 16 ++++----- frontend/public/tokener.html | 39 ---------------------- 6 files changed, 21 insertions(+), 85 deletions(-) delete mode 100644 frontend/public/branding.ts diff --git a/frontend/public/branding.ts b/frontend/public/branding.ts deleted file mode 100644 index 1e31d4303ae..00000000000 --- a/frontend/public/branding.ts +++ /dev/null @@ -1,17 +0,0 @@ -const getProductName = () => { - switch ((window as any).SERVER_FLAGS.branding) { - case 'openshift': - return 'OpenShift'; - case 'ocp': - return 'OpenShift Container Platform'; - case 'online': - return 'OpenShift Online'; - case 'dedicated': - return 'OpenShift Dedicated'; - case 'azure': - return 'Azure Red Hat OpenShift'; - default: - return 'OKD'; - } -}; -export const productName = getProductName(); diff --git a/frontend/public/components/about-modal.jsx b/frontend/public/components/about-modal.jsx index 8d10eeee09b..981dfb9804a 100644 --- a/frontend/public/components/about-modal.jsx +++ b/frontend/public/components/about-modal.jsx @@ -34,11 +34,9 @@ class AboutModal_ extends React.Component {

OpenShift is Red Hat's container application platform that allows developers to quickly develop, host, and scale applications in a cloud environment.

diff --git a/frontend/public/components/app.jsx b/frontend/public/components/app.jsx index 8fbb782f0f5..043818c8cde 100644 --- a/frontend/public/components/app.jsx +++ b/frontend/public/components/app.jsx @@ -7,12 +7,11 @@ import { Redirect, Route, Router, Switch } from 'react-router-dom'; import * as PropTypes from 'prop-types'; import store from '../redux'; -import { productName } from '../branding'; import { ALL_NAMESPACES_KEY } from '../const'; import { connectToFlags, featureActions, flagPending, FLAGS } from '../features'; import { analyticsSvc } from '../module/analytics'; import { GlobalNotifications } from './global-notifications'; -import { Masthead } from './masthead'; +import { getBrandingDetails, Masthead } from './masthead'; import { NamespaceBar } from './namespace'; import { Navigation } from './nav'; import { SearchPage } from './search'; @@ -162,6 +161,7 @@ class App extends React.PureComponent { render() { const { isNavOpen } = this.state; + const { productName } = getBrandingDetails(); return ( diff --git a/frontend/public/components/masthead.jsx b/frontend/public/components/masthead.jsx index 8416cbfdd5b..b729af60147 100644 --- a/frontend/public/components/masthead.jsx +++ b/frontend/public/components/masthead.jsx @@ -12,40 +12,34 @@ import dedicatedLogoImg from '../imgs/openshift-dedicated-logo.svg'; import azureLogoImg from '../imgs/azure-red-hat-openshift-logo.svg'; export const getBrandingDetails = () => { - let logoImg, logoAlt, productTitle; + let logoImg, productName; // Webpack won't bundle these images if we don't directly reference them, hence the switch switch (window.SERVER_FLAGS.branding) { case 'openshift': logoImg = openshiftLogoImg; - logoAlt = 'OpenShift'; - productTitle = 'Red Hat OpenShift'; + productName = 'Red Hat OpenShift'; break; case 'ocp': logoImg = ocpLogoImg; - logoAlt = 'OpenShift Container Platform'; - productTitle = 'Red Hat OpenShift Container Platform'; + productName = 'Red Hat OpenShift Container Platform'; break; case 'online': logoImg = onlineLogoImg; - logoAlt = 'OpenShift Online'; - productTitle = 'Red Hat OpenShift Online'; + productName = 'Red Hat OpenShift Online'; break; case 'dedicated': logoImg = dedicatedLogoImg; - logoAlt = 'OpenShift Dedicated'; - productTitle = 'Red Hat OpenShift Dedicated'; + productName = 'Red Hat OpenShift Dedicated'; break; case 'azure': logoImg = azureLogoImg; - logoAlt = 'Azure Red Hat OpenShift'; - productTitle = 'Azure Red Hat OpenShift'; + productName = 'Azure Red Hat OpenShift'; break; default: logoImg = okdLogoImg; - logoAlt = 'OKD'; - productTitle = 'OKD'; + productName = 'OKD'; } - return { logoImg, logoAlt, productTitle }; + return { logoImg, productName }; }; export const Masthead = ({ onNavToggle }) => { @@ -62,7 +56,7 @@ export const Masthead = ({ onNavToggle }) => { return ( } + logo={} logoProps={logoProps} toolbar={} showNavToggle diff --git a/frontend/public/index.html b/frontend/public/index.html index aa1d9592e39..e17cfd871a9 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -10,20 +10,20 @@ [[ end ]] [[ if eq .Branding "openshift" ]] - OpenShift - + Red Hat OpenShift + [[ end ]] [[ if eq .Branding "ocp" ]] - OpenShift Container Platform - + Red Hat OpenShift Container Platform + [[ end ]] [[ if eq .Branding "online" ]] - OpenShift Online - + Red Hat OpenShift Online + [[ end ]] [[ if eq .Branding "dedicated" ]] - OpenShift Dedicated - + Red Hat OpenShift Dedicated + [[ end ]] [[ if eq .Branding "azure" ]] Azure Red Hat OpenShift diff --git a/frontend/public/tokener.html b/frontend/public/tokener.html index f3ee72870b5..3ff622b8029 100644 --- a/frontend/public/tokener.html +++ b/frontend/public/tokener.html @@ -1,45 +1,6 @@ - [[ if eq .Branding "okd" ]] - OKD - - [[ end ]] - [[ if eq .Branding "openshift" ]] - OpenShift - - [[ end ]] - [[ if eq .Branding "ocp" ]] - OpenShift Container Platform - - [[ end ]] - [[ if eq .Branding "online" ]] - OpenShift Online - - [[ end ]] - [[ if eq .Branding "dedicated" ]] - OpenShift Dedicated - - [[ end ]] - [[ if eq .Branding "azure" ]] - Azure Red Hat OpenShift - - [[ end ]] - - [[ if eq .Branding "okd" ]] - - - - - - [[ else ]] - - - - - - [[ end ]] -