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

Bring all old files #32

Merged
merged 1 commit into from
Apr 25, 2024
Merged
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
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@
"no-unused-vars": [
"warn",
{
"args": "all",
"argsIgnorePattern": "^_"
"args": "none"
}
],
"comma-dangle": [
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules/
*.env*
!.env.example
.eslintcache

*.log
45 changes: 0 additions & 45 deletions npm-debug.log

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"scripts": {
"lint:typescript": "tsc --noEmit",
"lint:eslint": "eslint --quiet --cache --fix --ext '.js,.ts,.tsx' .",
"lint:eslint": "eslint --cache --fix --ext '.js,.ts,.tsx' .",
"lint": "run-p lint:typescript lint:eslint",
"clean": "rimraf dist",
"build:app": "babel src -d dist --copy-files",
Expand Down
1 change: 1 addition & 0 deletions src/controllers/fichas-tombos-controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import moment from 'moment-timezone';
import path from 'path';

import { converteDecimalParaGMSSinal } from '~/helpers/coordenadas';

import formataColunasSeparadas from '../helpers/formata-colunas-separadas';
Expand Down Expand Up @@ -188,7 +189,7 @@
const romanos = ['I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX', 'X', 'XI', 'XII'];
const dataTombo = new Date(tombo.data_tombo);
const romanoDataTombo = (`${dataTombo.getDate()}/${romanos[dataTombo.getMonth()]}/${dataTombo.getFullYear()}`);
const romanoDataIdentificacao = (`${identificacao.data_identificacao_dia}/${romanos[identificacao.data_identificacao_mes - 1]}/${identificacao.data_identificacao_ano}`);

Check warning on line 192 in src/controllers/fichas-tombos-controller.js

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 181. Maximum allowed is 150
const romanoDataColeta = (`${tombo.data_coleta_dia}/${romanos[tombo.data_coleta_mes - 1]}/${tombo.data_coleta_ano}`);

const parametros = {
Expand Down
2 changes: 1 addition & 1 deletion src/herbarium/reflora/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function daemonFazRequisicaoReflora() {
}
}
});
}, 60000);
}, 7200000);
}

export default {};
2 changes: 1 addition & 1 deletion src/herbarium/specieslink/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function daemonSpeciesLink() {
}
}
});
}, 60000);
}, 7200000);
}

export default {};
4 changes: 4 additions & 0 deletions src/routes/pendencias.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import tokensMiddleware, { TIPOS_USUARIOS } from '../middlewares/tokens-middlewa
const controller = require('../controllers/pendencias-controller');

export default app => {

app.route('/pendencias/TomboId/:tombo_id')
.get([
controller.verificaAlteracao,
Expand Down Expand Up @@ -34,6 +35,8 @@ export default app => {
.post([
tokensMiddleware([
TIPOS_USUARIOS.CURADOR,
TIPOS_USUARIOS.OPERADOR,
TIPOS_USUARIOS.IDENTIFICADOR,
]),
controller.aceitarPendencia,
])
Expand All @@ -43,4 +46,5 @@ export default app => {
]),
controller.avaliaPendencia,
]);

};
8 changes: 2 additions & 6 deletions src/routes/tombos.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import fichaTomboController from '../controllers/fichas-tombos-controller';
import {
getDadosCadTombo, getNumeroTombo, cadastro, listagem,
desativar, obterTombo, cadastrarTipo, buscarTipos, cadastrarColetores, buscarColetores,
buscarProximoNumeroColetor, alteracao, getNumeroColetor, getCodigoBarraTombo,
deletarCodigoBarra, editarCodigoBarra, getUltimoNumeroCodigoBarras,
getUltimoNumeroTombo,
buscarProximoNumeroColetor, alteracao, getNumeroColetor, getUltimoNumeroTombo, getCodigoBarraTombo,
editarCodigoBarra, deletarCodigoBarra, getUltimoNumeroCodigoBarras,
} from '../controllers/tombos-controller';
import exportarTombosController from '../controllers/tombos-exportacoes-controller';
import criaJsonMiddleware from '../middlewares/json-middleware';
Expand Down Expand Up @@ -141,7 +140,4 @@ export default app => {

app.route('/fichas/tombos/:tombo_id/:imprimir_cod')
.get(fichaTomboController);

// app.route('/fichas/tombos/:tombo_id')
// .get(fichaTomboController);
};
2 changes: 1 addition & 1 deletion src/validators/coletor-cadastro.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export default {
numero: {
in: 'body',
isInt: true,
optional: true,
isEmpty: false,
},
};
86 changes: 71 additions & 15 deletions src/views/ficha-tombo.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
</head>

<body>
<% if ( imprimir === '0') { %>
<% fotos.length = 1%>
<% } %>
<% for (let i = 0; i < fotos.length; i++) { %>
<% if (i !== 0 && i % 3 === 0) { %>
<div class="break-line-before" style="height: 20px"></div>
Expand All @@ -93,23 +96,42 @@
<b>HCF:</b> <%- tombo.hcf %>
</td>
<td colspan="2">
<b>Data:</b> <%- tombo.data_tombo %>
<b>Data:</b> <%- romano_data_tombo %>
</td>
</tr>
<% if (familia && familia.nome) { %>
<tr>
<td colspan="4">
<b>Família:</b> <%- tombo.familia.nome %>
<b>Família: </b> <%- tombo.familia.nome %>
</td>
</tr>
<% } %>
<% if (especie && especie.nome) { %>
<tr>
<td colspan="4">
<b>Espécie:</b> <%- especie.nome %>
<b>Espécie:</b>
<% if (genero && genero.nome) { %>
<i><%- genero.nome %></i>
<% } %>
<% if (especie && especie.nome) { %>
<i><%- especie.nome %></i>
<% } %>
<% if (especie && especie.autore) { %>
<%- especie.autore.nome %>
<% } %>
<% if (variedade && variedade.nome) { %>
var. <i><%- variedade.nome %></i>
<% } %>
<% if (variedade && variedade.autore) { %>
<%- variedade.autore.nome %>
<% } %>
<% if (subespecie && subespecie.nome) { %>
ssp. <i><%- subespecie.nome %></i>
<% } %>
<% if (subespecie && subespecie.autore) { %>
<%- subespecie.autore.nome %>
<% } %>
</td>
</tr>
<% } %>
<tr>
<td colspan="4" class="linha-vazia"></td>
</tr>
Expand All @@ -124,26 +146,60 @@
<b>Identificador:</b> <%- identificacao.usuario.nome %>
</td>
<td>
<b>Data:</b> <%- identificacao.data_identificacao %>
<b>Data:</b> <%- romano_data_identificacao %>
</td>
</tr>
<% } %>
<tr>
<td colspan="4">
<b>Local de coleta:</b>
<%- localColeta.descricao %>
- <%- localColeta.complemento %>
- <%- cidade.nome %>
- <%- cidade.estado.nome %>
- <%- cidade.estado.pais.nome %>
<% if (localColeta && localColeta.complemento) { %>
<%- localColeta.complemento %>
<% } %>
<% if (localColeta && localColeta.descricao) { %>
- <%- localColeta.descricao %>
<% } %>
<% if (cidade && cidade.nome) { %>
- <%- cidade.nome %>
<% } %>
<% if (cidade && cidade.estado) { %>
- <%- cidade.estado.nome %>
<% } %>
<% if (cidade && cidade.estado && cidade.estado.pais) { %>
- <%- cidade.estado.pais.nome %>
<% } %>
</td>
</tr>
<tr>
<td colspan="4" class="linha-vazia"></td>
</tr>
<tr>
<td colspan="4">
<b>Observações:</b> <%- tombo.observacao %>
<b>Observações:</b>
<% if (tombo && tombo.observacao) { %>
<%- tombo.observacao %>
<% } %>
<% if (tombo && tombo.latitude) { %>
- Latitude: <%- tombo.latitude %>
<% } %>
<% if (tombo && tombo.longitude) { %>
- Longitude: <%- tombo.longitude %>
<% } %>
<% if (tombo && tombo.altitude) { %>
- Altitude: <%- tombo.altitude %>
<% } %>
<% if (localColeta && localColeta.solo) { %>
- Solo: <%- localColeta.solo.nome %>
<% } %>
<% if (localColeta && localColeta.relevo) { %>
- Relevo: <%- localColeta.relevo.nome %>
<% } %>
<% if (localColeta && localColeta.vegetaco) { %>
- Vegetação: <%- localColeta.vegetaco.nome %>
<% } %>
<% if (localColeta && localColeta.fase_sucessional) { %>
- Fase sucessional: <%- localColeta.fase_sucessional.nome %>
<% } %>
</td>
</tr>
<tr>
Expand All @@ -160,18 +216,18 @@
<b>nº:</b> <%- tombo.numero_coleta %>
</td>
<td width="21%" class="text-right">
<b>Data:</b> <%- tombo.data_coleta %>
<b>Data:</b> <%- romano_data_coleta %>
</td>
</tr>
<% if (!!fotos[i]['id']) { %>
<% if (!!fotos[i]['id'] && imprimir !== '0') { %>
<tr>
<td colspan="4" class="text-right">
<svg id="<%- 'code128_' + fotos[i]['id'] %>"></svg>
</td>
</tr>
<% } %>
</table>
<% if (!!fotos[i]['id']) { %>
<% if (!!fotos[i]['id'] && imprimir !== '0') { %>
<script>
window.addEventListener('load', () => {
const id = "<%- '#code128_' + fotos[i]['id'] %>";
Expand Down
Loading