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

Login component #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
# local env files
.env.local
.env.*.local
app-env

# Log files
npm-debug.log*
Expand Down
8,123 changes: 5,425 additions & 2,698 deletions package-lock.json

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"vue": "^2.5.22",
"vue-router": "^3.0.2"
"@vue/cli": "^3.11.0",
"bootstrap": "^4.3.1",
"bootstrap-vue": "^2.0.0-rc.28",
"lodash": "^4.17.15",
"vue": "^2.6.10",
"vue-router": "^3.1.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.5.21"
"@vue/cli-plugin-babel": "^3.11.0",
"@vue/cli-plugin-eslint": "^3.11.0",
"@vue/cli-service": "^3.11.0",
"babel-eslint": "^10.0.2",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.2.3",
"vue-template-compiler": "^2.6.10"
},
"eslintConfig": {
"root": true,
Expand Down
19 changes: 14 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>central-de-vagas</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
<title>central de vagas</title>
</head>
<body>
<noscript>
<strong>We're sorry but central-de-vagas doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<div id="app">
<v-container>
<router-view/>
</v-container>
</div>
<!-- built files will be auto injected -->
</body>
</html>

<script>
export default {
name: 'app'
}
</script>
2 changes: 1 addition & 1 deletion services/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const FirebaseAuth = require('firebaseauth')

const app = express()

const firebase = new FirebaseAuth('AIzaSyDkVri6MAsQMdf3PBqBi-sPlS1F1Xwed9o')
const firebase = new FirebaseAuth(process.env.FIREBASE_APIKEY)

app.use(express.static('.'));
app.use(bodyParser.urlencoded({ extended: true }));
Expand Down
13 changes: 0 additions & 13 deletions src/components/Home.vue

This file was deleted.

103 changes: 103 additions & 0 deletions src/components/Home/Home.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!--
Home é a página que todos os usuários não logados podem acessar, nela pode haver outros "components" além do login,
mas por enquanto só pensei nissos.
-->
<template>
<div>
<b-container class="home-main-row">
<b-row>
<b-col>
<h1>Central de Vagas</h1>
</b-col>
<b-col>
<div>
<b-tabs content-class="mt-3">
<b-tab title="Cadastro" active>
<div>
<b-form @submit="onRegister">

<b-form-group id="input-group-1" label="E-mail:" label-for="input-1">
<b-form-input id="input-1" v-model="form.email" type="email" required placeholder="Digite o e-mail" ></b-form-input>
</b-form-group>

<b-form-group id="input-group-2" label="Digite seu nome:" label-for="input-2">
<b-form-input id="input-2" v-model="form.name" required placeholder="Digite o nome do usuário"></b-form-input>
</b-form-group>

<b-form-group id="input-group-3" label="Digite sua senha" label-for="input-3">
<b-form-input id="input-3" v-model="form.password" type="password" :state="passStat" required placeholder="Digite a sua senha"></b-form-input>
</b-form-group>

<b-form-group id="input-group-4" label="Confirme sua senha" label-for="input-4">
<b-form-input id="input-4" type="password" v-model="form.confPassword" :state="passStat" placeholder="Confirme a sua senha"></b-form-input>
</b-form-group>

<b-form-group id="input-group-5">
<b-form-checkbox-group v-model="form.checked" id="checkboxes-5">
<b-form-checkbox value="me">Concordo com os termos de uso.</b-form-checkbox>
</b-form-checkbox-group>
</b-form-group>

<b-button type="submit" variant="primary">Enviar</b-button>
</b-form>
</div>
</b-tab>
<b-tab title="Login">
<b-form @submit="onLogin">

<b-form-group id="input-group-user-lg" label="Usuário:" label-for="input-username-lg">
<b-form-input id="input-username-lg" v-model="form.email" required placeholder="Digite o nome do usuário ou e-mail" ></b-form-input>
</b-form-group>

<b-form-group id="input-group-pass-lg" label="Digite seu nome:" label-for="in-password-lg">
<b-form-input id="in-password-lg" v-model="form.password" required placeholder="Digite sua senha"></b-form-input>
</b-form-group>

<b-form-group id="input-group-link">
<b-button variant="link">Esqueci minha senha.</b-button>
</b-form-group>

<b-button type="submit" variant="primary">Entrar</b-button>
</b-form>
</b-tab>
</b-tabs>
</div>
</b-col>
</b-row>
</b-container>
</div>
</template>

<script>
export default {
name: 'home',
data() {
return {
form: {
email: '',
name: '',
password: '',
confPassword: '',
checked: false
},
passStat: null,
show: true
}
},
methods: {
onRegister(evt) {
evt.preventDefault()
if (this.form.password == this.form.confPassword) {
alert('foi')
this.passStat = true;
} else {
alert('não foi')
this.passStat = false;
}
},
onLogin(evt) {
evt.preventDefault()
}
}
}
</script>
3 changes: 3 additions & 0 deletions src/components/Home/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {

}
33 changes: 33 additions & 0 deletions src/components/Login/Login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<template>
<div>
<form>
<label>Username: </label>
<input v-model="username" type="email" name="username" placeholder="username">
<br><br>
<label>Password: </label>
<input v-model="password" type="password" name="password" value="">
<br><br>
<input type="submit" value="Entrar" @click=loginUser>
</form>
<p>{{message}}</p>
</div>
</template>

<script>

export default {
data() {
return {
username: '',
password: ''
}
},
methods: {
loginUser: function() {
if (this.username.length > 0 && this.password.length > 0) {
//console.log("logando usuário")
}
}
}
}
</script>
24 changes: 24 additions & 0 deletions src/components/SignUp/SignUp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<template>
<div>
<form>
<label>Username: </label>
<input v-model="message" type="email" name="username" placeholder="username">
<br><br>
<label>Password: </label>
<input type="password" name="password" value="">
<br><br>
<input type="submit" value="Entrar">
</form>
</div>
</template>

<script>

export default {
data() {
return {
message: ''
}
}
}
</script>
14 changes: 13 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'

import BootstrapVue from 'bootstrap-vue'

import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'


Vue.use(BootstrapVue)


Vue.config.productionTip = false

new Vue({ router, render: h => h(App),}).$mount('#app')
new Vue({
router,
render: h => h(App),})
.$mount('#app')
2 changes: 1 addition & 1 deletion src/router.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Vue from 'vue'
import Router from 'vue-router'
import Home from './components/Home.vue'
import Home from './components/Home/Home.vue'

Vue.use(Router)

Expand Down