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

Upgrade frontend packages #917

Merged
merged 24 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
efeb9f5
Upgrade cronstrue and react-timeago
auloin Jan 12, 2024
570095b
Update react-scripts, apexcharts and react-highlight
auloin Jan 15, 2024
9204f24
Update react to v17
auloin Jan 15, 2024
38090a1
Remove unnecessary react import
auloin Jan 15, 2024
1327cab
Upgrade material-ui
auloin Jan 15, 2024
4004e45
Fix styling issues
auloin Jan 17, 2024
8e71496
Remove mui/lab and upgrade mdi-material-ui
auloin Jan 17, 2024
41136c9
Use react-router Route's children prop instead of component
auloin Jan 17, 2024
7d97723
Move Redirect rendering out of Switch
auloin Jan 17, 2024
1d5b641
Upgrade react router
auloin Jan 17, 2024
734430f
Upgrade react to v18
auloin Jan 17, 2024
c50d2b5
Remove deprecated @mui/styles
auloin Jan 18, 2024
86d615b
Upgrade cypress and move react-scripts to dev dependencies
auloin Jan 18, 2024
7cd1db4
Use react-syntax-highlighter instead of react-highlighter as no longe…
auloin Jan 18, 2024
2b2ba9e
Fix cypress tests and fix remnant react-highlighter usage
auloin Jan 18, 2024
bf21008
Upgrade CypressTestContainer's cypress version
auloin Jan 19, 2024
5d5806d
Use androidstudio syntax highlighting style
auloin Jan 19, 2024
68cd242
Fix default export
auloin Jan 19, 2024
8f0c404
Fix problems ordering
auloin Jan 22, 2024
f939cc9
Make problem notification composable
auloin Jan 22, 2024
32b9813
Improve StatCard
auloin Jan 22, 2024
d04e641
Refactor job state components
auloin Jan 23, 2024
4b06ec2
Fix styling issues
auloin Jan 23, 2024
3eea87b
Inline all styles or move to component
auloin Jan 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

Expand Up @@ -36,9 +36,9 @@ context('Actions', () => {

jobTableRows().should('have.length', 20);
jobTableRows().eq(0).should('contain', 'an enqueued job');
jobTablePagination().should('contain', '1-20 of 33');
jobTablePagination().previousButton().should('have.attr', 'title', 'Previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Next page').and('be.enabled');
jobTablePagination().should('contain', '120 of 33');
jobTablePagination().previousButton().should('have.attr', 'title', 'Go to previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Go to next page').and('be.enabled');
});


Expand All @@ -49,9 +49,9 @@ context('Actions', () => {

jobTableRows().should('have.length', 1);
jobTableRows().eq(0).should('contain', 'the job');
jobTablePagination().should('contain', '1-1 of 1');
jobTablePagination().previousButton().should('have.attr', 'title', 'Previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Next page').and('be.disabled');
jobTablePagination().should('contain', '11 of 1');
jobTablePagination().previousButton().should('have.attr', 'title', 'Go to previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Go to next page').and('be.disabled');
});

it('It can navigate to the enqueued jobs', () => {
Expand All @@ -61,9 +61,9 @@ context('Actions', () => {

jobTableRows().should('have.length', 20);
jobTableRows().eq(0).should('contain', 'an enqueued job');
jobTablePagination().should('contain', '1-20 of 33');
jobTablePagination().previousButton().should('have.attr', 'title', 'Previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Next page').and('be.enabled');
jobTablePagination().should('contain', '120 of 33');
jobTablePagination().previousButton().should('have.attr', 'title', 'Go to previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Go to next page').and('be.enabled');
});

it('It can navigate to the processing jobs', () => {
Expand All @@ -82,9 +82,9 @@ context('Actions', () => {

jobTableRows().should('have.length', 2);
jobTableRows().eq(0).should('contain', 'a succeeded job');
jobTablePagination().should('contain', '1-2 of 2');
jobTablePagination().previousButton().should('have.attr', 'title', 'Previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Next page').and('be.disabled');
jobTablePagination().should('contain', '12 of 2');
jobTablePagination().previousButton().should('have.attr', 'title', 'Go to previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Go to next page').and('be.disabled');
});

it('It can navigate to the failed jobs', () => {
Expand All @@ -94,9 +94,9 @@ context('Actions', () => {

jobTableRows().should('have.length', 1);
jobTableRows().eq(0).should('contain', 'failed job');
jobTablePagination().should('contain', '1-1 of 1');
jobTablePagination().previousButton().should('have.attr', 'title', 'Previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Next page').and('be.disabled');
jobTablePagination().should('contain', '11 of 1');
jobTablePagination().previousButton().should('have.attr', 'title', 'Go to previous page').and('be.disabled');
jobTablePagination().nextButton().should('have.attr', 'title', 'Go to next page').and('be.disabled');
});

it('It can navigate to the details of a job', () => {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

31 changes: 16 additions & 15 deletions core/src/main/resources/org/jobrunr/dashboard/frontend/package.json
Expand Up @@ -5,19 +5,19 @@
"homepage": "",
"proxy": "http://localhost:8000",
"dependencies": {
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
"apexcharts": "^3.26.1",
"cronstrue": "^1.112.0",
"mdi-material-ui": "^6.22.1",
"react": "^16.14.0",
"react-apexcharts": "^1.3.9",
"react-dom": "^16.14.0",
"react-highlight": "^0.14.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"react-timeago": "^5.2.0"
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.15.4",
"@mui/material": "^5.15.4",
"apexcharts": "^3.41.0",
"cronstrue": "^2.47.0",
"mdi-material-ui": "^7.8.0",
"react": "^18.2.0",
"react-apexcharts": "^1.4.1",
"react-dom": "^18.2.0",
"react-router-dom": "^6.21.2",
"react-syntax-highlighter": "^15.5.0",
"react-timeago": "^7.2.0"
},
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
Expand All @@ -42,8 +42,9 @@
]
},
"devDependencies": {
"cypress": "^4.12.1",
"cypress": "^13.6.3",
"cypress-failed-log": "^2.7.0",
"owasp-dependency-check": "^0.0.17"
"owasp-dependency-check": "^0.0.21",
"react-scripts": "^5.0.1"
}
}
@@ -1,5 +1,4 @@
import React from 'react';
import {CircularProgress} from "@material-ui/core";
import {CircularProgress} from "@mui/material";

const LoadingIndicator = () => {
return (
Expand Down
@@ -1,21 +1,8 @@
import Grid from "@material-ui/core/Grid";
import Highlight from "react-highlight";
import React from "react";
import {makeStyles} from "@material-ui/core/styles";

const useStyles = makeStyles(theme => ({
codeContent: {
marginTop: 0,
paddingTop: "0 !important",
'& > pre': {
marginTop: 0,
}
}
}));
import Grid from "@mui/material/Grid";
import Highlight from "../utils/highlighter";

const JobCode = (props) => {
const { job } = props;
const classes = useStyles();
const {job} = props;

const fqClassName = job.jobDetails.className;
const className = job.jobDetails.className.substring(job.jobDetails.className.lastIndexOf(".") + 1);
Expand All @@ -24,7 +11,7 @@ const JobCode = (props) => {
const parameters = job.jobDetails.jobParameters.map(jobParameter => jobParameter.object).join(", ")

let totalFunction = className;
if(staticFieldName) {
if (staticFieldName) {
totalFunction += "." + staticFieldName;
}
totalFunction += "." + methodName;
Expand All @@ -38,8 +25,8 @@ const JobCode = (props) => {
`;

return (
<Grid item xs={12} className={classes.codeContent}>
<Highlight className='language-java'>
<Grid item xs={12} sx={{marginTop: 0, paddingTop: "0 !important", '& > pre': {marginTop: 0}}}>
<Highlight language="java">
{code}
</Highlight>
</Grid>
Expand Down
@@ -1,17 +1,21 @@
import React from 'react';
import Alert from '@material-ui/lab/Alert';
import {Snackbar} from "@material-ui/core";
import { useState } from 'react';
import Alert from '@mui/material/Alert';
import {Snackbar} from "@mui/material";


const JobSnackbar = (props) => {
const [openSnackbar, setOpenSnackbar] = React.useState(false);
const [openSnackbar, setOpenSnackbar] = useState(false);

const handleCloseAlert = (event, reason) => {
setOpenSnackbar(false);
};

return (
<Snackbar open={openSnackbar} autoHideDuration={3000} onClose={handleCloseAlert}>
<Snackbar open={openSnackbar}
autoHideDuration={3000}
onClose={handleCloseAlert}
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
>
<Alert severity={props.severity}>
{props.message}
</Alert>
Expand Down