Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
17,643 changes: 17,643 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "iColabora",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"axios": "^0.27.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"sass": "^1.53.0",
"sss": "^0.1.1",
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
11 changes: 11 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>iColabora</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
55 changes: 55 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React from 'react';
import { useEffect, useState } from 'react';
import api from "./services/api";
import './Style.scss'

export default function App() {



const [relatorio, setRelatorio] = useState([]);

useEffect(() => {
api
.get("/v1/histograma/")
.then((response) => {
setRelatorio(response.data)
})
.catch((err) => {
console.error("ocorreu um erro" + err);
});
}, []);

return(
<>
{console.log(relatorio)}
<div className="container">
<table>
<tr>
<th>Tarefa</th>
<th>Vencido</th>
<th>D0</th>
<th>D1</th>
<th>D2</th>
<th>D3</th>
<th>TOTAL</th>
</tr>

{relatorio.map(linhaDoRelatorioAtual => {
return (
<tr>
<td>{linhaDoRelatorioAtual.TAREFA}</td>
<td>{linhaDoRelatorioAtual.VENCIDO}</td>
<td>{linhaDoRelatorioAtual.D0}</td>
<td>{linhaDoRelatorioAtual.D1}</td>
<td>{linhaDoRelatorioAtual.D2}</td>
<td>{linhaDoRelatorioAtual.D3}</td>
<td>{linhaDoRelatorioAtual.TOTAL}</td>
</tr>
)

})}
</table>
</div>
</>
)}
81 changes: 81 additions & 0 deletions src/Style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
table {
font: 1em Arial, Helvetica, sans-serif;
font-weight: bold;
border: 0;
width: 100%;
border-spacing: 0;

td {
margin: 0;
padding: 1%;
text-align: center;
cursor: pointer;
}



tr:nth-child(1) {
pointer-events: none;
background-color: #102938;
th:nth-child(1) {
text-align: left;
}
th{
color: #f5f5f5;
padding: 1%;

}
}

tr:hover {
opacity: 1;
}

tr {
opacity: 0.9;
td:nth-child(1) {
background-color: #f5f5f5;
width: 30%;
text-align: left;
}
td:nth-child(1):hover {
background-color: #3fc3a2;
}
td:nth-child(2) {
background-color: #b2ebf2;
width: 20%;
}
td:nth-child(3) {
background-color: #f96585;
width: 10%;
}
td:nth-child(4) {
background-color: #f98585;
width: 10%;
}
td:nth-child(5) {
background-color: #f9a385;
width: 10%;
}
td:nth-child(6) {
background-color: #f9be85;
width: 10%;
}
td:nth-child(7) {
background-color: #b2ebf2;
width: 10%;

}
}

tr:nth-child(6) {
pointer-events: none;
td{
color: #f5f5f5;
background-color: #424242;
}
}



}
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'


ReactDOM.render(<App/>, document.getElementById('root'))
7 changes: 7 additions & 0 deletions src/services/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import axios from "axios";

const api = axios.create({
baseURL: "https://ico-fullstack-test.herokuapp.com",
})

export default api;