Commit 7612bbbf authored by Lucas Détré's avatar Lucas Détré

add fields to rule modification interface (email, authentification key) TODO:...

add fields to rule modification interface (email, authentification key) TODO: generate key on the server side
parent 502a7fca
......@@ -28,11 +28,30 @@
<div class="container">
<div class="row mb-3">
<label for="content"><u>Contenu de la règle</u></label>
<textarea v-model="content" rows="15" class="mb-3"></textarea>
<textarea id="content" v-model="content" rows="15" class="mb-3"></textarea>
<div class="row mb-3">
<label for="comment" class="mb-2"><u>Résumé de la modification</u></label>
<textarea v-model="comment" rows="3"></textarea>
<label for="comment" class="mb-2"><u>Résumé de la modification</u> * </label>
<textarea id="comment" v-model="comment" rows="3"></textarea>
<div class="row mb-3">
<div class="col-md-12 pl-0">
<label for="contributor_email" class="pb-2"><u>Votre email</u> *</label>
<div class="col-md-12 pl-0">
<input id="contributor_email" v-model="contributor_email" type="text"/>
<div class="row mb-3">
<div class="col-md-12 pl-0">
<label for="modification_key" class="mb-2">
<u>Clé de modification</u> *
<div class="col-md-12 pl-0">
<input id="modification_key" v-model="user_modification_key" type="text" class="form-input" :class="{badKeyClass: badKey}"/><br>
<span v-if="badKey" class="text-danger font-weight-light">Mauvaise clé de modification, veuillez rééssayer</span>
<div class="row mb-3">
<div class="col-md-6 pl-0">
......@@ -67,10 +86,17 @@
content: '',
comment: '',
contributor_email: '',
user_modification_key: '',
isEditMode: false,
badKey: false,
computed: {
modification_key: function() {
// TODO récupération de la clé niveau serveur
return "clé";
ruleTree: function() {
return this.toTree(this.ruleData.split('\n'));
......@@ -89,8 +115,11 @@
save: function() {
if(this.user_modification_key != this.modification_key) return this.badKey = true;
this.ruleData = this.content
const postData = {
comment: this.comment,
content: this.content,
......@@ -103,8 +132,8 @@
var commit = {}
commit.url = '' +
commit.title = response.title
this.rules[this.activeRuleName]['data'] =
this.rules[this.activeRuleName]['gitlab'] = {'commit': commit}
this.$parent.rules[]['data'] =
this.$parent.rules[]['gitlab'] = {'commit': commit}
return this.isEditMode=!this.isEditMode
......@@ -150,4 +179,9 @@
<style scoped>
.badKeyClass {
color: red;
border: 1px solid red;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment