Skip to content

Commit

Permalink
fix(ci): build
Browse files Browse the repository at this point in the history
  • Loading branch information
VladyslavKurmaz committed Jan 27, 2025
1 parent c48111d commit 6903388
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 99 deletions.
46 changes: 23 additions & 23 deletions app/src/components/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,32 +190,32 @@ function Dashboard() {
const theme = useTheme();

const [projects, setProjects ] = React.useState([]);
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/projects`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setProjects(data.data.projects.map((p) => {
const size = p.summary.team.reduce((acc, member) => acc + (member.bandwidth[0].fte > 0 ? 1 : 0), 0);
const total = p.summary.team.length;
return ({
...p,
release: getClosestRelease(p.summary.timeline),
team: { size, total },
lastUpdateTime: getLastUpdateTime(p.summary)});
}));
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
//
React.useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/projects`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setProjects(data.data.projects.map((p) => {
const size = p.summary.team.reduce((acc, member) => acc + (member.bandwidth[0].fte > 0 ? 1 : 0), 0);
const total = p.summary.team.length;
return ({
...p,
release: getClosestRelease(p.summary.timeline),
team: { size, total },
lastUpdateTime: getLastUpdateTime(p.summary)});
}));
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
fetchData();
}, []);
}, [config.apiBaseUrl]);
//
// const [mode, setMode] = React.useState('full');
// const handleMode = (event, newMode) => {
Expand Down
30 changes: 15 additions & 15 deletions app/src/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ function Header() {
//
const { config } = React.useContext(StateContext);
const [version, setVersion] = React.useState('');
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/info`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setVersion(data.data.version);
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
React.useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/info`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setVersion(data.data.version);
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
fetchData();
}, []);
}, [config.apiBaseUrl]);

return (
<AppBar position="static">
Expand Down
8 changes: 4 additions & 4 deletions app/src/components/Srs.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Container from '@mui/material/Container';
import { useTheme } from '@mui/material/styles';
// import { useTheme } from '@mui/material/styles';

import StateContext from '../StateContext';
// import StateContext from '../StateContext';

function Srs() {
const { config } = React.useContext(StateContext);
const theme = useTheme();
// const { config } = React.useContext(StateContext);
// const theme = useTheme();
// const [tasks, setTasks] = React.useState([]);
// const fetchData = async () => {
// try {
Expand Down
82 changes: 41 additions & 41 deletions app/src/components/Team.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,50 @@ function Team() {
const [showZeroFte, setShowZeroFte] = React.useState(false);
const [, setTeam] = React.useState('');
const [rows, setRows] = React.useState([]);
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/teams`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setTeam(data.data);
setRows(data.data.team.map((m) => {
const fte = m.bandwidth.reduce((acc, b) => acc + b.fte, 0.0);
// const name = m.name;
const total = m.summary.todo + m.summary.dev + m.summary.blocked;
const persents = [m.summary.todo, m.summary.dev, m.summary.blocked].map((b) => {
return total > 0 ? Math.round(100*b/total) + '%' : '0%';
});
return ({
id: m.id,
name: (
<>{m.name}<br/>{
m.bandwidth.length > 1 ? m.bandwidth.map(b => (<>{b.email} ({b.fte})<br/></>)) : m.bandwidth[0].email
}</>
),
fte,
done: m.summary.done,
total: m.summary.total,
status: (
<Box sx={{display: 'flex', flexDirection: 'row', color: 'white', backgroundColor: 'black', borderRadius: 4, overflow: 'hidden'}}>
<Box sx={{width: persents[0], backgroundColor: theme.tasks.todo.backgroundColor, color: theme.tasks.todo.color}}>{m.summary.todo}</Box>
<Box sx={{width: persents[1], backgroundColor: theme.tasks.dev.backgroundColor, color: theme.tasks.dev.color}}>{m.summary.dev}</Box>
<Box sx={{width: persents[2], backgroundColor: theme.tasks.blocked.backgroundColor, color: theme.tasks.blocked.color}}>{m.summary.blocked}</Box>
</Box>
)
});
}));
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
//
React.useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/teams`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setTeam(data.data);
setRows(data.data.team.map((m) => {
const fte = m.bandwidth.reduce((acc, b) => acc + b.fte, 0.0);
// const name = m.name;
const total = m.summary.todo + m.summary.dev + m.summary.blocked;
const persents = [m.summary.todo, m.summary.dev, m.summary.blocked].map((b) => {
return total > 0 ? Math.round(100*b/total) + '%' : '0%';
});
return ({
id: m.id,
name: (
<>{m.name}<br/>{
m.bandwidth.length > 1 ? m.bandwidth.map(b => (<>{b.email} ({b.fte})<br/></>)) : m.bandwidth[0].email
}</>
),
fte,
done: m.summary.done,
total: m.summary.total,
status: (
<Box sx={{display: 'flex', flexDirection: 'row', color: 'white', backgroundColor: 'black', borderRadius: 4, overflow: 'hidden'}}>
<Box sx={{width: persents[0], backgroundColor: theme.tasks.todo.backgroundColor, color: theme.tasks.todo.color}}>{m.summary.todo}</Box>
<Box sx={{width: persents[1], backgroundColor: theme.tasks.dev.backgroundColor, color: theme.tasks.dev.color}}>{m.summary.dev}</Box>
<Box sx={{width: persents[2], backgroundColor: theme.tasks.blocked.backgroundColor, color: theme.tasks.blocked.color}}>{m.summary.blocked}</Box>
</Box>
)
});
}));
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
fetchData();
}, []);
}, [config.apiBaseUrl, theme]);
const [page, setPage] = React.useState(0);
const [rowsPerPage, setRowsPerPage] = React.useState(10);

Expand Down
32 changes: 16 additions & 16 deletions app/src/components/Timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,25 +291,25 @@ Highcharts.addEvent(Highcharts.Axis, 'foundExtremes', e => {
function Timeline() {
const { config } = React.useContext(StateContext);
const theme = useTheme();
const [tasks, setTasks] = React.useState([]);
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/tasks`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setTasks(data.data.tasks);
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
const [/*tasks*/, setTasks] = React.useState([]);
//
React.useEffect(() => {
const fetchData = async () => {
try {
const response = await fetch(`${config.apiBaseUrl}/tasks`);
if (!response.ok) {
throw new Error('Network response was not ok.');
}
const data = await response.json();
setTasks(data.data.tasks);
// setLoading(false);
} catch (error) {
// setError(error.message);
// setLoading(false);
}
};
fetchData();
}, []);
}, [config.apiBaseUrl]);

return (
<Container maxWidth="xl" sx={{pt: 2}}>
Expand Down

0 comments on commit 6903388

Please sign in to comment.