Commit f023288b authored by Lucas Détré's avatar Lucas Détré

global refactoring : remove unnecessary spaces in the end of line, breaklines...

global refactoring : remove unnecessary spaces in the end of line, breaklines after vue-ressource call, ordering export default items, remove unnecessary spaces and breaklines all over the code
parent 743bc095
Pipeline #2775 passed with stage
in 1 minute and 27 seconds
......@@ -5,7 +5,6 @@
</div>
</template>
<script>
// loading font awesome icons before rendering anything else
(function() { var css = document.createElement('link'); css.href = 'https://use.fontawesome.com/releases/v5.1.0/css/all.css'; css.rel = 'stylesheet'; css.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(css); })();
......@@ -193,7 +192,7 @@
border: 1px solid #f3f3f3;
padding: 10px;
min-height: 200px;
}
}
.main-button {
border: 1px solid #384EAA;
}
......
<template>
<div id="Accueil">
<div class="container">
<div class="row">
<div class="col-md-12 mt-3">
<h2>Bienvenue sur l'outil Trèfle</h2>
</div>
<div id="Accueil">
<div class="container">
<div class="row">
<div class="col-md-12 mt-3">
<h2>Bienvenue sur l'outil Trèfle</h2>
</div>
<div class="row mt-3">
<div class="col-md-12">
<p>
Trèfle est un outil dédié aux dispositifs de financement des formations.
</p>
<p>
Il recense région par région tous les dispositifs applicables.
</p>
<p>
Trèfle vous permet de consulter ou de modifier un dispositif de financement existant.
</p>
<p>
Les règles enregistrées dans Trèfle alimentent le simulateur de financement de formation disponible sur <a href="https://labonneformation.pole-emploi.fr/" target="_blank">La Bonne Formation</a> et <a href="https://candidat.pole-emploi.fr/formations/accueil" target="_blank">Pole Emploi.fr</a>
</p>
</div>
</div>
<div class="row mt-3">
<div class="col-md-12">
<p>
Trèfle est un outil dédié aux dispositifs de financement des formations.
</p>
<p>
Il recense région par région tous les dispositifs applicables.
</p>
<p>
Trèfle vous permet de consulter ou de modifier un dispositif de financement existant.
</p>
<p>
Les règles enregistrées dans Trèfle alimentent le simulateur de financement de formation disponible sur <a href="https://labonneformation.pole-emploi.fr/" target="_blank">La Bonne Formation</a> et <a href="https://candidat.pole-emploi.fr/formations/accueil" target="_blank">Pole Emploi.fr</a>
</p>
</div>
<div class="row mt-3">
<div class="col-md-4 col-sm-12">
<div id="chart-container">
<ModificationChart @on-receive="update" :values="modification_chart_datas.datasets" :labels="modification_chart_datas.labels"></ModificationChart>
</div>
</div>
<div class="row mt-3">
<div class="col-md-4 col-sm-12">
<div id="chart-container">
<ModificationChart @on-receive="update" :values="modification_chart_datas.datasets" :labels="modification_chart_datas.labels"></ModificationChart>
</div>
<div v-if="!isLoading">
<div class="col-md-8 col-sm-12">
<div id="modification_list">
<div v-if="selected_rule">
<h5> Modification(s) de la règle en cours de validation {{ selected_rule }} ({{ Object.keys(selected_modification_list).length }}) </h5>
<ul v-for="modification in selected_modification_list" :key="modification.id" class="dash">
<li>
<a :href="'referentiel#'+selected_rule+'.rules#modified'"> {{ modification.title }} </a>
</li>
</ul>
</div>
<div v-else>
<h5> Toutes les modifications en cours de validation ({{ Object.keys(modification_list).length }})</h5>
<ul v-for="modification in modification_list" :key="modification.id" class="dash">
<li>
<a :href="'referentiel#'+modification.file.split('/').pop().split('.')[0]+'.rules#modified'"> {{ modification.title }} - ({{ modification.file.split('/').pop().split('.')[0] }})</a>
</li>
</ul>
</div>
</div>
<div v-if="!isLoading">
<div class="col-md-8 col-sm-12">
<div id="modification_list">
<div v-if="selected_rule">
<h5> Modification(s) de la règle en cours de validation {{ selected_rule }} ({{ Object.keys(selected_modification_list).length }}) </h5>
<ul v-for="modification in selected_modification_list" :key="modification.id" class="dash">
<li>
<a :href="'referentiel#'+selected_rule+'.rules#modified'"> {{ modification.title }} </a>
</li>
</ul>
</div>
<div v-else>
<h5> Toutes les modifications en cours de validation ({{ Object.keys(modification_list).length }})</h5>
<ul v-for="modification in modification_list" :key="modification.id" class="dash">
<li>
<a :href="'referentiel#'+modification.file.split('/').pop().split('.')[0]+'.rules#modified'"> {{ modification.title }} - ({{ modification.file.split('/').pop().split('.')[0] }})</a>
</li>
</ul>
</div>
</div>
</div>
<div v-else class="text-center loading-gif">
<img src="./../assets/images/loading.gif" alt="loading...">
</div>
</div>
<div v-else class="text-center loading-gif">
<img src="./../assets/images/loading.gif" alt="loading...">
</div>
</div>
</div>
</div>
</template>
<script>
......@@ -75,6 +75,37 @@
isLoading: true,
}
},
computed : {
modification_chart_datas: function () {
var modifications = [];
var keys = []
for (let [key, value] of Object.entries(this.modification_list)) {
keys.push(key);
modifications.push(value.file.split('/').pop());
}
keys = Object.keys(modifications.reduce(function (acc, curr) {
if (typeof acc[curr] == 'undefined') acc[curr] = 1;
else acc[curr] += 1;
return acc;
}, {}));
modifications = Object.values(modifications.reduce(function (acc, curr) {
if (typeof acc[curr] == 'undefined') acc[curr] = 1;
else acc[curr] += 1;
return acc;
}, {}))
return {
labels: keys,
datasets: [
{
data: modifications
}
]
}
}
},
beforeMount: function() {
this.loadInProgressModification();
},
......@@ -93,7 +124,6 @@
})
},
update (data) {
this.selected_rule = data.value
this.$http
.get('/source/modified?branch='+encodeURIComponent(this.selected_rule))
......@@ -106,43 +136,6 @@
})
}
},
computed : {
modification_chart_datas: function () {
var modifications = [];
var keys = []
for (let [key, value] of Object.entries(this.modification_list)) {
keys.push(key);
modifications.push(value.file.split('/').pop());
}
keys = Object.keys(modifications.reduce(function (acc, curr) {
if (typeof acc[curr] == 'undefined') {
acc[curr] = 1;
} else {
acc[curr] += 1;
}
return acc;
}, {}));
modifications = Object.values(modifications.reduce(function (acc, curr) {
if (typeof acc[curr] == 'undefined') {
acc[curr] = 1;
} else {
acc[curr] += 1;
}
return acc;
}, {}))
return {
labels: keys,
datasets: [
{
data: modifications
}
]
}
}
}
}
</script>
......@@ -151,5 +144,4 @@
width: 20rem;
height: 20rem;
}
</style>
......@@ -3,7 +3,7 @@
<div class="container mb-0 mt-0">
<div class="row">
<div class="col-md-12">
<h2>Catalogue</h2>
<h2>Catalogue</h2>
<input type="text" ref="intercarif" placeholder="Identifiant INTERCARIF" v-model="intercarif" class="form-control"><br>
<input @click="search()" type="button" class="btn main-button pull-right" value="Chercher">
</div>
......@@ -36,20 +36,22 @@
},
methods: {
search: function () {
this.$http.get('/explore/catalog?id='+this.intercarif).then(response => {
this.results = response.body;
this.resultsIsEmpty = this.isEmpty(this.results);
}, () => {
this.resultsIsEmpty = this.isEmpty(this.results);
}).created;
this.$http
.get('/explore/catalog?id='+this.intercarif)
.then(response => {
this.results = response.body;
this.resultsIsEmpty = this.isEmpty(this.results);
}, () => {
this.resultsIsEmpty = this.isEmpty(this.results);
})
.created;
},
isEmpty: function (obj) {
for(var key in obj) {
if(obj.hasOwnProperty(key))
return false;
if(obj.hasOwnProperty(key)) return false;
}
return true;
}
}
}
}
</script>
......@@ -5,7 +5,7 @@
<div class="col-md-12">
<h2>Certif Info</h2>
<input type="text" ref="certifinfo" placeholder="Code Certif Info" v-model="certifinfo" class="form-control"><br>
<input @click="search()" type="button" class="btn main-button pull-right" value="Chercher">
<input @click="search()" type="button" class="btn main-button pull-right" value="Chercher">
</div>
</div>
<br>
......@@ -36,22 +36,22 @@
resultsIsEmpty: false,
}
},
computed: {
},
methods: {
search: function () {
this.$http.get('/certifinfo?q='+this.certifinfo).then(response => {
this.results = response.body;
this.resultsIsEmpty = this.isEmpty(this.results);
}).created;
this.$http
.get('/certifinfo?q='+this.certifinfo)
.then(response => {
this.results = response.body;
this.resultsIsEmpty = this.isEmpty(this.results);
})
.created;
},
isEmpty: function (obj) {
for(var key in obj) {
if(obj.hasOwnProperty(key))
return false;
if(obj.hasOwnProperty(key)) return false;
}
return true;
}
}
}
}
</script>
......@@ -132,11 +132,14 @@
},
methods: {
load: function () {
this.$http.get('/explore/financements').then(response => {
this.financements = response.body;
this.filteredFinancements = response.body;
this.isLoading = false;
}).created;
this.$http
.get('/explore/financements')
.then(response => {
this.financements = response.body;
this.filteredFinancements = response.body;
this.isLoading = false;
})
.created;
},
setSearchTag: function (tag) {
this.search = tag;
......@@ -171,7 +174,6 @@
#financement-header-row {
padding-top: 3rem;
}
.financement-count-financements-text {
font-size: 1.5em;
}
......@@ -179,26 +181,21 @@
font-size: 2.5em;
font-style: bolder;
}
#financement-last-update {
font-size: 0.9em;
color: #000; /* Fallback for older browsers */
color: rgba(0, 0, 0, 0.5);
}
.financement-results-count {
color: #000; /* Fallback for older browsers */
color: rgba(0, 0, 0, 0.5);
}
#financement-results-list {
padding-top: 0.5rem;
}
.financement-results-tags {
margin-right: 5px;
}
.financement-horizontal-separator {
border: none;
border-top: 1px solid #bfbfbf;
......@@ -206,8 +203,6 @@
width: 90%;
position:relative;
}