Skip to content

Commit c9b3a7b

Browse files
authored
[TSPS-601] Imputation sidebar updates (#5407)
1 parent 84ae41b commit c9b3a7b

File tree

3 files changed

+41
-11
lines changed

3 files changed

+41
-11
lines changed

src/components/TopBar.test.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ describe('TopBar', () => {
4848
}
4949
});
5050

51-
it('renders limited options when compactTopBar brand option is enabled', async () => {
52-
// scientificServices is a brand config that has compactTopBar enabled
51+
it('renders limited options when scientificServices brand option is enabled', async () => {
5352
configOverridesStore.set({ brand: 'scientificServices' });
5453

5554
authStore.update((authState) => ({ ...authState, signInStatus: 'uninitialized' as SignInStatus }));
@@ -62,5 +61,22 @@ describe('TopBar', () => {
6261
expect(screen.queryByText('Sign In')).toBeInTheDocument();
6362
expect(screen.queryByText('Workspaces')).not.toBeInTheDocument();
6463
expect(screen.queryByText('Support')).not.toBeInTheDocument();
64+
expect(screen.queryByText('Service News')).toBeInTheDocument();
65+
expect(screen.queryByText('Documentation')).toBeInTheDocument();
66+
});
67+
68+
it('renders full options when scientificServices brand option is disabled', async () => {
69+
configOverridesStore.set({ brand: undefined });
70+
71+
authStore.update((authState) => ({ ...authState, signInStatus: 'uninitialized' as SignInStatus }));
72+
73+
// Act
74+
render(h(TopBar));
75+
fireEvent.click(screen.getByLabelText('Toggle main menu'));
76+
77+
// Assert
78+
expect(screen.queryByText('Sign In')).toBeInTheDocument();
79+
expect(screen.queryByText('Workspaces')).toBeInTheDocument();
80+
expect(screen.queryByText('Support')).toBeInTheDocument();
6581
});
6682
});

src/components/TopBar.tsx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { Clickable, Link } from 'src/components/common';
1212
import { SkipNavLink, SkipNavTarget } from 'src/components/skipNavLink';
1313
import headerRightHexes from 'src/images/brands/terra/header-right-hexes.svg';
1414
import {
15-
getEnabledBrand,
1615
isBaseline,
1716
isBioDataCatalyst,
1817
isDatastage,
@@ -154,8 +153,6 @@ export const TopBar = (props: TopBarProps): ReactNode => {
154153
const authState = useStore(authStore);
155154
const userState = useStore(userStore);
156155

157-
const compact = getEnabledBrand().compactTopBar;
158-
159156
const showNav = () => {
160157
setNavShown(true);
161158
document.body.classList.add('overlayOpen');
@@ -200,7 +197,7 @@ export const TopBar = (props: TopBarProps): ReactNode => {
200197
onClick={() => setOpenUserMenu(!openUserMenu)}
201198
isOpened={openUserMenu}
202199
>
203-
{!compact && (
200+
{!isScientificServices() && (
204201
<>
205202
<DropDownSubItem href={Nav.getLink('profile')} onClick={hideNav}>
206203
Profile
@@ -252,7 +249,28 @@ export const TopBar = (props: TopBarProps): ReactNode => {
252249
</Clickable>
253250
</div>
254251
)}
255-
{!compact && (
252+
{isScientificServices() && (
253+
<>
254+
<NavSection
255+
href='https://broadscientificservices.zendesk.com/hc/en-us/categories/39899029682331'
256+
onClick={hideNav}
257+
{...Utils.newTabLinkProps}
258+
>
259+
<Icon icon='newspaper' size={24} style={navIconStyles} />
260+
Service News
261+
</NavSection>
262+
<NavSection
263+
href='https://broadscientificservices.zendesk.com/hc/en-us'
264+
onClick={hideNav}
265+
{...Utils.newTabLinkProps}
266+
>
267+
<Icon icon='help' size={24} style={navIconStyles} />
268+
Documentation
269+
</NavSection>
270+
</>
271+
)}
272+
273+
{!isScientificServices() && (
256274
<>
257275
<NavSection href={Nav.getLink('workspaces')} onClick={hideNav}>
258276
<Icon icon='view-cards' size={24} style={navIconStyles} />

src/libs/brands.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,6 @@ export interface BrandConfiguration {
108108
/** Card body */
109109
body: string;
110110
};
111-
112-
/** Optional flag to use the compact TopBar with login/logout only */
113-
compactTopBar?: boolean;
114111
}
115112

116113
export const landingPageCardsDefault = [
@@ -406,7 +403,6 @@ export const brands: Record<string, BrandConfiguration> = {
406403
welcomeHeader: <ScientificServicesWelcomeHeader />,
407404
description: <ScientificServicesDescription />,
408405
hostName: 'services.terra.bio',
409-
compactTopBar: true,
410406
docLinks: [],
411407
landingPageCards: [],
412408
logos: {

0 commit comments

Comments
 (0)