Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial version of a new Fairspace 2.0 user interface #1529

Merged
merged 13 commits into from
Jul 24, 2024
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
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.
157 changes: 151 additions & 6 deletions projects/mercury/src/App.theme.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,76 @@
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: '#fd759e',
contrastText: 'white'
},
error: pink,
success: {
main: '#08a045'
},
background: {
default: '#eef0eb'
},
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: ['Sora', 'Palanquin'].join(','),
fontSize: 13,
button: {
textTransform: 'none'
}
},
components: {
MuiMenu: {
Expand All @@ -26,7 +92,8 @@ export default createTheme({
MuiDivider: {
styleOverrides: {
root: {
margin: 0
margin: 0,
borderColor: globalTheme.palette.mellow.main
},
margin: 0
}
Expand Down Expand Up @@ -88,12 +155,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 +223,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));
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
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
3 changes: 2 additions & 1 deletion projects/mercury/src/dashboard/DomainInfo.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const styles = theme => ({
height: '100px',
borderStyle: 'solid',
borderColor: theme.palette.primary.light,
background: theme.palette.primary.dark,
borderWidth: 2,
textAlign: 'center'
},
Expand All @@ -25,7 +26,7 @@ const styles = theme => ({
width: 'inherit'
},
domainText: {
color: theme.palette.grey[700]
color: theme.palette.primary.contrastText
},
link: {
textDecoration: 'none'
Expand Down
Loading
Loading