Skip to content

Commit

Permalink
Merge pull request #9 from VitorCarvalho67/dev
Browse files Browse the repository at this point in the history
Fix Error on createVinculo, add acceptVinculo, getVinculos and ignore…
  • Loading branch information
VitorCarvalho67 authored May 24, 2024
2 parents 9ee9bac + 46c4d12 commit 1ed78ee
Show file tree
Hide file tree
Showing 17 changed files with 455 additions and 141 deletions.
46 changes: 18 additions & 28 deletions client/src/components/Cards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,12 @@
<div class="wrapper">
<i class="fa-solid fa-angle-left" @click="scrollCarousel('left')"></i>
<ul class="carousel" ref="carousel">
<li class="card">
<li class="card" v-for="(slide, index) in slides" :key="index">
<div class="img">

</div>
<h2>Desenvolvimento</h2>
<span>Código aberto e feito pela comunidade</span>
</li>
<li class="card">
<div class="img">

</div>
<h2>Simplificação</h2>
<span>Elaboração automática de seus perfis profissionais</span>
</li>
<li class="card">
<div class="img">

</div>
<h2>Eficiente</h2>
<span>Software intuitivo com sistema de busca eficiente</span>
</li>
<li class="card">
<div class="img">

<img :src="slide.image" :alt="slide.title">
</div>
<h2>Visibilidade empresarial</h2>
<span>Facilidade de acesso aos perfis em procura por empresas</span>
<h2>{{ slide.title }}</h2>
<span>{{ slide.description }}</span>
</li>
</ul>
<i class="fa-solid fa-angle-right" @click="scrollCarousel('right')"></i>
Expand All @@ -41,6 +20,10 @@

<script>
import { ref, onMounted, onUnmounted } from 'vue';
import Slide1Image from '../assets/imgs/img4.jpg';
import Slide2Image from '../assets/imgs/img2.jpg';
import Slide3Image from '../assets/imgs/img3.jpg';
import Slide4Image from '../assets/imgs/img1.jpg';
export default {
name: 'Cards',
Expand All @@ -51,15 +34,20 @@ export default {
const startScrollLeft = ref(0);
const timeoutId = ref(null);
const firstCardWidth = ref(0);
const cardPerView = ref(0);
const slides = ref([
{ image: Slide1Image, title: 'Desenvolvimento', description: 'Código aberto e feito pela comunidade' },
{ image: Slide2Image, title: 'Simplificação', description: 'Elaboração automática de seus perfis profissionais' },
{ image: Slide3Image, title: 'Eficiente', description: 'Software intuitivo com sistema de busca eficiente' },
{ image: Slide4Image, title: 'Visibilidade', description: 'Facilidade de acesso aos perfis em procura por empresas' },
]);
onMounted(() => {
firstCardWidth.value = carousel.value.querySelector('.card').offsetWidth;
cardPerView.value = Math.round(carousel.value.offsetWidth / firstCardWidth.value);
initInfiniteScroll();
autoPlay();
carousel.value.addEventListener('mousedown', dragStart);
Expand All @@ -72,6 +60,7 @@ export default {
onUnmounted(() => {
clearTimeout(timeoutId.value);
document.removeEventListener('mouseup', dragStop);
});
function dragStart(e) {
Expand All @@ -89,7 +78,7 @@ export default {
function dragStop() {
isDragging.value = false;
// carousel.value.classList.remove('dragging');
carousel.value.classList.remove('dragging');
}
function scrollCarousel(direction) {
Expand Down Expand Up @@ -124,6 +113,7 @@ export default {
return {
carousel,
slides,
scrollCarousel
};
}
Expand Down
30 changes: 16 additions & 14 deletions client/src/scss/layouts/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
padding: 100px;
min-height: 400px;
@include flex(column, flex-start, center);
@include m-screen(1400px){
@include m-screen(1400px) {
min-height: 360px;
}

Expand All @@ -16,7 +16,7 @@
font-size: 2rem;
color: $secondary-color-orange;
@include font-inter(700);
@include m-screen(1400px){
@include m-screen(1400px) {
font-size: 1.8rem;
}
}
Expand All @@ -25,7 +25,7 @@
font-size: 1.3rem;
color: $font-color-dark-2;
@include font-inter(300);
@include m-screen(1400px){
@include m-screen(1400px) {
font-size: 1.1rem;
}
}
Expand All @@ -35,7 +35,7 @@
width: 100%;
margin: 80px 0px 20px 0px;
position: relative;
@include m-screen(1400px){
@include m-screen(1400px) {
margin: 60px 0px 18px 0px;
max-width: 1000px;
}
Expand All @@ -54,7 +54,7 @@
filter: invert(100%);
opacity: 0.7;
transition: transform 0.1s linear;
@include m-screen(1400px){
@include m-screen(1400px) {
background-size: 30px;
}
}
Expand Down Expand Up @@ -110,40 +110,42 @@
padding-bottom: 15px;
flex-direction: column;
border-radius: 8px;
@include m-screen(1400px){
@include m-screen(1400px) {
height: 300px;
}

.img {
background: $primary-color-dark;
height: 80%;
height: 75%;
width: 100%;
border-radius: 8px 8px 0px 0px;

img {
width: 140px;
height: 140px;
border-radius: 50%;
width: 100%;
border-radius: 8px 8px 0px 0px;
height: 100%;
object-fit: cover;
}
}

h2 {
color: $secondary-color-orange;
font-size: 1.4rem;
height: 10%;
@include font-inter(400);
font-size: 1.5rem;
color: $font-color-dark;
padding: 10px;
@include m-screen(1400px){
@include m-screen(1400px) {
font-size: 1.3rem;
}
}

span {
height: 15%;
@include font-inter(200);
font-size: 0.9rem;
color: $font-color-dark-2;
padding: 10px;
@include m-screen(1400px){
@include m-screen(1400px) {
font-size: 0.7rem;
}
}
Expand Down
16 changes: 10 additions & 6 deletions client/src/scss/layouts/_contactUs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

h1 {
color: $secondary-color-orange;
@include font-inter(500);
font-size: 2rem;
@include font-inter(700);
@include m-screen(1420px) {
font-size: 1.8rem;
}
Expand All @@ -23,6 +23,9 @@
}

p {
font-size: 1rem;
@include font-inter(300);
color: $font-color-dark-2;
@include m-screen(1420px) {
font-size: 0.8rem;
}
Expand All @@ -32,6 +35,7 @@
}

p:last-child {
@include font-inter(700);
color: $primary-color-orange;
}

Expand All @@ -40,7 +44,7 @@

input[type="text"] {
border: none;
border: solid 1px $font-color-dark;
border: solid 1px $font-color-dark-2;
background-color: transparent;
outline: none;
color: $font-color-dark;
Expand All @@ -67,7 +71,7 @@

textarea {
border: none;
border: solid 1px $font-color-dark;
border: solid 1px $font-color-dark-2;
background-color: transparent;
outline: none;
color: $font-color-dark;
Expand Down Expand Up @@ -102,19 +106,19 @@
button {
padding: 8px 25px;
border-radius: 3px;
font-size: 1rem;
font-size: 0.7rem;
@include font-inter(600);
color: $secondary-color-dark;
background-color: $primary-color-orange;
border: none;
border: solid 1px $primary-color-orange;
text-transform: uppercase;
transition: 0.1s linear;
cursor: pointer;
@include m-screen(1420px) {
font-size: 0.8rem;
padding: 7px 20px;
}
@include m-screen(1120px) {
font-size: 0.7rem;
padding: 6px 15px;
}

Expand Down
16 changes: 13 additions & 3 deletions client/src/scss/layouts/_footer.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
footer {
background-color: $primary-color-dark;
height: 25vh;
height: 250px;
@include flex(column, space-evenly, center);
@include font-inter(200);
@include m-screen(1400px) {
font-size: 0.8rem;
height: 200px;
}
@include m-screen(1120px) {
font-size: 0.7rem;
height: 180px;
}
img {
height: 40px;
Expand All @@ -29,8 +31,10 @@ footer {
a {
margin: 0px;
text-decoration: none;
color: $font-color-dark;
transition: 0.1s linear;
color: $font-color-dark-2;
font-size: 1rem;
@include font-inter(700);

&:hover {
color: $secondary-color-orange;
Expand All @@ -41,7 +45,13 @@ footer {

> li {
height: 1px;
background-color: $font-color-dark;
background-color: $font-color-dark-2;
width: 90%;
}

> p {
color: $font-color-dark-2;
font-size: 1rem;
@include font-inter(700);
}
}
10 changes: 10 additions & 0 deletions client/src/scss/pages/shared/_home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,24 @@ main {
@include m-screen(1120px){
font-size: 1.6rem;
}
@include m-screen(860px){
font-size: 1.3rem;
}
}

p {
width: 70%;
font-size: 1rem;
color: $font-color-dark-2;
@include font-inter(300);
@include m-screen(1120px){
font-size: 0.8rem;
width: 60%;
}
@include m-screen(860px){
font-size: 0.7rem;
width: 80%;
}
}

a {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:
- A unique constraint covering the columns `[rm]` on the table `alunos` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `vinculos` ADD COLUMN `accepted` BOOLEAN NOT NULL DEFAULT false;

-- CreateIndex
CREATE UNIQUE INDEX `alunos_rm_key` ON `alunos`(`rm`);
2 changes: 1 addition & 1 deletion server/src/jwt/jwtServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { sign, verify, JwtPayload } from "jsonwebtoken";
import { Aluno, Admin, Professor, Funcionario, Empresa } from "@prisma/client";

export function generateAccessTokenAluno(aluno: Aluno): string {
return sign({ alunoId: aluno.id }, process.env.JWT_ACCESS_SECRET as string, {
return sign({ alunoId: aluno.id}, process.env.JWT_ACCESS_SECRET as string, {
expiresIn: '50m',
});
}
Expand Down
9 changes: 4 additions & 5 deletions server/src/middleware/autentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface RequestWithAdmin extends Request {
}

interface RequestWithProfessor extends Request {
professor?: { id: String };
professor?: { id: String, email: String };
}

interface RequestWithFuncionario extends Request {
Expand All @@ -21,7 +21,7 @@ interface RequestWithEmpresa extends Request {
}

interface RequestWithAluno extends Request {
aluno?: { id: String };
aluno?: { id: String, email: String };
}

export async function adminAuthMiddleware(req: RequestWithAdmin, res: Response, next: NextFunction) {
Expand Down Expand Up @@ -78,7 +78,7 @@ export async function professorAuthMiddleware(req: RequestWithProfessor, res: Re
throw new AppError('Professor not found');
}

req.professor = { id: professor.id };
req.body.entidade = { id: professor.id, email: professor.email };

next();
} catch (error) {
Expand Down Expand Up @@ -168,8 +168,7 @@ export async function alunoAuthMiddleware(req: RequestWithAluno, res: Response,
throw new AppError('Aluno not found');
}

req.aluno = { id: aluno.id };

req.body.entidade = { id: aluno.id, email: aluno.email };
next();
} catch (error) {
res.status(401).json({ message: 'Sessão de aluno inválida ou encerrada: ' + error });
Expand Down
Loading

0 comments on commit 1ed78ee

Please sign in to comment.