--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { createMuiTheme } from '@material-ui/core/styles';
+import { ThemeOptions, Theme } from '@material-ui/core/styles/createMuiTheme';
+import purple from '@material-ui/core/colors/purple';
+import blue from '@material-ui/core/colors/blue';
+import grey from '@material-ui/core/colors/grey';
+import green from '@material-ui/core/colors/green';
+
+interface ArvadosThemeOptions extends ThemeOptions {
+ customs: any;
+}
+
+export interface ArvadosTheme extends Theme {
+ customs: any;
+}
+
+const purple900 = purple["900"];
+const grey600 = grey["600"];
+const themeOptions: ArvadosThemeOptions = {
+ customs: {
+ colors: {
+ green700: green["700"]
+ }
+ },
+ overrides: {
+ MuiAppBar: {
+ colorPrimary: {
+ backgroundColor: purple900
+ }
+ },
+ MuiTabs: {
+ root: {
+ color: grey600
+ },
+ indicator: {
+ backgroundColor: purple900
+ }
+ },
+ MuiTab: {
+ selected: {
+ fontWeight: 700,
+ color: purple900
+ }
+ }
+ },
+ mixins: {
+ toolbar: {
+ minHeight: '48px'
+ }
+ },
+ palette: {
+ primary: {
+ main: '#06C',
+ dark: blue.A100
+ }
+ }
+};
+
+export const CustomTheme = createMuiTheme(themeOptions);
\ No newline at end of file
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import Typography from '@material-ui/core/Typography';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from 'src/common/custom-theme';
+
+interface AttributeDataProps {
+ label: string;
+}
+
+type AttributeProps = AttributeDataProps & WithStyles<CssRules>;
+
+class Attribute extends React.Component<AttributeProps> {
+
+ render() {
+ const { label, children, classes } = this.props;
+ return <Typography component="div" className={classes.attribute}>
+ <span className={classes.label}>{label}</span>
+ <span className={classes.value}>{children}</span>
+ </Typography>;
+ }
+
+}
+
+type CssRules = 'attribute' | 'label' | 'value';
+
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ attribute: {
+ display: 'flex',
+ alignItems: 'center',
+ marginBottom: theme.spacing.unit
+ },
+ label: {
+ color: theme.palette.grey["500"],
+ width: '40%'
+ },
+ value: {
+ display: 'flex',
+ alignItems: 'center'
+ }
+});
+
+export default withStyles(styles)(Attribute);
\ No newline at end of file
overflowY: 'auto',
minWidth: '240px',
whiteSpace: 'nowrap',
- marginTop: '38px',
+ marginTop: '52px',
display: 'flex',
flexGrow: 1,
},
import authActions from "./store/auth/auth-action";
import { authService } from "./services/services";
import { getProjectList } from "./store/project/project-action";
+import { MuiThemeProvider } from '@material-ui/core/styles';
+import { CustomTheme } from './common/custom-theme';
const history = createBrowserHistory();
store.dispatch<any>(getProjectList(rootUuid));
const App = () =>
- <Provider store={store}>
- <ConnectedRouter history={history}>
- <div>
- <Route path="/" component={Workbench}/>
- <Route path="/token" component={ApiToken}/>
- </div>
- </ConnectedRouter>
- </Provider>;
+ <MuiThemeProvider theme={CustomTheme}>
+ <Provider store={store}>
+ <ConnectedRouter history={history}>
+ <div>
+ <Route path="/" component={Workbench}/>
+ <Route path="/token" component={ApiToken}/>
+ </div>
+ </ConnectedRouter>
+ </Provider>
+ </MuiThemeProvider>;
ReactDOM.render(
<App/>,
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+import Drawer from '@material-ui/core/Drawer';
+import IconButton from "@material-ui/core/IconButton";
+import CloseIcon from '@material-ui/icons/Close';
+import FolderIcon from '@material-ui/icons/Folder';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
+import { ArvadosTheme } from '../../common/custom-theme';
+import Attribute from '../../components/attribute/attribute';
+import Tabs from '@material-ui/core/Tabs';
+import Tab from '@material-ui/core/Tab';
+import Typography from '@material-ui/core/Typography';
+import Grid from '@material-ui/core/Grid';
+import * as classnames from "classnames";
+
+export interface DetailsPanelProps {
+ onCloseDrawer: () => void;
+ isOpened: boolean;
+}
+
+class DetailsPanel extends React.Component<DetailsPanelProps & WithStyles<CssRules>, {}> {
+ state = {
+ tabsValue: 0,
+ };
+
+ handleChange = (event: any, value: boolean) => {
+ this.setState({ tabsValue: value });
+ }
+
+ renderTabContainer = (children: React.ReactElement<any>) =>
+ <Typography className={this.props.classes.tabContainer} component="div">
+ {children}
+ </Typography>
+
+ render() {
+ const { classes, onCloseDrawer, isOpened } = this.props;
+ const { tabsValue } = this.state;
+ return (
+ <div className={classnames([classes.container, { [classes.opened]: isOpened }])}>
+ <Drawer variant="permanent" anchor="right" classes={{ paper: classes.drawerPaper }}>
+ <Typography component="div" className={classes.headerContainer}>
+ <Grid container alignItems='center' justify='space-around'>
+ <i className="fas fa-cogs fa-lg" />
+ <Typography variant="title">
+ Tutorial pipeline
+ </Typography>
+ <IconButton color="inherit" onClick={onCloseDrawer}>
+ <CloseIcon />
+ </IconButton>
+ </Grid>
+ </Typography>
+ <Tabs value={tabsValue} onChange={this.handleChange}>
+ <Tab disableRipple label="Details" />
+ <Tab disableRipple label="Activity" />
+ </Tabs>
+ {tabsValue === 0 && this.renderTabContainer(
+ <Grid container direction="column">
+ <Attribute label="Type">Process</Attribute>
+ <Attribute label="Size">---</Attribute>
+ <Attribute label="Location">
+ <FolderIcon />
+ Projects
+ </Attribute>
+ <Attribute label="Owner">me</Attribute>
+ </Grid>
+ )}
+ {tabsValue === 1 && this.renderTabContainer(
+ <Grid container direction="column">
+ <Attribute label="Type">Process</Attribute>
+ <Attribute label="Size">---</Attribute>
+ <Attribute label="Location">
+ <FolderIcon />
+ Projects
+ </Attribute>
+ <Attribute label="Owner">me</Attribute>
+ </Grid>
+ )}
+ </Drawer>
+ </div>
+ );
+ }
+
+}
+
+type CssRules = 'drawerPaper' | 'container' | 'opened' | 'headerContainer' | 'tabContainer';
+
+const drawerWidth = 320;
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
+ container: {
+ width: 0,
+ position: 'relative',
+ height: 'auto',
+ transition: 'width 0.5s ease',
+ '&$opened': {
+ width: drawerWidth
+ }
+ },
+ opened: {},
+ drawerPaper: {
+ position: 'relative',
+ width: drawerWidth
+ },
+ headerContainer: {
+ color: theme.palette.grey["600"],
+ margin: `${theme.spacing.unit}px 0`,
+ '& .fa-cogs': {
+ fontSize: "24px",
+ color: theme.customs.colors.green700
+ }
+ },
+ tabContainer: {
+ padding: theme.spacing.unit * 3
+ }
+});
+
+export default withStyles(styles)(DetailsPanel);
\ No newline at end of file
const mainAppBar = mount(
<MainAppBar
user={user}
+ onDetailsPanelToggle={jest.fn()}
{...{ searchText: "", breadcrumbs: [], menuItems: { accountMenu: [], helpMenu: [], anonymousMenu: [] }, onSearch: jest.fn(), onBreadcrumbClick: jest.fn(), onMenuItemClick: jest.fn() }}
/>
);
const mainAppBar = mount(
<MainAppBar
menuItems={menuItems}
+ onDetailsPanelToggle={jest.fn()}
{...{ searchText: "", breadcrumbs: [], onSearch: jest.fn(), onBreadcrumbClick: jest.fn(), onMenuItemClick: jest.fn() }}
/>
);
searchText="search text"
searchDebounce={2000}
onSearch={onSearch}
+ onDetailsPanelToggle={jest.fn()}
{...{ user, breadcrumbs: [], menuItems: { accountMenu: [], helpMenu: [], anonymousMenu: [] }, onBreadcrumbClick: jest.fn(), onMenuItemClick: jest.fn() }}
/>
);
<MainAppBar
breadcrumbs={items}
onBreadcrumbClick={onBreadcrumbClick}
+ onDetailsPanelToggle={jest.fn()}
{...{ user, searchText: "", menuItems: { accountMenu: [], helpMenu: [], anonymousMenu: [] }, onSearch: jest.fn(), onMenuItemClick: jest.fn() }}
/>
);
<MainAppBar
menuItems={menuItems}
onMenuItemClick={onMenuItemClick}
+ onDetailsPanelToggle={jest.fn()}
{...{ user, searchText: "", breadcrumbs: [], onSearch: jest.fn(), onBreadcrumbClick: jest.fn() }}
/>
);
// SPDX-License-Identifier: AGPL-3.0
import * as React from "react";
-import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, StyleRulesCallback, withStyles, WithStyles, Button, MenuItem } from "@material-ui/core";
+import { AppBar, Toolbar, Typography, Grid, IconButton, Badge, Button, MenuItem } from "@material-ui/core";
import NotificationsIcon from "@material-ui/icons/Notifications";
import PersonIcon from "@material-ui/icons/Person";
import HelpIcon from "@material-ui/icons/Help";
+import InfoIcon from '@material-ui/icons/Info';
import SearchBar from "../../components/search-bar/search-bar";
import Breadcrumbs, { Breadcrumb } from "../../components/breadcrumbs/breadcrumbs";
import DropdownMenu from "../../components/dropdown-menu/dropdown-menu";
onSearch: (searchText: string) => void;
onBreadcrumbClick: (breadcrumb: Breadcrumb) => void;
onMenuItemClick: (menuItem: MainAppBarMenuItem) => void;
+ onDetailsPanelToggle: () => void;
}
-type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps & WithStyles<CssRules>;
+type MainAppBarProps = MainAppBarDataProps & MainAppBarActionProps;
export const MainAppBar: React.SFC<MainAppBarProps> = (props) => {
- return <AppBar className={props.classes.appBar} position="static">
- <Toolbar className={props.classes.toolbar}>
- <Grid
- container
- justify="space-between"
- >
+ return <AppBar position="static">
+ <Toolbar>
+ <Grid container justify="space-between">
<Grid item xs={3}>
<Typography variant="headline" color="inherit" noWrap>
Arvados
</Grid>
</Grid>
</Toolbar>
- {
- props.user && <Toolbar className={props.classes.toolbar}>
- <Breadcrumbs items={props.breadcrumbs} onClick={props.onBreadcrumbClick} />
- </Toolbar>
- }
+ <Toolbar >
+ {
+ props.user && <Breadcrumbs items={props.breadcrumbs} onClick={props.onBreadcrumbClick} />
+ }
+ <IconButton color="inherit" onClick={props.onDetailsPanelToggle}>
+ <InfoIcon />
+ </IconButton>
+ </Toolbar>
</AppBar>;
};
));
};
-type CssRules = "appBar" | "toolbar";
-
-const styles: StyleRulesCallback<CssRules> = theme => ({
- appBar: {
- backgroundColor: "#692498"
- },
- toolbar: {
- minHeight: '48px'
- }
-});
-
-export default withStyles(styles)(MainAppBar);
+export default MainAppBar;
// SPDX-License-Identifier: AGPL-3.0
import * as React from 'react';
-import { StyleRulesCallback, Theme, WithStyles, withStyles } from '@material-ui/core/styles';
+import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
import Drawer from '@material-ui/core/Drawer';
import { connect, DispatchProp } from "react-redux";
import { Route, Switch, RouteComponentProps, withRouter } from "react-router";
import projectActions from "../../store/project/project-action";
import ProjectPanel from "../project-panel/project-panel";
import { sidePanelData } from '../../store/side-panel/side-panel-reducer';
+import DetailsPanel from '../../views-components/details-panel/details-panel';
+import { ArvadosTheme } from '../../common/custom-theme';
const drawerWidth = 240;
-const appBarHeight = 102;
+const appBarHeight = 100;
type CssRules = 'root' | 'appBar' | 'drawerPaper' | 'content' | 'contentWrapper' | 'toolbar';
-const styles: StyleRulesCallback<CssRules> = (theme: Theme) => ({
+const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
root: {
flexGrow: 1,
zIndex: 1,
},
appBar: {
zIndex: theme.zIndex.drawer + 1,
- backgroundColor: '#692498',
position: "absolute",
width: "100%"
},
paddingTop: appBarHeight
},
content: {
- padding: theme.spacing.unit * 3,
+ padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3}px`,
overflowY: "auto",
flexGrow: 1
},
helpMenu: NavMenuItem[],
anonymousMenu: NavMenuItem[]
};
+ isDetailsPanelOpened: boolean;
}
class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
action: () => this.props.dispatch(authActions.LOGIN())
}
]
- }
+ },
+ isDetailsPanelOpened: false
};
mainAppBarActions: MainAppBarActionProps = {
this.setState({ searchText });
this.props.dispatch(push(`/search?q=${searchText}`));
},
- onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action()
+ onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action(),
+ onDetailsPanelToggle: () => {
+ this.setState(prev => ({ isDetailsPanelOpened: !prev.isDetailsPanelOpened }));
+ }
};
toggleSidePanelOpen = (itemId: string) => {
<Route path="/projects/:id" render={this.renderProjectPanel} />
</Switch>
</div>
+ <DetailsPanel
+ isOpened={this.state.isDetailsPanelOpened}
+ onCloseDrawer={this.mainAppBarActions.onDetailsPanelToggle} />
</main>
</div>
);