Skip to content

Commit

Permalink
Merge pull request #1529 from thehyve/ui-redesign
Browse files Browse the repository at this point in the history
Add initial version of a new Fairspace 2.0 user interface
  • Loading branch information
ewelinagr authored Jul 24, 2024
2 parents d1350dd + 824ae93 commit f4f471e
Show file tree
Hide file tree
Showing 57 changed files with 859 additions and 383 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
2.0.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified projects/mercury/public/public/images/logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
171 changes: 165 additions & 6 deletions projects/mercury/src/App.theme.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,90 @@
import {createTheme} from '@mui/material';
import {blue, indigo, pink} from '@mui/material/colors';
import {pink} from '@mui/material/colors';

export default createTheme({
export const COLORS = {
fsBlueLight: 'rgba(106,134,232,1)',
fsBlueLightTransp25: 'rgba(106,134,232,0.25)',
fsBlueMedium: 'rgba(63,102,177,1)',
fsBlueDark: 'rgba(7, 59, 82, 1)'
};

const globalTheme = createTheme({
palette: {
primary: process.env.NODE_ENV === 'development' ? blue : indigo,
secondary: pink
primary: {
main: COLORS.fsBlueMedium,
light: COLORS.fsBlueLight,
dark: COLORS.fsBlueDark,
contrastText: 'white'
},
secondary: {
main: '#ffdb56',
contrastText: 'black'
},
error: pink,
success: {
main: '#08a045'
},
background: {
default: '#ECEDF0'
},
text: {
primary: COLORS.fsBlueDark,
secondary: COLORS.fsBlueMedium
},
mellow: {
light: '#cfd8dc',
main: '#b0bec5',
dark: '#37474f',
contrastText: '#47008F'
}
},
shape: {
borderRadius: 15
}
});

export const scrollbarStyles = {
'&::-webkit-scrollbar': {
width: '0.5em',
height: '0.5em'
},
'&::-webkit-scrollbar-track': {
boxShadow: 'inset 0 0 6px rgba(0,0,0,0.00)',
webkitBoxShadow: 'inset 0 0 6px rgba(0,0,0,0.00)',
margin: 2
},
'&::-webkit-scrollbar-thumb': {
backgroundColor: globalTheme.palette.mellow.light,
borderRadius: 5,
margin: 1
},
'&::-webkit-scrollbar-thumb:hover': {
backgroundColor: globalTheme.palette.mellow.main
}
};

export default createTheme({
...globalTheme,
typography: {
fontFamily: 'Poppins',
fontSize: 13,
button: {
textTransform: 'none'
},
h3: {
fontSize: '1.4rem',
fontWeight: 600
},
h4: {
fontSize: '1.3rem',
fontWeight: 600
},
h5: {
fontSize: '1rem'
},
body2: {
fontSize: '0.8rem'
}
},
components: {
MuiMenu: {
Expand All @@ -26,7 +106,8 @@ export default createTheme({
MuiDivider: {
styleOverrides: {
root: {
margin: 0
margin: 0,
borderColor: globalTheme.palette.mellow.main
},
margin: 0
}
Expand Down Expand Up @@ -88,12 +169,51 @@ export default createTheme({
}
}
},
MuiButton: {
styleOverrides: {
root: {
background: globalTheme.palette.primary.dark,
'&:hover': {
background: globalTheme.palette.primary.light
},
'&:disabled': {
opacity: 0.4,
color: globalTheme.palette.primary.contrastText,
background: globalTheme.palette.mellow.main
},
borderRadius: globalTheme.shape.borderRadius,
borderColor: globalTheme.palette.primary.light,
paddingBottom: 0,
paddingTop: 0,
minHeight: 35
},
text: {
color: globalTheme.palette.primary.contrastText
}
}
},
MuiCardHeader: {
styleOverrides: {
root: {
backgroundColor: 'whitesmoke',
backgroundColor: globalTheme.palette.primary.main,
marginBottom: 0,
padding: 5
},
title: {
color: globalTheme.palette.primary.contrastText
},
avatar: {
color: globalTheme.palette.primary.contrastText
},
subheader: {
color: globalTheme.palette.primary.contrastText
}
}
},
MuiCardContent: {
styleOverrides: {
root: {
borderRadius: globalTheme.shape.borderRadius
}
}
},
Expand All @@ -117,6 +237,45 @@ export default createTheme({
}
}
}
},
MuiPaper: {
styleOverrides: {
root: {
backgroundColor: globalTheme.palette.background.default,
border: '1px solid',
borderColor: globalTheme.palette.primary.dark,
...scrollbarStyles
}
}
},
MuiGrid: {
styleOverrides: {
root: {
...scrollbarStyles
}
}
},
MuiTableContainer: {
styleOverrides: {
root: {
...scrollbarStyles
}
}
},
MuiTablePagination: {
styleOverrides: {
root: {
...scrollbarStyles
}
}
},
MuiTableCell: {
styleOverrides: {
root: {
borderBottom: '1px solid',
borderColor: globalTheme.palette.mellow.main
}
}
}
}
});
22 changes: 19 additions & 3 deletions projects/mercury/src/collections/CollectionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Card,
CardContent,
CardHeader,
Divider,
FormControl,
FormGroup,
FormLabel,
Expand All @@ -18,6 +19,7 @@ import {
} from '@mui/material';
import {CloudDownload, Folder, MoreVert} from '@mui/icons-material';
import {useHistory, withRouter} from 'react-router-dom';
import withStyles from '@mui/styles/withStyles';

import CollectionEditor from './CollectionEditor';
import type {Collection, Resource, Status} from './CollectionAPI';
Expand Down Expand Up @@ -75,6 +77,14 @@ type CollectionDetailsState = {
anchorEl: any
};

const styles = theme => ({
card: {
'& .MuiCardHeader-root .MuiSvgIcon-root': {
color: theme.palette.primary.contrastText
}
}
});

class CollectionDetails extends React.Component<CollectionDetailsProps, CollectionDetailsState> {
static defaultProps = {
onChangeOwner: () => {},
Expand Down Expand Up @@ -265,6 +275,7 @@ class CollectionDetails extends React.Component<CollectionDetailsProps, Collecti

renderDeleted = (dateDeleted: string, deletedBy: User) =>
dateDeleted && [
<Divider component="li" />,
<ListItem key="dateDeleted" disableGutters>
<FormControl>
<FormLabel>Deleted</FormLabel>
Expand All @@ -273,6 +284,7 @@ class CollectionDetails extends React.Component<CollectionDetailsProps, Collecti
</FormGroup>
</FormControl>
</ListItem>,
<Divider component="li" />,
<ListItem key="deletedBy" disableGutters>
<FormControl>
<FormLabel>Deleted by</FormLabel>
Expand Down Expand Up @@ -351,7 +363,7 @@ class CollectionDetails extends React.Component<CollectionDetailsProps, Collecti

return (
<>
<Card>
<Card className={this.props.classes.card}>
<CardHeader
action={
menuItems &&
Expand All @@ -363,6 +375,7 @@ class CollectionDetails extends React.Component<CollectionDetailsProps, Collecti
aria-owns={anchorEl ? 'long-menu' : undefined}
aria-haspopup="true"
onClick={this.handleMenuClick}
styles={{color: 'white'}}
>
<MoreVert />
</IconButton>
Expand All @@ -388,7 +401,10 @@ class CollectionDetails extends React.Component<CollectionDetailsProps, Collecti
{collection.description}
</Typography>
<List>
<ListItem disableGutters>{this.renderCollectionOwner(ownerWorkspace)}</ListItem>
<ListItem disableGutters divider>
{this.renderCollectionOwner(ownerWorkspace)}
</ListItem>
<Divider component="li" />
<ListItem disableGutters>{this.renderCollectionStatus()}</ListItem>
{this.renderDeleted(collection.dateDeleted, deletedBy)}
</List>
Expand Down Expand Up @@ -540,4 +556,4 @@ const ContextualCollectionDetails = props => {
);
};

export default withRouter(ContextualCollectionDetails);
export default withRouter(withStyles(styles)(ContextualCollectionDetails));
2 changes: 1 addition & 1 deletion projects/mercury/src/collections/CollectionEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const formatPrefix = (prefix: string) => (prefix ? `[${prefix.replace(/[/

const styles = theme => ({
textHelperBasic: {
color: theme.palette.grey['600']
color: theme.palette.mellow.main
},
textHelperWarning: {
color: theme.palette.warning.dark
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ const useStyles = makeStyles(theme => ({
flexDirection: 'column',
outline: 'none',
transitionBorder: '.24s',
easeInOut: true
easeInOut: true,
'& .MuiCardHeader-root .MuiSvgIcon-root': {
color: theme.palette.primary.contrastText
}
},
activeStyle: {
borderColor: theme.palette.info.main,
Expand Down Expand Up @@ -222,6 +225,7 @@ const MetadataCard = props => {
{'Download '}
<Link
download="metadata.csv"
color="secondary"
href={
'data:text/csv;charset=utf-8,' +
encodeURIComponent(fileTemplate)
Expand Down
4 changes: 2 additions & 2 deletions projects/mercury/src/collections/CollectionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const CollectionsPage = (props: CollectionsPageProperties) => {
</Grid>
{showMetadataSearchButton && (
<Grid item container xs={4} justifyContent="flex-end">
<Grid item>
<Grid item className={classes.metadataButton}>
<Button variant="text" color="primary" href={getMetadataViewsPath(RESOURCES_VIEW)}>
Collection metadata search
</Button>
Expand Down Expand Up @@ -156,7 +156,7 @@ const CollectionsPage = (props: CollectionsPageProperties) => {
' Your pending changes will be lost.'
}
agreeButtonText="Navigate"
disagreeButtonText="back to form"
disagreeButtonText="Back to form"
onAgree={handleConfirmSwitchCollection}
onDisagree={handleCancelSwitchCollection}
/>
Expand Down
7 changes: 6 additions & 1 deletion projects/mercury/src/collections/CollectionsPage.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ const styles = () => ({
width: consts.MAIN_CONTENT_WIDTH
},
topBarSwitch: {
paddingLeft: 8,
textAlign: 'right',
whiteSpace: 'nowrap'
},
metadataButton: {
paddingRight: 8
},
centralPanel: {
width: consts.MAIN_CONTENT_WIDTH,
maxHeight: consts.MAIN_CONTENT_MAX_HEIGHT
maxHeight: consts.MAIN_CONTENT_MAX_HEIGHT,
paddingLeft: 0
},
sidePanel: {
width: consts.SIDE_PANEL_WIDTH
Expand Down
13 changes: 8 additions & 5 deletions projects/mercury/src/common/components/ColumnFilterInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ const useStyles = makeStyles(theme => ({
position: 'relative',
flex: 0.8,
borderRadius: theme.shape.borderRadius,
backgroundColor: alpha(theme.palette.common.white, 0.15),
'&:hover': {
backgroundColor: alpha(theme.palette.common.white, 0.25)
},
marginLeft: 0,
width: '100%',
[theme.breakpoints.up('sm')]: {
width: 'auto'
}
},
inputRoot: {
color: 'inherit',
borderRadius: theme.shape.borderRadius,
borderColor: theme.palette.primary.main,
backgroundColor: alpha(theme.palette.primary.main, 0.15),
color: theme.palette.primary.contrastText,
'&:hover': {
backgroundColor: alpha(theme.palette.primary.main, 0.25),
borderColor: theme.palette.primary.main
},
width: '100%',
fontSize: '0.9rem',
minWidth: 180,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ const useStyles = makeStyles(theme => ({
opacity: 0.4
},
backdrop: {
backgroundColor: '#747474',
backgroundColor: theme.palette.mellow.dark,
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%'
height: '100%',
borderRadius: theme.shape.borderRadius
}
}));

Expand Down
Loading

0 comments on commit f4f471e

Please sign in to comment.