Skip to content

Commit

Permalink
Merge branch 'develop' into hm-duos-2774-update-library-styling
Browse files Browse the repository at this point in the history
  • Loading branch information
hams7504 authored Nov 28, 2023
2 parents 6b73c8d + 3d9fd5e commit 94d98e6
Show file tree
Hide file tree
Showing 30 changed files with 1,257 additions and 1,384 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# builder image
FROM node:20.9.0 AS builder
FROM node:20.10.0 AS builder
LABEL maintainer="[email protected]"

# set working directory
Expand Down
504 changes: 251 additions & 253 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"@databiosphere/bard-client": "0.1.0",
"@emotion/react": "11.11.1",
"@emotion/styled": "11.11.0",
"@mui/icons-material": "5.14.15",
"@mui/material": "5.14.15",
"@mui/utils": "5.14.15",
"@mui/icons-material": "5.14.18",
"@mui/material": "5.14.18",
"@mui/utils": "5.14.18",
"ajv": "8.12.0",
"ajv-formats": "2.1.1",
"axios": "1.6.0",
"axios": "1.6.2",
"bootstrap": "3.4.1",
"dompurify": "3.0.6",
"http-proxy-middleware": "2.0.6",
Expand All @@ -28,13 +28,13 @@
"react-ga": "3.3.1",
"react-google-charts": "4.0.1",
"react-hyperscript-helpers": "2.0.0",
"react-markdown": "9.0.0",
"react-markdown": "9.0.1",
"react-material-icon-svg": "3.20.0",
"react-modal": "3.16.1",
"react-paginating": "1.4.0",
"react-protected-mailto": "1.0.3",
"react-router-dom": "5.3.0",
"react-select": "5.7.7",
"react-select": "5.8.0",
"react-tooltip": "4.5.1",
"stackdriver-errors-js": "0.12.0",
"tss-react": "4.9.3",
Expand All @@ -55,13 +55,13 @@
"cypress:verify": "cypress verify"
},
"devDependencies": {
"@babel/core": "7.23.2",
"@babel/eslint-parser": "7.22.15",
"@babel/core": "7.23.3",
"@babel/eslint-parser": "7.23.3",
"@babel/eslint-plugin": "7.22.10",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/preset-react": "7.22.15",
"@types/react": "18.2.33",
"cypress": "13.3.3",
"@babel/preset-react": "7.23.3",
"@types/react": "18.2.38",
"cypress": "13.6.0",
"eslint": "7.32.0",
"eslint-plugin-flowtype": "7.0.0",
"eslint-plugin-react": "7.33.2",
Expand Down
25 changes: 11 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {useEffect, useState} from 'react';
import React, { useEffect, useState } from 'react';
import ReactGA from 'react-ga';
import {div, h} from 'react-hyperscript-helpers';
import Modal from 'react-modal';
import './App.css';
import {Config} from './libs/config';
Expand Down Expand Up @@ -81,18 +80,16 @@ function App() {
};

return (
div({className: 'body'}, [
div({className: 'wrap'}, [
div({className: 'main'}, [
h(DuosHeader, {onSignOut: signOut}),
h(Spinner, {
name: 'mainSpinner', group: 'duos', loadingImage
}),
h(Routes, {onSignOut: signOut, onSignIn: signIn, isLogged: isLoggedIn, env: env})
])
]),
DuosFooter()
])
<div className="body">
<div className="wrap">
<div className="main">
<DuosHeader onSignOut={signOut} />
<Spinner name="mainSpinner" group="duos" loadingImage={loadingImage} />
<Routes onSignOut={signOut} onSignIn={signIn} isLogged={isLoggedIn} env={env} />
</div>
</div>
<DuosFooter />
</div>
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Routes = (props) => (
<Route exact path="/" render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path="/home" render={(routeProps) => <Home {...routeProps} {...props} />} />
<Route exact path="/status" render={(routeProps) => Status(mergeAll([routeProps, props]))} />
<Route exact path="/liveness" render={() => HealthCheck()} />
<Route exact path="/liveness" component={HealthCheck} />
<Route exact path="/backgroundsignin" render={
(routeProps) =>
checkEnv(envGroups.NON_STAGING)
Expand Down
3 changes: 2 additions & 1 deletion src/components/CollapsibleTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,5 @@ const SubtableCellRenderer = ({ cell }) => {
return <StyledTableCell>
{cell.value}
</StyledTableCell>;
};

};
20 changes: 9 additions & 11 deletions src/components/DownloadLink.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { div, a, i, span } from 'react-hyperscript-helpers';
import React from 'react';
import { Theme } from '../libs/theme';

const ICON = {
Expand All @@ -9,14 +9,12 @@ const ICON = {

export const DownloadLink = props => {
const { label, onDownload } = props;
return div({}, [
a({
id: _.kebabCase(label),
onClick: () => onDownload()
},
[
i({ className: 'glyphicon glyphicon-download-alt', style: ICON }),
span({style: { fontSize: Theme.font.size.small }}, label)
])
]);
return (
<div>
<a id={_.kebabCase(label)} onClick={onDownload}>
<i className='glyphicon glyphicon-download-alt' style={ICON} />
<span style={{ fontSize: Theme.font.size.small }}>{label}</span>
</a>
</div>
);
};
24 changes: 12 additions & 12 deletions src/components/DuosFooter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { a, div, footer, img, li, ul } from 'react-hyperscript-helpers';
import React from 'react';
import footerLogo from '../images/broad_logo_allwhite.png';

function DuosFooter() {
Expand All @@ -24,17 +24,17 @@ function DuosFooter() {
};

return (
div({ style: footerStyle }, [
footer({ style: mainFooterStyle }, [
img({ src: footerLogo, style: footerLogoStyle, alt: 'Broad Institute logo' }),
ul({ className: 'footer-links' }, [
li({ className: 'footer-links__item' }, ['\u00A9 Broad Institute']),
li({ className: 'footer-links__item' }, [a({ href: '/privacy' }, ['Privacy Policy']),]),
li({ className: 'footer-links__item' }, [a({ href: '/tos' }, ['Terms of Service']),]),
li({ className: 'footer-links__item' }, [a({ href: '/status' }, ['Status'])])
])
])
])
<div style={footerStyle}>
<footer style={mainFooterStyle}>
<img src={footerLogo} style={footerLogoStyle} alt='Broad Institute logo' />
<ul className='footer-links'>
<li className='footer-links__item'>© Broad Institute</li>
<li className='footer-links__item'><a href='/privacy'>Privacy Policy</a></li>
<li className='footer-links__item'><a href='/tos'>Terms of Service</a></li>
<li className='footer-links__item'><a href='/status'>Status</a></li>
</ul>
</footer>
</div>
);
}

Expand Down
150 changes: 74 additions & 76 deletions src/components/PageHeading.js
Original file line number Diff line number Diff line change
@@ -1,82 +1,80 @@
import {Component} from 'react';
import {div, hh, img, h2, span} from 'react-hyperscript-helpers';
import {isNil} from 'lodash';
import React from 'react';
import { isNil } from 'lodash';

export const PageHeading = hh(class PageHeading extends Component {
const margins = (iconSize) => {

margins(iconSize) {
const MEDIUM = {
marginLeft: '55px'
};

const MEDIUM = {
marginLeft: '55px'
};
const LARGE = {
marginLeft: '70px'
};

const LARGE = {
marginLeft: '70px'
};

const NONE = {
marginLeft: '0'
};

if (iconSize === 'none') {
return NONE;
}
if (iconSize === 'large') {
return LARGE;
} else {
return MEDIUM;
}
}

render() {

const HEADING = {
width: '100%',
margin: '20px 0 10px 0',
position: 'relative'
};

const ICON = {
position: 'absolute',
top: '0',
left: '0',
height: '50px'
};

const DESCRIPTION = {
color: '#000000',
height: '25px',
fontWeight: '400',
fontSize: '19px'
};

const TITLE = {
margin: '7px 0 5px 0',
lineBreak: 'auto'
};

const MARGINS = this.margins(this.props.iconSize);
const DESCRIPT_STYLE = isNil(this.props.descriptionStyle) ? DESCRIPTION : this.props.descriptionStyle;

return div({id: this.props.id + '_heading', style: HEADING}, [
img({
id: this.props.id + '_icon',
isRendered: this.props.imgSrc !== undefined,
src: this.props.imgSrc,
alt: this.props.title,
style: ICON
}),
div({style: MARGINS}, [
h2({
id: this.props.id + '_title',
className: this.props.color + '-color',
style: TITLE
}, [this.props.title]),
span({id: this.props.id + '_description', style: DESCRIPT_STYLE}, [this.props.description]),
]),

]);
const NONE = {
marginLeft: '0'
};

if (iconSize === 'none') {
return NONE;
} else if (iconSize === 'large') {
return LARGE;
} else {
return MEDIUM;
}

});
};

export const PageHeading = (props) => {
const { id, title, description, imgSrc, color, iconSize, descriptionStyle } = props;

const HEADING = {
width: '100%',
margin: '20px 0 10px 0',
position: 'relative'
};

const ICON = {
position: 'absolute',
top: '0',
left: '0',
height: '50px'
};

const DESCRIPTION = {
color: '#000000',
height: '25px',
fontWeight: '400',
fontSize: '19px'
};

const TITLE = {
margin: '7px 0 5px 0',
lineBreak: 'auto'
};

const MARGINS = margins(iconSize);
const DESCRIPT_STYLE = isNil(descriptionStyle) ? DESCRIPTION : descriptionStyle;

return (
<div id={id + '_heading'} style={HEADING}>
{imgSrc !== undefined &&
<img
id={id + '_icon'}
src={imgSrc}
alt={title}
style={ICON}
/>
}
<div style={MARGINS}>
<h2 id={id + '_title'} className={`${color}-color`} style={TITLE}>
{title}
</h2>
<span id={id + '_description'} style={DESCRIPT_STYLE}>
{description}
</span>
</div>
</div>
);
};

export default PageHeading;
Loading

0 comments on commit 94d98e6

Please sign in to comment.