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

Contagem dos alunos inscritos errada #103

Open
wants to merge 40 commits into
base: DEV
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
9b0245f
Adicionando homepage directory
Oct 25, 2021
720f882
Tentando concertar a build no netlify
viniciusflara Oct 26, 2021
21f51d3
Mudando homepage in package.json
viniciusflara Oct 27, 2021
a239c12
Merge pull request #66 from cpejr/DEV
BryanDamasceno Nov 4, 2021
9f03d0c
Merge pull request #95 from cpejr/DEV
Julia-deCastro Nov 25, 2021
27658b9
Redirect on forgot password
viniciusflara Nov 25, 2021
cf7744e
Ajuste em erro de português
Nov 25, 2021
1b9f9f8
Merge pull request #100 from cpejr/DEV
Julia-deCastro Dec 22, 2021
ca4a150
test
Jan 4, 2022
c590ae6
test
Jan 5, 2022
bb2a061
ajustes de css e no login
Jan 11, 2022
4185c74
ajustes na quantidade de docs
Jan 19, 2022
7f60148
Revert "test"
Jan 5, 2022
6526cff
Revert "test"
Jan 4, 2022
1e9ebe1
PROD
Giovannipantuzzo Feb 21, 2022
cc7cd27
FIx
Giovannipantuzzo Feb 21, 2022
29df2b9
Alterações
Feb 24, 2022
f79856a
Merge branch 'Alterações' into Alterações2.0
Feb 24, 2022
7804dae
Modal de confirmação de cadastro
Mar 1, 2022
5abff65
Loading to upload files
Giovannipantuzzo Mar 2, 2022
e0a2faa
Merge remote-tracking branch 'origin/UAT' into UAT
Giovannipantuzzo Mar 2, 2022
9626adc
Fixing loading
Giovannipantuzzo Mar 2, 2022
829ecfa
Loading fix
Giovannipantuzzo Mar 2, 2022
4f46452
Alterações nos forms
Mar 5, 2022
f0d1800
Merge branch 'teste' into UAT
Mar 5, 2022
08c3346
Ajustes
Mar 5, 2022
daaba99
Ajustes
Mar 5, 2022
e0ce00c
protocol number in modal
Giovannipantuzzo Mar 7, 2022
9f34072
Merge remote-tracking branch 'origin/UAT' into UAT
Giovannipantuzzo Mar 7, 2022
8f8cc6e
fix
Giovannipantuzzo Mar 10, 2022
f20a843
Update PROD
Giovannipantuzzo Apr 12, 2022
765a3a9
Alterações
Aug 10, 2022
41d9dea
Atualizando PROD atual
Oct 11, 2022
d329bb4
package atualizado
Oct 11, 2022
ab4b1bf
Eslint corrections
BrunoKLages Oct 11, 2022
fb89644
Merge remote-tracking branch 'origin/PROD' into UAT
NikoleRocha Oct 12, 2022
85eb743
Merge remote-tracking branch 'origin/UAT' into EmailToCandidates
BrunoKLages Oct 13, 2022
92d23c3
Minor merge corrections
BrunoKLages Oct 19, 2022
31eb90c
Fixed dashboard showing expired selective processes
BrunoKLages Oct 20, 2022
94964e0
Added case of no active process, showing the last active one
BrunoKLages Nov 5, 2022
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:14.18.2

WORKDIR /usr/PosMecanica/frontend-posmecanica

COPY . ./
COPY package*.json ./

RUN yarn cache clean
RUN yarn config set strict-ssl false

RUN yarn install

RUN yarn build

EXPOSE 3000

CMD ["yarn", "start"]
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
"extenso": "^2.0.1",
"moment": "^2.29.1",
"qs": "^6.10.1",
"querystring": "^0.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-dropzone": "^11.3.2",
"react-icons": "^4.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.2",
"react-scripts": "^5.0.0",
"react-to-pdf": "^0.0.14",
"react-to-print": "^2.12.6",
"react-toast-notifications": "^2.4.4",
Expand All @@ -32,6 +33,9 @@
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"engines": {
"node": "~14.18.2"
},
"eslintConfig": {
"extends": [
"react-app",
Expand All @@ -51,7 +55,6 @@
]
},
"devDependencies": {
"eslint": "^7.24.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/BoxResult/BoxResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function BoxResult({
{position === 'second' && dados.type && loading === false && (
<div className="ResultDiv-Grid">
{candidates?.map((listDeferItem) => {
if (listDeferItem.candidate_discipline[0].cd_dis_deferment === true) {
if (listDeferItem.candidate_discipline[0].cd_dis_deferment === 1) {
return (
<DisciplinesResult
candidate={listDeferItem}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@ import React, { useState, useEffect } from 'react';
import Box from '../BoxDashboard';
import * as managerService from '../../../services/manager/managerService';

function recentEndingDate(a, b) {
const a1 = new Date(a.process_date_end);
const b1 = new Date(b.process_date_end);
return b1 - a1;
}

function alreadyStarted(a) {
const initialDate = new Date(a.process_date_begin);
return initialDate <= new Date();
}

function BoxDashboardAdministrator() {
const [candidates, setCandidates] = useState([]);
const [processsSelective, setProcesssSelective] = useState([]);
const [activeProcesses, setActiveProcesses] = useState(true);
useEffect(async () => {
const selectiveProcesses = await managerService.getAllSelectiveProcessPainels('process_type', ['ISOLADA', 'MESTRADO', 'DOUTORADO']);
let selectiveProcesses = await managerService.getActualSelectiveProcess('process_type', ['ISOLADA', 'MESTRADO', 'DOUTORADO']);
if (selectiveProcesses.length === 0) {
const allSelectiveProcesses = await managerService.getAllSelectiveProcessPainels('process_type', ['ISOLADA', 'MESTRADO', 'DOUTORADO']);
selectiveProcesses = allSelectiveProcesses.filter(alreadyStarted).sort(recentEndingDate);
selectiveProcesses.length = 1;
setActiveProcesses(false);
}
let totalCandidates = await managerService.getCandidates('candidate_process_id', (selectiveProcesses.map((selectiveProcess) => selectiveProcess.process_id)));
totalCandidates = totalCandidates.filter((response) => {
if (response.candidate_approval !== true
Expand All @@ -19,8 +37,9 @@ function BoxDashboardAdministrator() {

return (
<Box
title="Processo Seletivo"
title={activeProcesses ? 'Processo Seletivo' : 'Último Processo Seletivo'}
subtitle="Contagem de Inscritos: "
activeProcesses={activeProcesses}
position="first"
list={candidates}
processes={processsSelective}
Expand Down
70 changes: 69 additions & 1 deletion src/components/Document/Document.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,75 @@ function SentDocuments({
text,
}) {
const handleClickShowDocs = async () => {
const url = await managerService.getUserFiles(candidate, type);
let fileName;
switch (type) {
case 'Identidade':
fileName = 'identidade';
break;

case 'CPF':
fileName = 'cpf';
break;

case 'Diploma de Graduação':
fileName = 'diploma';
break;

case 'Comprovante de Endereço':
fileName = 'endereco';
break;

case 'GRU':
fileName = 'gru';
break;

case 'Histórico Escolar':
fileName = 'historico';
break;

case 'Certidão de Nascimento ou Casamento':
fileName = 'certidao';
break;

case 'Curriculum Vitae e comprovantes (arquivo único)':
fileName = 'curriculum';
break;

case 'Proficiência em Língua Inglesa':
fileName = 'proficiencia';
break;

case 'Plano de Doutorado':
fileName = 'plano';
break;

case 'Comprovante de Mestrado':
fileName = 'mestrado';
break;

case 'Formulários para Indígenas (arquivo único)':
fileName = 'indigenas';
break;

case 'Formulários para pessoas com deficiência (arquivo único)':
fileName = 'deficiencia';
break;

case 'Certidão de Quitação Eleitoral':
fileName = 'eleitoral';
break;

case 'Comprovante de Obrigações Militares':
fileName = 'militares';
break;

case 'Páginas do Visto de Entrada no Brasil':
fileName = 'visto';
break;
default:
break;
}
const url = await managerService.getUserFiles(candidate, fileName);
window.open(`${url[0].url}`);
};
return (
Expand Down
134 changes: 113 additions & 21 deletions src/components/Forms/Forms.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
/*eslint-disable*/
import { CircularProgress } from '@material-ui/core';
import { useToasts } from 'react-toast-notifications';
import { GoVerified } from 'react-icons/go';
import React, { useState } from 'react';
import StyledInput from '../StyledInput';
import UploadInput from '../UploadInput';
import WarningModal from '../../utils/WarningModal';
import './Forms.scss';

function Forms({
initialState, formsInput, files, setFiles, handleClick, error, loading,
initialState, formsInput, files, setFiles, handleClick, error, loading, exit,
}) {
window.onbeforeunload = confirmExit;
function confirmExit() {
if (!exit) { return 'Deseja realmente sair desta página?'; }
}
const { addToast } = useToasts();
const [dados, setDados] = useState(initialState);
const handleChange = (value, field) => {
setDados({ ...dados, [field]: value });
};
const formsFile = ['Identidade', 'CPF', 'Diploma de Graduação', 'Comprovante de Endereço', 'GRU', 'Histórico Escolar', 'Certidão de Nascimento ou Casamento', 'Curriculum Vitae'];
function handleClickRedirect() {
addToast('Redirecionando...', { appearance: 'success' });
window.location.href = 'https://ppgmec.eng.ufmg.br/';
}
console.log(loading);
const formsFile = [{
formFile: ['Identidade', 'CPF', 'Diploma de Graduação', 'Comprovante de Endereço',
'GRU', 'Histórico Escolar', 'Certidão de Nascimento ou Casamento',
'Curriculum Vitae e comprovantes (arquivo único)'],

fileName: ['identidade', 'cpf', 'diploma', 'endereco',
'gru', 'historico', 'certidao', 'curriculum']
}];

return (
<div>
{formsInput.map((topic) => (
Expand Down Expand Up @@ -52,39 +74,81 @@ function Forms({
<div className="forms_box">
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file} />
<div className="forms_upload_text">{file.formFile[0]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[0]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[1]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[1]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[2]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[2]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[3]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[3]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[4]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[4]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[5]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[5]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[6]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[6]} />
</div>
))}
{formsFile.map((file) => (
<div className="forms_input_file">
<div className="forms_upload_text">{file.formFile[7]}</div>
<UploadInput files={files} setFiles={setFiles} fileName={file.fileName[7]} />
</div>
))}
<div className="forms_input_file">
<div className="forms_upload_text">Proficiência em Língua Inglesa</div>
<UploadInput files={files} setFiles={setFiles} fileName="Proficiência" />
<UploadInput files={files} setFiles={setFiles} fileName="proficiencia" />
</div>
{dados.candidate_grade === 'DOUTORADO' && (
<>
<div className="forms_input_file">
<div className="forms_upload_text">Plano de Doutorado</div>
<UploadInput files={files} setFiles={setFiles} fileName="Plano de Doutorado" />
<UploadInput files={files} setFiles={setFiles} fileName="plano" />
</div>
<div className="forms_input_file">
<div className="forms_upload_text">Comprovante de Mestrado</div>
<UploadInput files={files} setFiles={setFiles} fileName="Comprovante de Mestrado" />
<UploadInput files={files} setFiles={setFiles} fileName="mestrado" />
</div>
</>
)}
{dados.candidate_race === 'indígena' && (
<>
<div className="forms_input_file">
<div className="forms_upload_text">Formulários para Indígenas (arquivo único)</div>
<UploadInput files={files} setFiles={setFiles} fileName="Formulários para Indígenas" />
<UploadInput files={files} setFiles={setFiles} fileName="indigenas" />
</div>
</>
)}
{dados.candidate_PcD === true && (
<>
<div className="forms_input_file">
<div className="forms_upload_text">Formulários para pessoas com deficiência (arquivo único)</div>
<UploadInput files={files} setFiles={setFiles} fileName="Formulários para pessoas com deficiência" />
<UploadInput files={files} setFiles={setFiles} fileName="deficiencia" />
</div>
</>
)}
Expand All @@ -93,37 +157,65 @@ function Forms({
<>
<div className="forms_input_file">
<div className="forms_upload_text">Certidão de Quitação Eleitoral</div>
<UploadInput files={files} setFiles={setFiles} fileName="Certidão de Quitação Eleitoral" />
<UploadInput files={files} setFiles={setFiles} fileName="eleitoral" />
</div>
{dados.candidate_gender === 'masculino' && (
<div className="forms_input_file">
<div className="forms_upload_text">Comprovante de Obrigações Militares</div>
<UploadInput files={files} setFiles={setFiles} fileName="Comprovante de Obrigações Militares" />
<UploadInput files={files} setFiles={setFiles} fileName="militares" />
</div>
)}
</>
) : (
<>
<div className="forms_input_file">
<div className="forms_upload_text">Páginas do Visto de Entrada no Brasil</div>
<UploadInput files={files} setFiles={setFiles} fileName="Páginas do Visto de Entrada no Brasil" />
<UploadInput files={files} setFiles={setFiles} fileName="visto" />
</div>
</>
)}
</div>
{loading === true ? (
<div className="BdDivGridLoader">
<div className="Loader-form">
<p>Aguarde, subindo arquivos...</p>
<CircularProgress size={32} color="inherit" className="LoaderProfCandidates" />
</div>
</div>
{(loading === true) ? (
<>
{(exit === true) && (
<WarningModal>
<GoVerified size={52} color="inherit" className="LoaderProfCandidates" />
<div className="BdDivGridLoader">
<div className="Loader-form">
<p>Cadastro Realizado com sucesso!</p>
<p>Verifique o número de protocolo em seu email.</p>
</div>
</div>
<div className="postButton">
<button
className="buttonPost"
type="submit"
onClick={(e) => handleClickRedirect(e)}
>
OK
</button>
</div>
</WarningModal>
)}
{(exit === false) && (
<WarningModal>
<div className="BdDivGridLoader">
<div className="Loader-form">
<p>Aguarde, subindo arquivos...</p>
<p>Por gentileza, não saia da página</p>
<br />
<CircularProgress size={32} color="inherit" className="LoaderProfCandidates" />
</div>
</div>
</WarningModal>
)}
</>
) : (
<div className="forms_divButton">
<button type="submit" onClick={(e) => handleClick(e, dados)}>Cadastrar</button>
<button type="submit" id="botao" onClick={(e) => handleClick(e, dados)}>Cadastrar</button>
</div>
)}
</div>
);
}
export default Forms;
export default Forms;
Loading