fixed all eslint errors and warning, compiled as PROD
This commit is contained in:
@ -25,13 +25,13 @@ export default {
|
||||
// vuejs attributes a inserted by form alter in same module
|
||||
MA.get(`/materio_user/login_form`)
|
||||
.then(({data}) => {
|
||||
console.log("getLoginForm data");
|
||||
console.log('getLoginForm data')
|
||||
this.form = Vue.compile(data.rendered)
|
||||
this.$options.staticRenderFns = [];
|
||||
this._staticTrees = [];
|
||||
this.form.staticRenderFns.map(fn => (this.$options.staticRenderFns.push(fn)));
|
||||
})
|
||||
.catch(( error ) => {
|
||||
.catch((error) => {
|
||||
console.warn('Issue with getLoginForm', error)
|
||||
})
|
||||
},
|
||||
@ -40,31 +40,31 @@ export default {
|
||||
mail: this.mail,
|
||||
pass: this.password
|
||||
}).then( () => {
|
||||
console.log('logedin from login component');
|
||||
console.log('logedin from login component')
|
||||
this.$emit('onLogedIn')
|
||||
}
|
||||
).catch(( error ) => {
|
||||
).catch((error) => {
|
||||
console.warn('Issue with login from login component', error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
}
|
||||
},
|
||||
beforeMount () {
|
||||
if(!this.form){
|
||||
if (!this.form) {
|
||||
this.getLoginForm()
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
// console.log('LoginBlock mounted');
|
||||
// console.log('LoginBlock mounted')
|
||||
Drupal.attachBehaviors(this.$el);
|
||||
},
|
||||
render(h) {
|
||||
// console.log('LoginBlock render');
|
||||
if(!this.form){
|
||||
// console.log('LoginBlock render NAN');
|
||||
// console.log('LoginBlock render')
|
||||
if (!this.form) {
|
||||
// console.log('LoginBlock render NAN')
|
||||
return h('span', 'Loading ...')
|
||||
}else{
|
||||
// console.log('LoginBlock render template');
|
||||
} else {
|
||||
// console.log('LoginBlock render template')
|
||||
return this.form.render.call(this)
|
||||
}
|
||||
}
|
||||
|
@ -38,14 +38,14 @@ export default {
|
||||
// vuejs attributes a inserted by form alter in same module
|
||||
MA.get(`/materio_user/register_form`)
|
||||
.then(({data}) => {
|
||||
console.log("getRegisterForm data", data);
|
||||
console.log("getRegisterForm data", data)
|
||||
this.form = Vue.compile(data.rendered)
|
||||
this.$options.staticRenderFns = [];
|
||||
this._staticTrees = [];
|
||||
this.form.staticRenderFns.map(fn => (this.$options.staticRenderFns.push(fn)));
|
||||
this.initFormBehaviours()
|
||||
})
|
||||
.catch(( error ) => {
|
||||
.catch((error) => {
|
||||
console.warn('Issue with getRegisterForm', error)
|
||||
})
|
||||
},
|
||||
@ -54,28 +54,28 @@ export default {
|
||||
this.checkSubmitEnabled()
|
||||
},
|
||||
checkSubmitEnabled () {
|
||||
console.log("checkSubmitEnabled", this);
|
||||
if(this.ps === 'Strong'){
|
||||
console.log("checkSubmitEnabled", this)
|
||||
if (this.ps === 'Strong') {
|
||||
this.$refs.register.disabled = false
|
||||
}else{
|
||||
} else {
|
||||
this.$refs.register.disabled = true
|
||||
}
|
||||
},
|
||||
register () {
|
||||
console.log('register', this.mail, this.pass1, this.pass2);
|
||||
console.log('register', this.mail, this.pass1, this.pass2)
|
||||
// TODO: check for identical password
|
||||
// TODO: check for valide email
|
||||
// TODO: check for unique email
|
||||
if(this.pass1 === this.pass2){
|
||||
if (this.pass1 === this.pass2) {
|
||||
this.userRegister({
|
||||
name: this.mail,
|
||||
mail: this.mail,
|
||||
pass: this.pass1
|
||||
}).then( () => {
|
||||
console.log('registered from register component');
|
||||
console.log('registered from register component')
|
||||
this.$emit('onRegistered')
|
||||
}
|
||||
).catch(( error ) => {
|
||||
).catch((error) => {
|
||||
console.warn('Issue with register from registerform component', error)
|
||||
Promise.reject(error)
|
||||
})
|
||||
@ -84,29 +84,29 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeMount () {
|
||||
if(!this.form){
|
||||
if (!this.form) {
|
||||
this.getRegisterForm()
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
// console.log('LoginBlock mounted');
|
||||
if(this.form){
|
||||
// console.log('LoginBlock mounted')
|
||||
if (this.form) {
|
||||
this.initForm()
|
||||
}
|
||||
},
|
||||
render(h) {
|
||||
// console.log('LoginBlock render');
|
||||
if(!this.form){
|
||||
// console.log('LoginBlock render NAN');
|
||||
// console.log('LoginBlock render')
|
||||
if (!this.form) {
|
||||
// console.log('LoginBlock render NAN')
|
||||
return h('span', 'Loading ...')
|
||||
}else{
|
||||
// console.log('LoginBlock render template');
|
||||
} else {
|
||||
// console.log('LoginBlock render template')
|
||||
return this.form.render.call(this)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pass1: function(n, o){
|
||||
if(n){
|
||||
if (n) {
|
||||
this.ps = passwordStrength(n).value
|
||||
console.log('watch pass1 n', n, 'ps :', this.ps)
|
||||
this.checkSubmitEnabled()
|
||||
|
@ -38,13 +38,13 @@ export default {
|
||||
},
|
||||
onAutoCompleteSelect(event, ui){
|
||||
event.preventDefault();
|
||||
console.log('autoCompleteSelect', event, ui);
|
||||
console.log('autoCompleteSelect', event, ui)
|
||||
this.typed = ui.item.label
|
||||
// we have to wait for typed watch to reset autocomplete before setting it
|
||||
setTimeout(function(){
|
||||
console.log('update autocomplete value after settimeout');
|
||||
console.log('update autocomplete value after settimeout')
|
||||
this.autocomplete = ui.item.value
|
||||
if(this.typed !== this.keys || this.autocomplete !== this.term){
|
||||
if (this.typed !== this.keys || this.autocomplete !== this.term) {
|
||||
this.submit()
|
||||
}
|
||||
}.bind(this), 1)
|
||||
@ -61,9 +61,9 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeMount() {
|
||||
// console.log('SearchForm beforeMount');
|
||||
if(this._props.form){
|
||||
// console.log('SearchForm beforeMount if this._props.form ok');
|
||||
// console.log('SearchForm beforeMount')
|
||||
if (this._props.form) {
|
||||
// console.log('SearchForm beforeMount if this._props.form ok')
|
||||
this.template = Vue.compile(this._props.form)
|
||||
// https://github.com/vuejs/vue/issues/9911
|
||||
this.$options.staticRenderFns = [];
|
||||
@ -73,16 +73,16 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
typed(n, o){
|
||||
console.log('typed changed', o, n);
|
||||
console.log('typed changed', o, n)
|
||||
// is changed also when autocomplete change it ...
|
||||
this.autocomplete = null
|
||||
},
|
||||
keys(n, o){
|
||||
console.log('keys changed', o, n);
|
||||
console.log('keys changed', o, n)
|
||||
this.typed = n
|
||||
},
|
||||
term(n, o){
|
||||
console.log('autocomplete changed', o, n);
|
||||
console.log('autocomplete changed', o, n)
|
||||
this.autocomplete = n
|
||||
}
|
||||
},
|
||||
@ -91,7 +91,7 @@ export default {
|
||||
this.autocomplete = this.term
|
||||
},
|
||||
mounted(){
|
||||
// console.log('SearchForm mounted');
|
||||
// console.log('SearchForm mounted')
|
||||
Drupal.attachBehaviors(this.$el);
|
||||
// get the search input
|
||||
this.$input = this.$el.querySelector('#edit-search')
|
||||
@ -101,10 +101,10 @@ export default {
|
||||
jQuery(this.$input).on('autocompleteselect', this.onAutoCompleteSelect);
|
||||
},
|
||||
render(h) {
|
||||
// console.log('searchForm render');
|
||||
if(!this.template){
|
||||
// console.log('searchForm render')
|
||||
if (!this.template) {
|
||||
return h('span', 'Loading ...')
|
||||
}else{
|
||||
} else {
|
||||
return this.template.render.call(this)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user