Commit 8d071da0 authored by Lucas Détré's avatar Lucas Détré

changing rule modification workflow and adding modification display

parent efc5d001
Pipeline #2280 passed with stage
in 1 minute and 15 seconds
......@@ -1710,6 +1710,11 @@
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==",
"dev": true
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
},
"accepts": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
......@@ -3993,6 +3998,29 @@
"integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==",
"dev": true
},
"diff": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
"integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A=="
},
"diff2html": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/diff2html/-/diff2html-3.1.2.tgz",
"integrity": "sha512-yn4SXS6Em3Ml9ejsj8cWBcjWwSFOFwOd4Qd3U7pJHpyM3agY2lU+gxU2WedLxAgCMXffsublB96gG26efheCxQ==",
"requires": {
"diff": "4.0.2",
"highlight.js": "9.18.1",
"hogan.js": "3.0.2"
},
"dependencies": {
"highlight.js": {
"version": "9.18.1",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.18.1.tgz",
"integrity": "sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==",
"optional": true
}
}
},
"diffie-hellman": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
......@@ -5971,6 +5999,22 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
"hogan.js": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/hogan.js/-/hogan.js-3.0.2.tgz",
"integrity": "sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=",
"requires": {
"mkdirp": "0.3.0",
"nopt": "1.0.10"
},
"dependencies": {
"mkdirp": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz",
"integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4="
}
}
},
"hoopy": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz",
......@@ -7471,6 +7515,11 @@
}
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"move-concurrently": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
......@@ -7661,6 +7710,14 @@
}
}
},
"nopt": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz",
"integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=",
"requires": {
"abbrev": "1"
}
},
"normalize-package-data": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
......@@ -11088,6 +11145,14 @@
"vue-style-loader": "^4.1.0"
}
},
"vue-moment": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/vue-moment/-/vue-moment-4.1.0.tgz",
"integrity": "sha512-Gzisqpg82ItlrUyiD9d0Kfru+JorW2o4mQOH06lEDZNgxci0tv/fua1Hl0bo4DozDV2JK1r52Atn/8QVCu8qQw==",
"requires": {
"moment": "^2.19.2"
}
},
"vue-resource": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/vue-resource/-/vue-resource-1.5.1.tgz",
......@@ -11127,6 +11192,21 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vue-textarea-autosize": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/vue-textarea-autosize/-/vue-textarea-autosize-1.1.1.tgz",
"integrity": "sha512-B33Mg5ZDEfj/whhoPBLg25qqAdGHGM2NjDT99Qi5MXRyeLmXb4C3s6EprAHqy3nU0cooWXFU+IekI5DpoEbnFg==",
"requires": {
"core-js": "^2.6.5"
},
"dependencies": {
"core-js": {
"version": "2.6.11",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz",
"integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg=="
}
}
},
"vue2-editor": {
"version": "2.10.2",
"resolved": "https://registry.npmjs.org/vue2-editor/-/vue2-editor-2.10.2.tgz",
......
......@@ -12,9 +12,12 @@
"bootstrap-vue": "^2.4.2",
"codes-postaux": "^3.3.0",
"core-js": "^3.3.2",
"diff2html": "^3.1.2",
"vue": "^2.6.10",
"vue-moment": "^4.1.0",
"vue-resource": "^1.5.1",
"vue-router": "^3.1.3",
"vue-textarea-autosize": "^1.1.1",
"vue2-editor": "^2.10.2"
},
"devDependencies": {
......
<template>
<div id="Modification">
<span v-if="this.toggled" @click="toggled = !toggled" style="cursor:pointer">
<h5 class="d-inline-block text-nowrap" style="display:inline">
{{ modification.title }} - {{ modification.date | moment("DD/MM/YYYY") }}
<h6 class="text-muted font-weight-light" style="display:inline">({{ modification.date | moment("from", "now") }})</h6>
<span class="fas fa-chevron-up modification-menu-chevron fa-sm"></span>
</h5>
</span>
<span v-if="!this.toggled" @click="toggled = !toggled" style="cursor:pointer">
<h5>
{{ modification.title }} - {{ modification.date | moment("DD/MM/YYYY") }}
<h6 class="text-muted font-weight-light" style="display:inline">({{ modification.date | moment("from", "now") }})</h6>
&nbsp;
<span class="fas fa-chevron-down modification-menu-chevron fa-sm"></span>
</h5>
</span>
<div v-show="this.toggled">
<div v-html="prettyHtml" />
</div>
</div>
</template>
<script>
import * as Diff2Html from 'diff2html';
import 'diff2html/bundles/css/diff2html.min.css';
export default {
name: 'Modification',
props: ['modification'],
data: function() {
return {
toggled: false,
formated_diff: '--- a/'+this.modification.file+'\n+++ b/'+this.modification.file+'\n'+this.modification.diff,
formated_date: new Date(this.modification.date).getDate() + '/' + new Date(this.modification.date).getMonth() + '/' + new Date(this.modification.date).getFullYear(),
}
},
mounted() {
this.$moment.locale('fr')
},
computed : {
prettyHtml: function () {
return Diff2Html.html(this.formated_diff, {
matching: 'lines',
outputFormat: 'side-by-side',
});
},
}
}
</script>
<style scoped>
.modification-menu-chevron {
vertical-align: -5%;
margin-left: 10px;
}
</style>
......@@ -4,32 +4,46 @@
<div class="row mb-3">
<div class="col-md-6 col-sm-12 col-xs-12">
<h5>
<span style="vertical-align:-30%" >{{ this.displayedName }}</span>
<span style="vertical-align:-30%" >{{ displayedName }}</span>
</h5>