Skip to content

Commit

Permalink
Merge pull request #33 from geostreams/release/3.6.0
Browse files Browse the repository at this point in the history
Release/3.6.0
  • Loading branch information
lmarini authored Jan 14, 2021
2 parents 5971eb4 + 4015e88 commit ebda342
Show file tree
Hide file tree
Showing 118 changed files with 4,120 additions and 1,397 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
# description: "ILNLRS Geodashboard Image"
- name: smartfarm
gd-name: gd-smartfarm
prod-host: ""
dev-host: "141.142.208.219"
file-path: /home/ubuntu/smartfarm
prod-host: "141.142.210.210"
dev-host: "141.142.210.220"
file-path: /home/ubuntu/mbclab
description: "Smartfarm Geodashboard Image"
steps:
-
Expand All @@ -81,11 +81,11 @@ jobs:
echo -n > .env
if [ "$TARGET_BRANCH" == "master" ]; then
TAGS="${HUB_REPO}/${PROJECT_NAME}:latest,${HUB_REPO}/${PROJECT_NAME}:${VERSION}"
echo ::set-env name=HOST:: ${{ matrix.prod-host }}
echo "HOST=${{ matrix.prod-host }}" >> $GITHUB_ENV
elif [ "$TARGET_BRANCH" == "develop" ]; then
TAGS="${HUB_REPO}/${PROJECT_NAME}:develop"
TAGS="$TAGS,${HUB_REPO}/${PROJECT_NAME}:sha-${GITHUB_SHA::8}"
echo ::set-env name=SSH_HOST:: ${{ matrix.dev-host }}
echo "HOST=${{ matrix.dev-host }}" >> $GITHUB_ENV
fi
echo "::set-output name=version::${VERSION}"
echo "::set-output name=tags::${TAGS}"
Expand Down Expand Up @@ -171,4 +171,4 @@ jobs:
FILE_PATH: ${{ matrix.file-path }}
run: |
ssh vm "sudo docker login -u '$HUB_USER' -p '$HUB_PASS' hub.ncsa.illinois.edu"
ssh vm "sleep 5 && cd $FILE_PATH && sudo docker-compose pull geodashboard && sudo docker-compose up -d"
ssh vm "sleep 5 && cd $FILE_PATH && sudo docker-compose pull geodashboard && sudo docker-compose up -d"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.6.0 - 2020-12-14
See `gd-glm/CHANGELOG.md`, `gd-smartfarm/CHANGELOG.md`, `gd-gltg-bmp/CHANGELOG.md`, `gd-gltg/CHANGELOG.md`,
`gd-geostreaming/CHANGELOG.md`, `gd-core/CHANGELOG.md`, and `gd-core_old/CHANGELOG.md` for specific changes.

- Updated GitHub workflows.

## [3.5.0] - 2020-08-27
See `gd-gltg/CHANGELOG.md`, `gd-geostreaming/CHANGELOG.md`, `gd-glm__old`, `gd-glm` for specific changes.

Expand Down
10 changes: 10 additions & 0 deletions gd-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 3.6.0 - 2020-12-14

### Added
- New sidebar component to be used in Explore page.
[GEOD-1357](https://opensource.ncsa.illinois.edu/jira/browse/GEOD-1357)

### Changed
- Moved `callAPI` from `gd-geostreaming` to `gd-core` and added error callback
[GLGVO-709](https://opensource.ncsa.illinois.edu/jira/browse/GLGVO-709)

## [3.4.0] - 2020-08-27
### Added
- Stacked Bar Chart
Expand Down
2 changes: 1 addition & 1 deletion gd-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gd-core",
"version": "3.3.0",
"version": "3.6.0",
"main": "src/index.jsx",
"scripts": {
"start": "webpack-dev-server --config webpack.config.dev.js --color",
Expand Down
5 changes: 3 additions & 2 deletions gd-core/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import * as React from 'react';
import { Route } from 'react-router-dom';
import { ThemeProvider } from '@material-ui/core/styles';

import theme from './theme';
import defaultTheme from './theme';
import { entries } from './utils/array';

type Props = {
routes: { [key: string]: Function };
theme: Object
}

const App = ({ routes }: Props) => (
const App = ({ routes, theme = defaultTheme }: Props) => (
<ThemeProvider theme={theme}>
{entries(routes).map(([path, props]) => (
<Route key={path} path={`${process.env.CONTEXT || ''}${path}`} {...props} />
Expand Down
144 changes: 144 additions & 0 deletions gd-core/src/components/theme/BaseSidebar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
// @flow
import * as React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import {
Container,
Drawer,
IconButton
}
from '@material-ui/core';
import ChevronLeftIcon from '@material-ui/icons/ChevronLeft';
import ChevronRightIcon from '@material-ui/icons/ChevronRight';

/*
BaseSidebar creates an animated collapsible empty sidebar.
Props:
- classes: Override default classes
- Non-Collapsible Sidebar
- no extra props required
- Collapsible Sidebar
- collapsible: Shows the collapse control button on bottom
- expanded: Boolean value of whether to open or close sidebar
- toggleSidebar: Controls whether its open or not
*/

const drawerWidth = 400;

const useStyles = makeStyles((theme) => ({
drawer: {
width: drawerWidth,
zIndex: theme.zIndex.drawer
},
drawerPaper:{
width: drawerWidth,
borderRight: 'none',
paddingTop: 65,
overflowX: 'hidden',
justifyContent: 'space-between'
},
drawerOpen: {
width: drawerWidth,
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.enteringScreen
})
},
drawerClose: {
transition: theme.transitions.create('width', {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen
}),
overflow: 'hidden',
width: theme.spacing(7) + 1,
[theme.breakpoints.up('sm')]: {
width: theme.spacing(9) + 1
}
},
toolbar: {
display: 'flex',
alignItems: 'center',
justifyContent: 'flex-end',
padding: '0 8px'
},
content: props => ({
alignItems: 'flex-start',
padding:0,
width: drawerWidth - 15,
marginRight: 15,
marginLeft: 5,
paddingBottom: 10,
...props.classes.content
})

}));

type Props = {
children?: React.Node,
collapsible?: boolean,
toggleSidebar: Function,
// eslint-disable-next-line react/no-unused-prop-types
classes: Object,
expanded: boolean
}

function BaseSidebar(props: Props) {

const classes = useStyles(props);
const open = props.expanded;

// fire resize events when sidebar is toggled to update other components in tree (map)
// multiple events to smooth out the updates
React.useEffect(() => {
const duration = open ? 195 : 225;

for (let i = 0; i < duration + 100; i += 10) {
setTimeout(
()=>{window.dispatchEvent(new Event('resize'));},
i
);
}

}, [open]);



return (
<>
<Drawer
variant="permanent"
className={clsx(classes.drawer, {
[classes.drawerOpen]: open,
[classes.drawerClose]: !open
})}
PaperProps={{ elevation: 3 }}
classes={{
paper: clsx(classes.drawerPaper, {
[classes.drawerOpen]: open,
[classes.drawerClose]: !open
})
}}
>
<Container className={classes.content}>
{props.children}
</Container>
{props.collapsible ?
<div className={classes.toolbar}>
<IconButton onClick={()=> props.toggleSidebar(!open)}>
{open ? <ChevronLeftIcon /> : <ChevronRightIcon /> }
</IconButton>
</div> :
null}
</Drawer>
</>
);
}

BaseSidebar.defaultProps = {
children: null,
collapsible: false,
classes: {},
expanded: true
};

export default BaseSidebar;
103 changes: 103 additions & 0 deletions gd-core/src/components/theme/SidebarCategory.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// @flow
import * as React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import ExpandMore from '@material-ui/icons/ExpandMore';
import {
Box,
Collapse,
List,
ListItem,
Grid
} from '@material-ui/core';

/*
Renders collapsible category component in sidebar.
Props:
- title
- children
- idx - required for mapping
- classes - override default classes
*/

const useStyles = makeStyles((theme) => ({
root: {
height: 'auto',
overflowX: 'hidden',
overflowY: 'auto',
backgroundColor: theme.palette.background.paper
},
open : {
transform: 'rotate(180deg)'
},
close: {
transform: 'rotate(0deg)'
},
header: props => ({
justifyContent: 'space-between',
alignItems: 'stretch',
marginLeft: 4,
marginRight: 4,
...props.classes.header,
background: props.backgroundColor
}),
icon: props => ({
position: 'absolute',
right: 6,
bottom: 4,
transition: theme.transitions.create(['transform'], {
duration: theme.transitions.duration.short
}),
...props.classes.icon
}),
content: props => ({
paddingLeft: theme.spacing(1),
...props.classes.content
})
}));

type Props = {
defaultOpen?: boolean;
children?: React.Node,
title: React.Node,
// eslint-disable-next-line react/no-unused-prop-types
classes: Object
}

function SidebarCategories(props: Props) {
const classes = useStyles(props);
const [open, toggleOpen] = React.useState(props.defaultOpen);
return (
<List
className={`${classes.root} noPadding`}
subheader={
<Box
button disableRipple disableGutters dense
borderRadius={4}
component={ListItem}
onClick={()=>toggleOpen(!open)}
>
<Grid container className={classes.header} justify="space-between" alignitems="center" >
{props.title}
<ExpandMore className={clsx(classes.icon,{
[classes.open]: open,
[classes.close]: !open
})} />
</Grid>
</Box>
}
>
<Collapse in={open} className={classes.content} unmountOnExit timeout="auto">
{props.children}
</Collapse>
</List>
);
}

SidebarCategories.defaultProps = {
defaultOpen: false,
children: null,
classes: null
};

export default SidebarCategories;
4 changes: 2 additions & 2 deletions gd-core/src/reducers/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export default (state: State = INIT_STATE, action: Action) => {
switch (action.type) {
case ACTIONS.UPDATE_LOADING_STATUS:
return {
isLoading: action.isLoading,
...state
...state,
isLoading: action.isLoading
};
default:
return state;
Expand Down
5 changes: 3 additions & 2 deletions gd-core/src/render.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import type { Routes } from './routes';
const render = (
reducers: { [key: string]: Function } = baseReducers,
routes: Routes = baseRoutes,
storeCallback: Function
storeCallback: Function,
theme: Object,
) => {
const composeEnhancers = (
(process.env.NODE_ENV === 'development' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose
Expand All @@ -37,7 +38,7 @@ const render = (
ReactDOM.render(
<Provider store={store}>
<Router>
<App routes={routes} />
<App routes={routes} theme={theme} />
</Router>
</Provider>,
root
Expand Down
Loading

0 comments on commit ebda342

Please sign in to comment.