Skip to content

Commit

Permalink
chore(comp): remove unused hint banner
Browse files Browse the repository at this point in the history
  • Loading branch information
Thuan Vo committed Apr 20, 2023
1 parent 4251e82 commit 50eefde
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 104 deletions.
3 changes: 2 additions & 1 deletion src/app/AppLayout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { SessionState } from '@app/Shared/Services/Login.service';
import { NotificationCategory } from '@app/Shared/Services/NotificationChannel.service';
import { ServiceContext } from '@app/Shared/Services/Services';
import { FeatureLevel } from '@app/Shared/Services/Settings.service';
import { getFromLocalStorage, saveToLocalStorage } from '@app/utils/LocalStorage';
import { useSubscriptions } from '@app/utils/useSubscriptions';
import { useTheme } from '@app/utils/useTheme';
import { cleanDataId, openTabForUrl, portalRoot } from '@app/utils/utils';
Expand Down Expand Up @@ -97,7 +98,7 @@ import {
} from '@patternfly/react-icons';
import * as _ from 'lodash';
import * as React from 'react';
import { useTranslation } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
import { Link, matchPath, NavLink, useHistory, useLocation } from 'react-router-dom';
import { map } from 'rxjs/operators';
import CryostatJoyride from '../Joyride/CryostatJoyride';
Expand Down
61 changes: 0 additions & 61 deletions src/app/Topology/Shared/HintBanner.tsx

This file was deleted.

17 changes: 1 addition & 16 deletions src/app/Topology/Topology.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,18 @@

import { BreadcrumbPage } from '@app/BreadcrumbPage/BreadcrumbPage';
import { ErrorView } from '@app/ErrorView/ErrorView';
import { FeatureFlag } from '@app/Shared/FeatureFlag/FeatureFlag';
import { LinearDotSpinner } from '@app/Shared/LinearDotSpinner';
import { ViewMode } from '@app/Shared/Redux/Configurations/TopologyConfigSlice';
import { RootState } from '@app/Shared/Redux/ReduxStore';
import { NotificationCategory } from '@app/Shared/Services/NotificationChannel.service';
import { ServiceContext } from '@app/Shared/Services/Services';
import { FeatureLevel } from '@app/Shared/Services/Settings.service';
import { getFromLocalStorage, saveToLocalStorage } from '@app/utils/LocalStorage';
import { useSubscriptions } from '@app/utils/useSubscriptions';
import { Bullseye, Card, CardBody } from '@patternfly/react-core';
import * as React from 'react';
import { useSelector } from 'react-redux';
import { Link, withRouter } from 'react-router-dom';
import { withRouter } from 'react-router-dom';
import { TopologyGraphView } from './GraphView/TopologyGraphView';
import { TopologyListView } from './ListView/TopologyListView';
import { HintBanner } from './Shared/HintBanner';
import { DiscoveryTreeContext, SearchExprService, SearchExprServiceContext } from './Shared/utils';
import { DEFAULT_EMPTY_UNIVERSE } from './typings';

Expand All @@ -75,19 +71,13 @@ export const Topology: React.FC<TopologyProps> = ({ ..._props }) => {

const [discoveryTree, setDiscoveryTree] = React.useState(DEFAULT_EMPTY_UNIVERSE);

const [shouldShowBanner, setShouldShowBanner] = React.useState(getFromLocalStorage('TOPOLOGY_SHOW_BANNER', true));
const isGraphView = useSelector((state: RootState) => {
const _currentMode: ViewMode = state.topologyConfigs.viewMode;
return _currentMode === 'graph';
});

const [error, setError] = React.useState<Error>();

const closeBanner = React.useCallback(() => {
setShouldShowBanner(false);
saveToLocalStorage('TOPOLOGY_SHOW_BANNER', false);
}, [setShouldShowBanner]);

const _refreshDiscoveryTree = React.useCallback(
(onSuccess?: () => void) => {
addSubscription(
Expand Down Expand Up @@ -178,11 +168,6 @@ export const Topology: React.FC<TopologyProps> = ({ ..._props }) => {

return (
<>
<FeatureFlag level={FeatureLevel.BETA}>
<HintBanner onClose={closeBanner} show={shouldShowBanner}>
For topology guides, see <Link to={'/quickstarts'}>Quickstarts</Link>.
</HintBanner>
</FeatureFlag>
<BreadcrumbPage pageTitle={'Topology'} {..._props}>
<Card isFullHeight id="topology-card">
<CardBody style={{ padding: 0 }}>
Expand Down
25 changes: 0 additions & 25 deletions src/app/Topology/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,31 +250,6 @@ Below CSS rules only apply to Topology components
font-weight: 700;
}

.topology__hint-banner {
position: relative;
box-sizing: border-box;
text-align: center;
padding: 0.2em 0 0.2em 0;
background-color: var(--pf-global--palette--blue-400);
color: var(--pf-global--palette--white);
font-size: 0.9em;
margin-bottom: -1em;
}

.topology__hint-banner a {
color: var(--pf-global--palette--white);
text-decoration: solid underline var(--pf-global--palette--white) 1px;
}

.topology__hint-banner .close-icon {
position: relative;
float: right;
font-size: 1em;
margin-right: 1em;
transform: translateY(calc(50% - 0.25em));
cursor: pointer;
}

#topology__visualization-container.topology__main-container {
padding: 1em;
}
Expand Down
1 change: 0 additions & 1 deletion src/app/utils/LocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export enum LocalStorageKey {
CREDENTIAL_LOCATION,
TARGET,
TARGET_FAVORITES,
TOPOLOGY_SHOW_BANNER,
TOPOLOGY_GRAPH_POSITONS,
TOPOLOGY_NODE_POSITIONS,
TOPOLOGY_CONFIG,
Expand Down

0 comments on commit 50eefde

Please sign in to comment.