mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 12:56:48 +00:00
refactor(gui): linting
Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com>
This commit is contained in:
@@ -1,126 +1,130 @@
|
||||
<template>
|
||||
|
||||
<section class="section container">
|
||||
<div class="box">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<label class="label">newPassword</label>
|
||||
<input class="input" type="password" placeholder="newPassword" id="newPassword"
|
||||
v-model="passwordDetails.newPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<label class="label">verifyPassword</label>
|
||||
<input class="input" type="password" placeholder="verifyPassword" id="verifyPassword"
|
||||
v-model="passwordDetails.verifyPassword">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link" @click="resetUserPassword">Submit</button>
|
||||
</div>
|
||||
<section class="section container">
|
||||
<div class="box">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<label class="label">newPassword</label>
|
||||
<input
|
||||
id="newPassword"
|
||||
v-model="passwordDetails.newPassword"
|
||||
class="input"
|
||||
type="password"
|
||||
placeholder="newPassword"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<label class="label">verifyPassword</label>
|
||||
<input
|
||||
id="verifyPassword"
|
||||
v-model="passwordDetails.verifyPassword"
|
||||
class="input"
|
||||
type="password"
|
||||
placeholder="verifyPassword"
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<v-row >
|
||||
<v-col cols="6">
|
||||
<v-card class="pa-5">
|
||||
<v-form v-model="valid" ref="formType" lazy-validation>
|
||||
<div class="field is-grouped">
|
||||
<div class="control">
|
||||
<button class="button is-link" @click="resetUserPassword">
|
||||
Submit
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<v-text-field
|
||||
name="input-10-2"
|
||||
label="New password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
v-model="passwordDetails.newPassword"
|
||||
:rules="formRules.password"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
></v-text-field>
|
||||
<v-row>
|
||||
<v-col cols="6">
|
||||
<v-card class="pa-5">
|
||||
<v-form ref="formType" v-model="valid" lazy-validation>
|
||||
<v-text-field
|
||||
v-model="passwordDetails.newPassword"
|
||||
name="input-10-2"
|
||||
label="New password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
:rules="formRules.password"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
name="input-10-2"
|
||||
label="Confirm new password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
v-model="passwordDetails.verifyPassword"
|
||||
:rules="formRules.password"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
></v-text-field>
|
||||
|
||||
<v-btn
|
||||
@click="resetUserPassword"
|
||||
:disabled="!valid">
|
||||
submit
|
||||
</v-btn>
|
||||
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
</section>
|
||||
<v-text-field
|
||||
v-model="passwordDetails.verifyPassword"
|
||||
name="input-10-2"
|
||||
label="Confirm new password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
:rules="formRules.password"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
/>
|
||||
|
||||
<v-btn
|
||||
:disabled="!valid"
|
||||
@click="resetUserPassword"
|
||||
>
|
||||
submit
|
||||
</v-btn>
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isEmail} from "@/helpers";
|
||||
import { isEmail } from '@/helpers'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
export default {
|
||||
directives: {},
|
||||
components: {},
|
||||
validate ({ params }) {
|
||||
return true
|
||||
},
|
||||
props: {},
|
||||
data () {
|
||||
return {
|
||||
|
||||
passwordDetails: {
|
||||
newPassword: null,
|
||||
verifyPassword: null
|
||||
},
|
||||
passwordDetails: {
|
||||
newPassword: null,
|
||||
verifyPassword: null
|
||||
},
|
||||
|
||||
formRules: {
|
||||
email: [
|
||||
v => !!v || 'E-mail is required',
|
||||
v => isEmail(v) || 'E-mail must be valid'
|
||||
],
|
||||
},
|
||||
formRules: {
|
||||
email: [
|
||||
v => !!v || 'E-mail is required',
|
||||
v => isEmail(v) || 'E-mail must be valid'
|
||||
]
|
||||
},
|
||||
|
||||
valid: true,
|
||||
e3: true,
|
||||
alert: true,
|
||||
valid: true,
|
||||
e3: true,
|
||||
alert: true
|
||||
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
resetUserPassword() {
|
||||
//console.log('resetuserpassword');
|
||||
}
|
||||
},
|
||||
beforeCreated() {
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
destroy() {
|
||||
},
|
||||
validate({params}) {
|
||||
return true
|
||||
},
|
||||
head() {
|
||||
return {}
|
||||
},
|
||||
props: {},
|
||||
watch: {},
|
||||
directives: {},
|
||||
components: {}
|
||||
}
|
||||
},
|
||||
head () {
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created () {
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
methods: {
|
||||
resetUserPassword () {
|
||||
// console.log('resetuserpassword');
|
||||
}
|
||||
},
|
||||
beforeCreated () {
|
||||
},
|
||||
destroy () {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -3,187 +3,187 @@
|
||||
<v-row v-if="resetSuccess" align="center">
|
||||
<v-col md="6" offset-md="3">
|
||||
<v-card class="pa-5 elevation-10" color="">
|
||||
|
||||
<h1 class="text-center" color="accent">RESET PASSWORD</h1>
|
||||
<h1 class="text-center" color="accent">
|
||||
RESET PASSWORD
|
||||
</h1>
|
||||
<br>
|
||||
|
||||
<v-form v-model="valid" ref="formType" lazy-validation>
|
||||
|
||||
<v-form ref="formType" v-model="valid" lazy-validation>
|
||||
<v-text-field
|
||||
v-model="passwordDetails.newPassword"
|
||||
name="input-10-2"
|
||||
label="New password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
v-model="passwordDetails.newPassword"
|
||||
:rules="formRules.password"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
></v-text-field>
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
v-model="passwordDetails.verifyPassword"
|
||||
name="input-10-2"
|
||||
label="Confirm new password"
|
||||
:append-icon="e3 ? 'visibility' : 'visibility_off'"
|
||||
:append-icon-cb="() => (e3 = !e3)"
|
||||
v-model="passwordDetails.verifyPassword"
|
||||
:rules="formRules.password1"
|
||||
:type="e3 ? 'password' : 'text'"
|
||||
></v-text-field>
|
||||
/>
|
||||
|
||||
<v-btn
|
||||
@click="resetUserPassword"
|
||||
large
|
||||
color="primary">
|
||||
color="primary"
|
||||
@click="resetUserPassword"
|
||||
>
|
||||
RESET PASSWORD
|
||||
</v-btn>
|
||||
|
||||
</v-form>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-else>
|
||||
<v-alert type="warning" dismissible v-model="alert">
|
||||
<h1 class="title is-2">Invalid RESET token - make sure you have opened right reset link</h1>
|
||||
<v-alert v-model="alert" type="warning" dismissible>
|
||||
<h1 class="title is-2">
|
||||
Invalid RESET token - make sure you have opened right reset link
|
||||
</h1>
|
||||
</v-alert>
|
||||
</v-row>
|
||||
</v-row>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {isEmail} from "@/helpers";
|
||||
import { isEmail } from '@/helpers'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
resetSuccess: true,
|
||||
passwordDetails: {
|
||||
newPassword: null,
|
||||
verifyPassword: null,
|
||||
token: null
|
||||
},
|
||||
export default {
|
||||
directives: {},
|
||||
components: {},
|
||||
validate ({ params }) {
|
||||
// console.log('validate');
|
||||
return true
|
||||
},
|
||||
props: {},
|
||||
data () {
|
||||
return {
|
||||
resetSuccess: true,
|
||||
passwordDetails: {
|
||||
newPassword: null,
|
||||
verifyPassword: null,
|
||||
token: null
|
||||
},
|
||||
|
||||
formRules: {
|
||||
email: [
|
||||
v => !!v || 'E-mail is required',
|
||||
v => isEmail(v) || 'E-mail must be valid'
|
||||
],
|
||||
password: [
|
||||
v => (this.PasswordValidate(v)) || this.passwordValidateMsg
|
||||
],
|
||||
password1: [
|
||||
v => (this.PasswordValidate1(v)) || 'Confirm password should match'
|
||||
]
|
||||
},
|
||||
passwordProgress: 0,
|
||||
passwordValidateMsg: '',
|
||||
valid: true,
|
||||
e3: true,
|
||||
alert: true,
|
||||
formRules: {
|
||||
email: [
|
||||
v => !!v || 'E-mail is required',
|
||||
v => isEmail(v) || 'E-mail must be valid'
|
||||
],
|
||||
password: [
|
||||
v => (this.PasswordValidate(v)) || this.passwordValidateMsg
|
||||
],
|
||||
password1: [
|
||||
v => (this.PasswordValidate1(v)) || 'Confirm password should match'
|
||||
]
|
||||
},
|
||||
passwordProgress: 0,
|
||||
passwordValidateMsg: '',
|
||||
valid: true,
|
||||
e3: true,
|
||||
alert: true
|
||||
|
||||
}
|
||||
},
|
||||
head () {
|
||||
// console.log('head');
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created () {
|
||||
// console.log('created');
|
||||
},
|
||||
async mounted () {
|
||||
// console.log('mounted', this.$route.query);
|
||||
this.resetSuccess = await this.$store.dispatch('users/ActGetPasswordReset', this.$route.query)
|
||||
// this.resetSuccess = true;
|
||||
// console.log('mounted', this.resetSuccess);
|
||||
},
|
||||
beforeDestroy () {
|
||||
// console.log('beforeDestroy');
|
||||
},
|
||||
methods: {
|
||||
async resetUserPassword (e) {
|
||||
if (this.$refs.formType.validate()) {
|
||||
e.preventDefault()
|
||||
this.passwordDetails.token = this.$route.query.token
|
||||
// console.log('passworDetails', this.passwordDetails);
|
||||
|
||||
await this.$recaptchaLoaded()
|
||||
const recaptchaToken = await this.$recaptcha('login')
|
||||
|
||||
await this.$store.dispatch('users/ActPostPasswordReset', { ...this.passwordDetails, recaptchaToken })
|
||||
this.$router.push('/')
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
methods: {
|
||||
async resetUserPassword(e) {
|
||||
if (this.$refs.formType.validate()) {
|
||||
e.preventDefault();
|
||||
this.passwordDetails.token = this.$route.query.token;
|
||||
//console.log('passworDetails', this.passwordDetails);
|
||||
|
||||
await this.$recaptchaLoaded()
|
||||
const recaptchaToken = await this.$recaptcha('login')
|
||||
|
||||
await this.$store.dispatch('users/ActPostPasswordReset', {...this.passwordDetails, recaptchaToken})
|
||||
this.$router.push('/');
|
||||
}
|
||||
},
|
||||
PasswordValidate(p) {
|
||||
|
||||
if (!p) {
|
||||
this.passwordProgress = 0;
|
||||
this.passwordValidateMsg = 'Atleast 8 letters with one Uppercase, one number and one special letter'
|
||||
return false;
|
||||
}
|
||||
|
||||
let msg = '';
|
||||
let validation = true;
|
||||
let progress = 0;
|
||||
|
||||
if (!(p.length >= 8)) {
|
||||
msg += 'Atleast 8 letters. '
|
||||
validation = validation && false;
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/.*[A-Z].*/))) {
|
||||
msg += 'One Uppercase Letter. '
|
||||
validation = validation && false;
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/.*[0-9].*/))) {
|
||||
msg += 'One Number. '
|
||||
validation = validation && false;
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/[$&+,:;=?@#|'<>.^*()%!-]/))) {
|
||||
msg += 'One special letter. '
|
||||
validation = validation && false;
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
this.passwordProgress = progress;
|
||||
//console.log('progress', progress);
|
||||
|
||||
this.passwordValidateMsg = msg;
|
||||
|
||||
//console.log('msg', msg, validation);
|
||||
|
||||
return validation;
|
||||
},
|
||||
PasswordValidate1(confirmPassword) {
|
||||
if (confirmPassword) {
|
||||
return this.passwordDetails.newPassword.startsWith(confirmPassword);
|
||||
}
|
||||
return false;
|
||||
PasswordValidate (p) {
|
||||
if (!p) {
|
||||
this.passwordProgress = 0
|
||||
this.passwordValidateMsg = 'Atleast 8 letters with one Uppercase, one number and one special letter'
|
||||
return false
|
||||
}
|
||||
|
||||
let msg = ''
|
||||
let validation = true
|
||||
let progress = 0
|
||||
|
||||
if (!(p.length >= 8)) {
|
||||
msg += 'Atleast 8 letters. '
|
||||
validation = validation && false
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/.*[A-Z].*/))) {
|
||||
msg += 'One Uppercase Letter. '
|
||||
validation = validation && false
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/.*[0-9].*/))) {
|
||||
msg += 'One Number. '
|
||||
validation = validation && false
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
if (!(p.match(/[$&+,:;=?@#|'<>.^*()%!-]/))) {
|
||||
msg += 'One special letter. '
|
||||
validation = validation && false
|
||||
} else {
|
||||
progress = Math.min(100, progress + 25)
|
||||
}
|
||||
|
||||
this.passwordProgress = progress
|
||||
// console.log('progress', progress);
|
||||
|
||||
this.passwordValidateMsg = msg
|
||||
|
||||
// console.log('msg', msg, validation);
|
||||
|
||||
return validation
|
||||
},
|
||||
beforeCreated() {
|
||||
//console.log('beforeCreate');
|
||||
},
|
||||
created() {
|
||||
//console.log('created');
|
||||
},
|
||||
async mounted() {
|
||||
//console.log('mounted', this.$route.query);
|
||||
this.resetSuccess = await this.$store.dispatch('users/ActGetPasswordReset', this.$route.query)
|
||||
//this.resetSuccess = true;
|
||||
//console.log('mounted', this.resetSuccess);
|
||||
},
|
||||
beforeDestroy() {
|
||||
//console.log('beforeDestroy');
|
||||
},
|
||||
destroy() {
|
||||
//console.log('destroy');
|
||||
},
|
||||
validate({params}) {
|
||||
//console.log('validate');
|
||||
return true
|
||||
},
|
||||
head() {
|
||||
//console.log('head');
|
||||
return {}
|
||||
},
|
||||
props: {},
|
||||
watch: {},
|
||||
directives: {},
|
||||
components: {}
|
||||
PasswordValidate1 (confirmPassword) {
|
||||
if (confirmPassword) {
|
||||
return this.passwordDetails.newPassword.startsWith(confirmPassword)
|
||||
}
|
||||
return false
|
||||
}
|
||||
},
|
||||
beforeCreated () {
|
||||
// console.log('beforeCreate');
|
||||
},
|
||||
destroy () {
|
||||
// console.log('destroy');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,52 +1,55 @@
|
||||
<template>
|
||||
|
||||
<section class="section container">
|
||||
|
||||
<div class="box">
|
||||
<h3 class="title is-3">Password reset is invalid</h3>
|
||||
<router-link to="/user/password/reset/form">Ask for a new password reset</router-link>
|
||||
<h3 class="title is-3">
|
||||
Password reset is invalid
|
||||
</h3>
|
||||
<router-link to="/user/password/reset/form">
|
||||
Ask for a new password reset
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
<v-row >
|
||||
<v-alert type="warning" dismissible v-model="alert">
|
||||
<h1 class="title is-2">Password reset is invalid</h1>
|
||||
<v-row>
|
||||
<v-alert v-model="alert" type="warning" dismissible>
|
||||
<h1 class="title is-2">
|
||||
Password reset is invalid
|
||||
</h1>
|
||||
</v-alert>
|
||||
<router-link to="/user/password/reset/form">Ask for a new password reset</router-link>
|
||||
<router-link to="/user/password/reset/form">
|
||||
Ask for a new password reset
|
||||
</router-link>
|
||||
</v-row>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
methods: {},
|
||||
beforeCreated() {
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
destroy() {
|
||||
},
|
||||
validate({params}) {
|
||||
return true
|
||||
},
|
||||
head() {
|
||||
return {}
|
||||
},
|
||||
props: {},
|
||||
watch: {},
|
||||
directives: {},
|
||||
components: {}
|
||||
export default {
|
||||
directives: {},
|
||||
components: {},
|
||||
validate ({ params }) {
|
||||
return true
|
||||
},
|
||||
props: {},
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
head () {
|
||||
return {}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created () {
|
||||
},
|
||||
mounted () {
|
||||
},
|
||||
beforeDestroy () {
|
||||
},
|
||||
methods: {},
|
||||
beforeCreated () {
|
||||
},
|
||||
destroy () {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,43 +1,46 @@
|
||||
<template>
|
||||
<section class="section container">
|
||||
<div class="box">
|
||||
<h2 class="title is-2">Password successfully reset</h2>
|
||||
<h2 class="title is-2">
|
||||
Password successfully reset
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<v-row >
|
||||
<v-alert type="success" dismissible v-model="alert">
|
||||
<h1 class="title is-2">Password reset is Successfull</h1>
|
||||
<v-row>
|
||||
<v-alert v-model="alert" type="success" dismissible>
|
||||
<h1 class="title is-2">
|
||||
Password reset is Successfull
|
||||
</h1>
|
||||
</v-alert>
|
||||
</v-row>
|
||||
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
export default {
|
||||
directives: { },
|
||||
components: { },
|
||||
validate ({ params }) { return true },
|
||||
props: { },
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
}
|
||||
},
|
||||
head () { return {} },
|
||||
computed: {
|
||||
|
||||
},
|
||||
methods : {
|
||||
},
|
||||
watch: { },
|
||||
created () { },
|
||||
mounted () {},
|
||||
beforeDestroy () {},
|
||||
methods: {
|
||||
|
||||
},
|
||||
beforeCreated () {},
|
||||
created () { },
|
||||
mounted () {},
|
||||
beforeDestroy () {},
|
||||
destroy () {},
|
||||
validate({params}) { return true },
|
||||
head() { return {} },
|
||||
props: { },
|
||||
watch: { },
|
||||
directives : { },
|
||||
components : { }
|
||||
}
|
||||
},
|
||||
beforeCreated () {},
|
||||
destroy () {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user