Skip to content

Commit

Permalink
Merge pull request #33 from Daniel-Alvarenga/main
Browse files Browse the repository at this point in the history
Vaga view
  • Loading branch information
Daniel-Alvarenga authored Jul 6, 2024
2 parents 0bccafe + 204a8e9 commit 1fed881
Show file tree
Hide file tree
Showing 15 changed files with 330 additions and 20 deletions.
2 changes: 1 addition & 1 deletion client/src/components/aluno/AsideDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</router-link>
</li>
<li :class="getClassForPage('estagios')">
<router-link to="">
<router-link to="/vagas">
<img :src="icons.job">
<p v-if="showPs">Estágios</p>
</router-link>
Expand Down
6 changes: 6 additions & 0 deletions client/src/router/routes/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import PublicPerfilAluno from '../../views/shared/PerfilAluno.vue';
import PublicPerfilProfessor from '../../views/shared/PerfilProfessor.vue';
import Pesquisa from '../../views/shared/Pesquisa.vue';
import Vagas from '../../views/shared/Vagas.vue';
import Vaga from '../../views/shared/Vaga.vue';
import { isAuthSomebody } from '../guards/guards';

export const sharedRoutes = [
Expand Down Expand Up @@ -40,6 +41,11 @@ export const sharedRoutes = [
name: 'Vagas',
component: Vagas
},
{
path: '/vaga/:id',
name: 'Vaga',
component: Vaga
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
Expand Down
78 changes: 78 additions & 0 deletions client/src/scss/pages/shared/_vaga.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
main {
@include flex(row, flex-start, start);
height: calc(100vh - 80px);
background-color: $primary-color-dark;
.content {
height: calc(100vh - 80px);
width: 100%;
background-color: $primary-color-dark;
@include flex(column, flex-start, start);
padding: 20px 100px;

.vaga-header {
h3 {
@include font-inter(700);
font-size: 2rem;
color: $font-color-dark;
}

.status {
@include font-inter(300);
font-size: 1rem;
color: $font-color-dark-2;
}
}

.vaga-info {
margin-top: 20px;

h2 {
@include font-inter(700);
font-size: 1.5rem;
color: $secondary-color-orange;
margin-bottom: 10px;
}

.requisitos, .beneficios {
list-style: none;
padding: 0;
margin: 0;

li {
margin-bottom: 5px;

p {
@include font-inter(300);
font-size: 1rem;
color: $font-color-dark-2;
}
}
}

.vaga-details, .vaga-remuneracao {
margin-top: 20px;

p {
@include font-inter(300);
font-size: 1rem;
color: $font-color-dark-2;

strong {
font-weight: 700;
}
}
}

.descricao {
margin-top: 20px;
margin-bottom: 20px;

p {
@include font-inter(300);
font-size: 1rem;
color: $font-color-dark-2;
}
}
}
}
}
20 changes: 14 additions & 6 deletions client/src/scss/pages/shared/_vagas.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@

main {
@include flex(row, flex-start, start);
width: 100vw;
height: 100vh;
min-height: calc(100vh - 80px);
border-bottom: 1px solid #0000008f;
height: calc(100vh - 80px);
background-color: $primary-color-dark;
position: relative;

.content {
@include flex(column, flex-start, start);
Expand Down Expand Up @@ -88,7 +84,7 @@
.vaga {
@include flex(column, flex-start, start);
width: 80%;
height: 90px;
height: 140px;
margin-bottom: 10px;

@include m-screen(1400px) {
Expand Down Expand Up @@ -130,6 +126,18 @@

.contentVaga {
@include flex(column, flex-start, start);
width: 70%;

.info{
@include flex(row, space-between, start);
width: 100%;

label {
@include font-inter(600);
color: $primary-color-dark;

}
}
}

.box-button{
Expand Down
12 changes: 12 additions & 0 deletions client/src/services/api/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,16 @@ export const getVagas = async () => {
} catch (error) {
return error.response.data;
}
}

export const getVaga = async (id) => {
try {
const response = await api.get('shared/vaga', {
params: id
});
console.log(response.data.alunos);
return response;
} catch (error) {
return error.response.data;
}
}
1 change: 0 additions & 1 deletion client/src/views/shared/PerfilAluno.vue
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ export default {
this.aluno.rm = this.$route.params.rm;
await this.getCurriculoAluno();
await this.possuiVinculo();
await this.getCurriculoAluno();
console.log(this.conected);
Expand Down
6 changes: 4 additions & 2 deletions client/src/views/shared/Pesquisa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
</div>
</a>
</li>
<p class="resultado" v-else v-text="filteredUsers.length + ' resultados encontrados para sua busca'"></p>
<p class="resultado" v-else v-text="(filteredUsers.length > 1)?
filteredUsers.length + ' resultados encontrados para sua busca' :
filteredUsers.length + ' resultado encontrado para sua busca'"></p>
<li class="user" v-for="(estudante, index) in filteredUsers" :key="index">
<router-link :to="'/aluno/profile/' + estudante.rm">
<img v-if="estudante.imageUrl == 'default'" src="../../assets/icons/artwork.png" :alt="estudante.name">
Expand All @@ -39,8 +41,8 @@
</ul>
</section>
</main>
<Footer />
</div>
<Footer />
</template>

<script>
Expand Down
128 changes: 128 additions & 0 deletions client/src/views/shared/Vaga.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<template>
<Header />
<div id="app">
<main>
<AsideDashboard v-if="aluno.email" pageName="estagios"/>
<div class="content">
<div class="vaga-header">
<h3 v-text="vaga.titulo"></h3>
<router-link :to="'/empresa/' + vaga.empresa.cnpj">{{ vaga.empresa.name }}</router-link>
<p class="status" v-text="situacao[vaga.status]"></p>
</div>

<section class="vaga-info">
<h2>Requisitos</h2>
<ul class="requisitos">
<li v-for="(requisito, index) in parsedRequisitos" :key="index">
<p v-text="requisito"></p>
</li>
</ul>

<div class="vaga-details">
<p><strong>Carga Horária:</strong> <span v-text="vaga.cargaHoraria"></span></p>
<p><strong>Entrada:</strong> <span v-text="vaga.entrada"></span></p>
<p><strong>Saída:</strong> <span v-text="vaga.saida"></span></p>
</div>

<section class="descricao">
<h2>Descrição</h2>
<div class="vaga-remuneracao">
<p><strong>Remuneração:</strong> <span v-text="vaga.remuneracao"></span></p>
</div>
<p v-text="vaga.descricao"></p>
</section>


<h2>Benefícios</h2>
<ul class="beneficios">
<li v-for="(beneficio, index) in parsedBeneficios" :key="index">
<p v-text="beneficio"></p>
</li>
</ul>
</section>
</div>
</main>
</div>
<Footer />
</template>

<script>
import Header from '../../components/Header.vue';
import Footer from '../../components/Footer.vue';
import AsideDashboard from '../../components/aluno/AsideDashboard.vue';
import router from '../../router/index.js';
import Cookies from 'js-cookie';
import { getVaga } from '../../services/api/shared';
import {
getMeAluno,
} from '../../services/api/aluno';
export default {
name: 'Vaga',
components: {
Header,
AsideDashboard,
Footer
},
data() {
return {
vaga: {
requisitos: '[]',
beneficios: '[]'
},
aluno: {
email: '',
token: ''
},
situacao: {
"DISPONIVEL": "Vaga disponível",
"INDISPONIVEL": "Vaga indisponível"
}
};
},
computed: {
parsedRequisitos() {
return JSON.parse(this.vaga.requisitos);
},
parsedBeneficios() {
return JSON.parse(this.vaga.beneficios);
}
},
methods: {
async getVaga() {
try {
const response = await getVaga({ id: this.$route.params.id });
if (response.status >= 200 && response.status < 300) {
this.vaga = response.data.vaga;
} else {
console.error("Erro ao recuperar os dados da vaga:", response.message);
}
} catch (error) {
console.error("Erro ao recuperar os dados da vaga:", error.message);
}
},
async testAluno(){
this.aluno.token = Cookies.get('token');
if(this.aluno.token){
const responseMail = await getMeAluno(this.aluno.token);
if (responseMail.status >= 200 && responseMail.status < 300) {
this.aluno.email = responseMail.data.email;
} else{
console.log("Erro ao buscar aluno");
}
} else {
console.log("Token de aluno não encontrado");
}
}
},
async created() {
await this.testAluno();
await this.getVaga();
}
};
</script>

<style lang="scss" scoped>
@import "../../scss/pages/shared/vaga.scss";
</style>
33 changes: 24 additions & 9 deletions client/src/views/shared/Vagas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<Header />
<div id="app">
<main>
<AsideDashboard v-if="aluno.connected" pageName="pesquisa" />
<AsideDashboard v-if="aluno.connected" pageName="estagios" />
<section class="content">
<div class="search">
<div class="box">
<input type="text" placeholder="Buscar usuário" v-model="busca" @keyup.enter="filterVagas">
<input type="text" placeholder="Buscar estágio" v-model="busca" @keyup.enter="filterVagas">
<button @click="filterVagas">
<img :src="icons.search" alt="Buscar">
</button>
Expand All @@ -20,16 +20,31 @@
</div>
</a>
</li>
<p class="resultado" v-else v-text="filteredVagas.length + ' resultados encontrados para sua busca'"></p>
<p class="resultado" v-else v-text="(filteredVagas.length > 1)?
filteredVagas.length + ' resultados encontrados para sua busca' :
filteredVagas.length + ' resultado encontrado para sua busca'"></p>
<li class="vaga" v-for="(vaga, index) in filteredVagas" :key="index">
<router-link :to="'/aluno/profile/' + vaga.titulo">
<router-link :to="'/vaga/' + vaga.id">
<div class="infoVaga">
<div class="contentVaga name">
<p class="who">{{ vaga.titulo }}</p>
<p>{{ vaga.remuneracao }}</p>
<p>{{ vaga.cargaHoraria }}</p>
<p>{{ vaga.endereco }}</p>
<p>{{ vaga.curso }}</p>

<div class="info">
<label>Salário</label>
<p v-text="vaga.remuneracao"></p>
</div>
<div class="info">
<label>Carga horária</label>
<p v-text="vaga.cargaHoraria"></p>
</div>
<div class="info">
<label>Oferecida por</label>
<p v-text="vaga.empresa"></p>
</div>
<div class="info">
<label>Curso preferencial</label>
<p v-text="vaga.curso"></p>
</div>
</div>
<div class="box-button">
<button>Ver vaga</button>
Expand All @@ -40,8 +55,8 @@
</ul>
</section>
</main>
<Footer />
</div>
<Footer />
</template>

<script>
Expand Down
Loading

0 comments on commit 1fed881

Please sign in to comment.