Skip to content

Commit

Permalink
fix(project): fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Walker Leite committed May 15, 2018
1 parent 34b3a0b commit 04d852a
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 121 deletions.
29 changes: 19 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -5,7 +5,7 @@
"main": "meta.js",
"scripts": {
"test": "node test.js",
"lint": "npx eslint ."
"lint": "npx eslint --ext vue,js ."
},
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
"eslint": "^4.15.0",
"eslint-config-airbnb-base": "^11.3.0",
"eslint-config-loopback": "^10.0.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-vue": "^4.0.0",
"release-it": "^7.4.3",
"vue-cli": "^2.9.1"
Expand Down
2 changes: 1 addition & 1 deletion template/client/components/HelloWorld/HelloWorld.vue
Expand Up @@ -7,5 +7,5 @@
<script>
export default {
}
};
</script>
2 changes: 1 addition & 1 deletion template/client/view/Dashboard.vue
Expand Up @@ -19,7 +19,7 @@ export default {
HeaderContainer,
HelloWorld,
},
}
};
</script>

<style lang="scss" scoped>
Expand Down
105 changes: 59 additions & 46 deletions template/client/view/Login.vue
Expand Up @@ -9,50 +9,63 @@
<form @submit="onSubmit">
<div class="form-group">
<label for="email">Email</label>
<input type="email"
class="form-control"
id="email"
aria-describedby="emailHelp"
placeholder="Insert your email"
v-model="email"
required>
<input
type="email"
class="form-control"
id="email"
aria-describedby="emailHelp"
placeholder="Insert your email"
v-model="email"
required>
</div>
<div class="form-group">
<label for="senha">Password</label>
<input type="password"
class="form-control"
id="senha"
placeholder="Insert your password"
v-model="password"
required>
<input
type="password"
class="form-control"
id="senha"
placeholder="Insert your password"
v-model="password"
required>
</div>
<div class="alert alert-danger"
role="alert"
v-if="error">\{{error.message}}</div>
<div
class="alert alert-danger"
role="alert"
v-if="error">\{{ error.message }}</div>
<div class="flex">
<a class="link"
<a
class="link"
@click.prevent="$refs.forgotPassword.show()"
href="#">
Forgot your password?
</a>
<button type="submit"
class="btn btn-success">
<i v-if="loading" class="fa fa-spinner"></i>
<i v-else class="fa fa-check"></i>
<button
type="submit"
class="btn btn-success">
<i
v-if="loading"
class="fa fa-spinner"/>
<i
v-else
class="fa fa-check"/>
SIGN IN
</button>
</div>
</form>

<!-- Forgot Password -->
<b-modal
ref="forgotPassword"
title="Recover the password"
size="sm"
@ok="onModalOk"
@shown="onModalShown">
<form ref="forgotPasswordForm" class="forgot-form">
<i v-if="loading" class="fa fa-spinner"></i>
ref="forgotPassword"
title="Recover the password"
size="sm"
@ok="onModalOk"
@shown="onModalShown">
<form
ref="forgotPasswordForm"
class="forgot-form">
<i
v-if="loading"
class="fa fa-spinner"/>
<b-alert
v-if="recoverError"
:show="recoverError !== null"
Expand All @@ -66,7 +79,7 @@
placeholder="Insert your email"
v-model="recoverEmail"
@keydown.enter="sendRecoverEmail"
required/>
required>
</form>
</b-modal>

Expand All @@ -82,35 +95,35 @@

<script>
export default {
data () {
data() {
return {
email: null,
password: null,
error: null,
recoverError: null,
recoverSuccess: null,
recoverEmail: null,
loading: false
}
loading: false,
};
},
methods: {
onSubmit (evt) {
evt.preventDefault()
this.loading = true
this.error = null
onSubmit(evt) {
evt.preventDefault();
this.loading = true;
this.error = null;
this
.$store
.dispatch('auth/signIn', {
email: this.email,
password: this.password
password: this.password,
})
.then(() => {
this.loading = false
})
.catch(err => {
this.error = err
this.loading = false
this.loading = false;
})
.catch((err) => {
this.error = err;
this.loading = false;
});
},
onModalShown() {
this.$refs.forgotPasswordForm.reset();
Expand All @@ -136,16 +149,16 @@ export default {
this.$refs.forgotPassword.hide();
this.$refs.recoverSuccess.show();
})
.catch(err => {
.catch((err) => {
this.loading = false;
this.recoverError = err;
});
} else {
this.recoverError = {message: 'Please, check the inserted email and try again'};
}
}
}
}
},
},
};
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit 04d852a

Please sign in to comment.