Skip to content

Commit 0bccafe

Browse files
Merge pull request VitorCarvalho67#32 from Daniel-Alvarenga/main
Register Vagas and their view
2 parents a450164 + 98cdb5b commit 0bccafe

File tree

26 files changed

+871
-19
lines changed

26 files changed

+871
-19
lines changed

client/src/router/routes/funcionario.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import {
1010
isInitingFuncionario,
1111
isRecoveringFuncionario
1212
} from '../guards/guards.js';
13+
import RegisterVaga from '../../views/funcionario/RegisterVaga.vue';
1314

1415
export const funcionarioRoutes = [
1516
{
1617
path: '/funcionario/init',
1718
name: 'InitFuncionario',
18-
component: InitFuncionario
19+
component: InitFuncionario,
1920
},
2021
{
2122
path: '/funcionario/validate',
@@ -46,6 +47,14 @@ export const funcionarioRoutes = [
4647
(await isRecoveringFuncionario()) ? next() : next("/funcionario/recovery");
4748
}
4849
},
50+
{
51+
path: '/funcionario/register/vaga',
52+
name: 'RegisterVaga',
53+
component: RegisterVaga,
54+
beforeEnter: async (to, from, next) => {
55+
(await isAuthFuncionario()) ? next() : next("/funcionario/init");
56+
}
57+
},
4958
{
5059
path: "/funcionario",
5160
name: "Funcionario",

client/src/router/routes/shared.js

+6
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import NotFound from '../../views/shared/NotFound.vue';
33
import PublicPerfilAluno from '../../views/shared/PerfilAluno.vue';
44
import PublicPerfilProfessor from '../../views/shared/PerfilProfessor.vue';
55
import Pesquisa from '../../views/shared/Pesquisa.vue';
6+
import Vagas from '../../views/shared/Vagas.vue';
67
import { isAuthSomebody } from '../guards/guards';
78

89
export const sharedRoutes = [
@@ -34,6 +35,11 @@ export const sharedRoutes = [
3435
name: 'Pesquisa',
3536
component: Pesquisa
3637
},
38+
{
39+
path: '/vagas',
40+
name: 'Vagas',
41+
component: Vagas
42+
},
3743
{
3844
path: '/:pathMatch(.*)*',
3945
name: 'NotFound',

client/src/scss/pages/funcionario/_registerVaga.scss

Whitespace-only changes.
+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
#app{
2+
height: 100vh;
3+
4+
main {
5+
@include flex(row, flex-start, start);
6+
width: 100vw;
7+
height: 100vh;
8+
min-height: calc(100vh - 80px);
9+
border-bottom: 1px solid #0000008f;
10+
background-color: $primary-color-dark;
11+
position: relative;
12+
13+
.content {
14+
@include flex(column, flex-start, start);
15+
width: calc(100% - 300px);
16+
height: 100%;
17+
18+
@include m-screen(1200px) {
19+
width: 100%;
20+
}
21+
22+
.search {
23+
@include flex(row, center, start);
24+
height: 50px;
25+
width: 62%;
26+
padding: 20px 30px 20px 80px;
27+
28+
.box{
29+
@include flex(row, cen, start);
30+
height: 50px;
31+
border-radius: 25px;
32+
width: calc(100% - 40px);
33+
background-color: $secondary-color-dark;
34+
35+
input {
36+
color: $font-color-dark-2;
37+
width: 94%;
38+
height: 100%;
39+
padding-inline: 15px;
40+
outline: none;
41+
background: transparent;
42+
border: none;
43+
font-size: medium
44+
}
45+
46+
button {
47+
@include flex-center;
48+
height: 100%;
49+
background-color: transparent;
50+
border: none;
51+
52+
img {
53+
height: 55%;
54+
object-fit: cover;
55+
opacity: 0.8;
56+
filter: invert(100%)
57+
}
58+
}
59+
}
60+
}
61+
62+
>.box {
63+
@include flex(column, flex-start, start);
64+
padding: 50px 0px 0px 100px;
65+
width: 70%;
66+
height: 100%;
67+
68+
@include m-screen(1400px) {
69+
@include flex(column, center, center);
70+
padding: 50px 0px 0px 0px;
71+
width: 100%;
72+
}
73+
74+
.resultado {
75+
@include flex(column, center, end);
76+
text-align: right;
77+
width: 80%;
78+
color: $secondary-color-orange;
79+
margin-right: 10px;
80+
margin-bottom: 10px;
81+
height: 100%;
82+
font-size: small;
83+
font-weight: 200;
84+
@include font-inter(600);
85+
}
86+
87+
88+
.vaga {
89+
@include flex(column, flex-start, start);
90+
width: 80%;
91+
height: 90px;
92+
margin-bottom: 10px;
93+
94+
@include m-screen(1400px) {
95+
width: 70%;
96+
}
97+
98+
@include m-screen(800px) {
99+
width: 90%;
100+
}
101+
102+
a {
103+
@include flex(row, flex-start, start);
104+
width: 100%;
105+
height: 100%;
106+
background-color: $secondary-color-dark;
107+
padding: 15px;
108+
border-radius: 5px;
109+
text-decoration: none;
110+
color: $font-color-dark;
111+
112+
img {
113+
height: 60px;
114+
width: 60px;
115+
object-fit: cover;
116+
border-radius: 50%;
117+
margin-right: 20px;
118+
}
119+
120+
.infoVaga {
121+
@include flex(row, space-between, start);
122+
width: calc(100% - 60px);
123+
height: 100%;
124+
125+
.who {
126+
color: $primary-color-orange;
127+
margin-right: 10px;
128+
margin-bottom: 10px;
129+
}
130+
131+
.contentVaga {
132+
@include flex(column, flex-start, start);
133+
}
134+
135+
.box-button{
136+
height: 100%;
137+
@include flex(column, center, center);
138+
139+
button{
140+
background-color: $primary-color-orange;
141+
padding: 10px 20px;
142+
border-radius: 10px;
143+
color: $secondary-color-dark;
144+
border: solid 1px $primary-color-orange;
145+
}
146+
}
147+
148+
}
149+
150+
p {
151+
@include font-inter(600);
152+
}
153+
}
154+
}
155+
}
156+
}
157+
}
158+
}

client/src/services/api/funcionario.js

+39
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,19 @@ export const validateRecovery = async(infoFuncionario) => {
6363
}
6464
}
6565

66+
export const registerVaga = async(infoVaga, token) => {
67+
try {
68+
const response = await api.post('funcionario/register/vaga', infoVaga, {
69+
headers: {
70+
authorization: `${token}`
71+
}
72+
});
73+
return response;
74+
} catch (error) {
75+
return error.response.data;
76+
}
77+
}
78+
6679
export const refreshTokenFuncionario = async (token) => {
6780
try {
6881
const response = await api.get('funcionario/token/refresh', {
@@ -74,4 +87,30 @@ export const refreshTokenFuncionario = async (token) => {
7487
} catch (error) {
7588
return error.response.data;
7689
}
90+
}
91+
92+
export const getCursos = async(token) => {
93+
try {
94+
const response = await api.get('funcionario/cursos', {
95+
headers: {
96+
authorization: `${token}`
97+
}
98+
});
99+
return response;
100+
} catch (error) {
101+
return error.response.data;
102+
}
103+
}
104+
105+
export const getEmpresas = async(token) => {
106+
try {
107+
const response = await api.get('funcionario/empresas', {
108+
headers: {
109+
authorization: `${token}`
110+
}
111+
});
112+
return response;
113+
} catch (error) {
114+
return error.response.data;
115+
}
77116
}

client/src/services/api/shared.js

+9
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,12 @@ export const getUsers = async () => {
4242
return error.response.data;
4343
}
4444
}
45+
46+
export const getVagas = async () => {
47+
try {
48+
const response = await api.get('shared/vagas');
49+
return response;
50+
} catch (error) {
51+
return error.response.data;
52+
}
53+
}

client/src/util/authMixins.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ export const mixinFuncionario = {
149149
try {
150150
const response = await refreshTokenFuncionario(this.funcionario.token);
151151
if (response.status >= 200 && response.status < 300) {
152-
Cookies.set('token', `${response.data.token}`);
152+
console.log("Auth funcionário")
153+
Cookies.set('token-funcionario', `${response.data.token}`);
153154
}
154155
} catch (error) {
156+
console.log("Erro em auth funcionário: " + error)
155157
router.push({ path: '/funcionario/init' });
156158
}
157159
},

client/src/views/funcionario/Dashboard.vue

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<h1>Bem-vindo profissional!</h1>
55
<nav>
66
<button @click="logout">Logout</button>
7+
<router-link to="/funcionario/register/vaga">Registrar Vaga</router-link>
78
</nav>
89
</main>
910
<Footer />

0 commit comments

Comments
 (0)