tethys/resources/js/releaseDataset.js
Arno Kaimbacher af9b775dd7 - cron job: sql code um 14 tagelangen Review-Prozess zu überwchen, wurde auf postgresl angepass
- default there is no reviewer selected for releasing a dataset
2020-06-10 21:09:38 +02:00

53 lines
1.5 KiB
JavaScript

// releaseDataset.js
import Vue from 'vue';
import VeeValidate from 'vee-validate';
Vue.use(VeeValidate);
const app = new Vue({
el: '#app1',
data() {
return {
// dataset: {
// firstName: '',
// preferred_reviewer: null,
// preferred_reviewer_email: null
// },
dataset: window.Laravel.dataset,
submitted: false,
preferation: "no_preferation",
}
},
computed: {
isPreferationRequired() {
return this.preferation === "yes_preferation";
},
},
watch: {
preferation(val) {
if (val === "no_preferation") {
this.dataset.preferred_reviewer = "";
this.dataset.preferred_reviewer_email = "";
}
}
},
methods: {
checkForm(e) {
// Log entire model to console
// console.log(this.dataset);
this.submitted = true;
this.$validator.validate().then(result => {
if (result) {
if (this.preferation === "no_preferation") {
this.dataset.preferred_reviewer = "";
this.dataset.preferred_reviewer_email = "";
}
// console.log('From Submitted!');
document.getElementById("releaseForm").submit();
return;
}
});
}
}
});