Commit 1d80e809 authored by Jérémie Passerat's avatar Jérémie Passerat

Tags libres, 1ere partie

parent 2b064be2
<template> <template>
<div> <div style="text-align: center">Bonjour, je suis le menu de gestion des tags libres</div>
<p>Tags (a définir et à réaliser)</p>
</div>
</template> </template>
<script> <script>
export default { export default {
name: "Tags" name: "GererTagsLibres"
} }
</script> </script>
<style scoped> <style scoped>
p {
text-align: center;
}
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
@majNvoContenu="majNvoContenu" @majContenus="majContenus = !majContenus" @majNvoContenu="majNvoContenu" @majContenus="majContenus = !majContenus"
v-bind:rechercherPublications="rechercherPublications"></Maj> v-bind:rechercherPublications="rechercherPublications"></Maj>
<Profil v-show="etat === 'Profil'" ></Profil> <Profil v-show="etat === 'Profil'" ></Profil>
<Tags v-show="etat === 'Tags'" ></Tags> <GererTagsLibres v-show="etat === 'Tags'" ></GererTagsLibres>
<TagsFixes v-show="etat === 'newContenu_Tags'"></TagsFixes>
<p style="text-align: center" v-show="errorLogin">{{errorMessage}}</p> <p style="text-align: center" v-show="errorLogin">{{errorMessage}}</p>
<NewContenu v-show="etat === 'newContenu'" v-bind:auteur="auteur" @contenuAjoute="ajouterUnContenu" @retourArriere="retourArriere"></NewContenu> <NewContenu v-show="etat === 'newContenu'" v-bind:auteur="auteur" @contenuAjoute="ajouterUnContenu" @retourArriere="retourArriere"></NewContenu>
<ImporterFichier v-show="etat === 'importContenu'" v-bind:auteur="auteur" @contenuAjoute="ajouterUnContenu" @retourArriere="retourArriere"></ImporterFichier> <ImporterFichier v-show="etat === 'importContenu'" v-bind:auteur="auteur" @contenuAjoute="ajouterUnContenu" @retourArriere="retourArriere"></ImporterFichier>
...@@ -29,9 +30,10 @@ import Contenu from "./Contenu"; ...@@ -29,9 +30,10 @@ import Contenu from "./Contenu";
import Menu from "./Menu"; import Menu from "./Menu";
import Maj from "./Maj"; import Maj from "./Maj";
import Profil from "./Profil"; import Profil from "./Profil";
import Tags from "./GererTags";
import NewContenu from "./NewContenu"; import NewContenu from "./NewContenu";
import ImporterFichier from "./ImporterFichier"; import ImporterFichier from "./ImporterFichier";
import GererTagsLibres from "@/GererTagsLibres";
import TagsFixes from "@/TagsFixes";
// import Service from "./service/Service"; // import Service from "./service/Service";
// import showdown from "showdown" // import showdown from "showdown"
...@@ -161,14 +163,15 @@ export default { ...@@ -161,14 +163,15 @@ export default {
}, },
components:{ components:{
TagsFixes,
GererTagsLibres,
ImporterFichier, ImporterFichier,
NewContenu, NewContenu,
Login, Login,
Contenu, Contenu,
Menu, Menu,
Maj, Maj,
Profil, Profil
Tags
} }
} }
</script> </script>
......
<template> <template>
<div> <div>
<div id="markdown" v-show="isCreation">
<div id="titreContenu"> <div id="titreContenu">
<label>Titre du contenu : </label><br> <label>Titre du contenu : </label><br>
<input type="text" placeholder="titre du contenu" v-model="titreContenu"> <input type="text" placeholder="titre du contenu" v-model="titreContenu">
...@@ -17,20 +18,25 @@ ...@@ -17,20 +18,25 @@
</div> </div>
<div class="markdown"> <div class="markdown">
<br> <br>
<button class="ajouterContenu" v-on:click="ajouterContenu">créer </button> <button class="ajouterContenu" v-on:click="choisirTags">créer </button>
<button class="retourArriere" v-on:click="retourArriere"> revenir en arrière</button> <button class="retourArriere" v-on:click="retourArriere(false)"> revenir en arrière</button>
</div> </div>
</div> </div>
<TagsFixes v-show="!isCreation" @tags="ajouterContenu"></TagsFixes>
</div>
</template> </template>
<script> <script>
// import VueSimplemde from 'vue-simplemde' // import VueSimplemde from 'vue-simplemde'
import Service from "./service/Service"; import Service from "./service/Service";
import TagsFixes from "@/TagsFixes";
export default { export default {
name: "NewContenu", name: "NewContenu",
components: {TagsFixes},
props: { props: {
// l'auteur connecté // l'auteur connecté
auteur: {} auteur: {}
...@@ -42,13 +48,19 @@ export default { ...@@ -42,13 +48,19 @@ export default {
bold: true, bold: true,
language: 'fr' language: 'fr'
}, },
titreContenu: "" titreContenu: "",
isCreation: true
} }
}, },
methods: { methods: {
ajouterContenu: function () { choisirTags: function () {
this.isCreation = false
},
ajouterContenu: function (event) {
let data = {auteur: this.auteur, contenu_a_ecrire: this.contenuSaisi, titre: this.titreContenu} //alert(event.tags)
let data = {auteur: this.auteur, contenu_a_ecrire: this.contenuSaisi, titre: this.titreContenu, tags: event.tags}
let that = this let that = this
Service.creerContenuPerso(data).then( Service.creerContenuPerso(data).then(
function (reponse) { function (reponse) {
...@@ -56,7 +68,7 @@ export default { ...@@ -56,7 +68,7 @@ export default {
nouveauContenu.provenance = "perso" nouveauContenu.provenance = "perso"
that.$emit("contenuAjoute", {contenu: nouveauContenu}) that.$emit("contenuAjoute", {contenu: nouveauContenu})
that.contenuSaisi = '' that.contenuSaisi = ''
that.retourArriere() that.retourArriere(true)
} }
) )
}, },
...@@ -64,9 +76,9 @@ export default { ...@@ -64,9 +76,9 @@ export default {
* @vuese * @vuese
* (A construire) Fonction de changement du mot de passe utilisateur * (A construire) Fonction de changement du mot de passe utilisateur
*/ */
retourArriere: function () { retourArriere: function (cree) {
// evenement pour retourner vers le volet Contenu_Base // evenement pour retourner vers le volet Contenu_Base
this.$emit("retourArriere") this.$emit("retourArriere", {cree: cree})
} }
} }
} }
......
<template>
<div style="text-align: center">
<p>Bienvenue dans la page de choix des tags</p>
<p>Pour compléter le contenu ajouté, il va falloir lui associer des tags</p>
<label>Choisir le tag de niveau 1</label><br><br>
<select @change="niveau1()" v-model="tagUn">
<option>Tag1.1</option>
<option>Tag1.2</option>
<option>Tag1.3</option>
</select><br><br>
<label>Choisir le tag de niveau 2</label><br><br>
<select @change="niveau2()" :disabled="niveauDeux === 0" v-model="tagDeux">
<option v-for="i in 3" :key="i">{{tagUn}}{{ i }}</option>
</select><br><br>
<label>Choisir le tag de niveau 3</label><br><br>
<select @change="niveau3()" :disabled="niveauTrois === 0" v-model="tagTrois">
<option v-for="i in 5" :key="i">{{tagDeux}}{{ i }}</option>
</select><br><br>
<!-- <button v-on:click="validerTags">Valider</button>-->
</div>
</template>
<script>
export default {
name: "TagsFixes",
data: function(){
return {
niveauDeux: 0,
niveauTrois: 0,
tagUn: '',
tagDeux: '',
tagTrois: ''
}
},
methods:{
validerTags: function () {
this.$emit("tags", {tags: []})
},
/**
* @vuese
Quand le 1er tag est choisi, on débloque le 2e tag
*/
niveau1: function () {
this.niveauDeux = 1
},
/**
* @vuese
* Quand le 2e tag est choisi, on débloque le 3e tag
*/
niveau2: function () {
this.niveauTrois = 1
},
/**
* @vuese
* QUand le 3e tag est choisi, on renvoie les infos à NewContenu ou à ImporterFichier
*/
niveau3: function () {
//alert("en haut et en bas")
this.$emit("tags", {tags: [this.tagUn, this.tagDeux, this.tagTrois]})
}
}
}
</script>
<style scoped>
button {
width: auto;
text-align: center;
height: auto;
}
</style>
\ No newline at end of file
<template>
<div>
<div id="tagsPresents"><br>
<label>Voici les tags libres présents sur ce contenu :</label><br>
<p v-if="tagsLibres.length === 0">Aucun tag présent</p>
<ul v-else>
<li v-for="tag in tagsLibres" :key="tag">{{tag}} <button class="supprimerTag" @click="supprimerTag(tag)"></button></li>
</ul>
</div>
<div id="ajouterTag">
<label>Ajouter un tag existant :</label><br>
<select @change="ajouterLeTag" v-model="ajouterTagExistant">
<option></option>
<option v-for="tag in tagsDeAuteur" :key="tag">{{ tag }}</option>
</select><br><br>
</div>
<div id="creationTag">
<label>Creer un tag libre :</label><br>
<input type="text" placeholder="tag a créer" v-model="nouveauTag">
<button id="creerTag" v-on:click="creerTag"></button>
</div>
</div>
</template>
<script>
import Service from "./service/Service";
export default {
name: "TagsLibres",
props: {
// récupération du contenu cliqué
contenu: {},
// récupération de l'auteur
auteur: {}
},
methods:{
ajouterLeTag: function () {
/* let data = {auteur: this.auteur, id_contenu: JSON.stringify(this.contenu._id), tag: this.ajouterTagExistant}
Service.ajouterTagLibre(data)*/
// Associer le tag au contenu pour l'auteur connecté
// Et l'ajouter à l'array des tags libres de Vue
let data = {auteur: this.auteur, id_contenu: JSON.stringify(this.contenu._id), tag: this.ajouterTagExistant}
Service.associerTagLibre(data)
this.tagsLibres.push(this.ajouterTagExistant)
this.ajouterTagExistant = ""
},
creerTag: function () {
this.tagsLibres.push(this.nouveauTag)
let data = {auteur: this.auteur, id_contenu: JSON.stringify(this.contenu._id), tag: this.nouveauTag}
Service.ajouterTagLibre(data)
this.nouveauTag = ""
// this.ajouterTag(this.nouveauTag)
},
supprimerTag: function (tagAVirer) {
this.tagsLibres = this.tagsLibres.filter(tag => tag !== tagAVirer)
let data = {auteur: this.auteur, id_contenu: JSON.stringify(this.contenu._id), tag: tagAVirer}
Service.dissocierTagLibre(data)
}
},
data: function () {
return {
tagsLibres: [],
tagsDeAuteur: [],
ajouterTagExistant: '',
nouveauTag: ''
}
},
watch:{
contenu: function () {
let that = this
//this.tagsLibres = this.contenu.tags_libres
Service.recupererTagLibre(this.auteur).then(function (response) {
that.tagsDeAuteur = response.data
Service.recupererTagLibreContenu(JSON.stringify(that.contenu._id), that.auteur).then(function (response) {
// alert(response.data)
that.tagsLibres = response.data
})
})
},
}
}
</script>
<style scoped>
ul {
list-style:none;
}
.supprimerTag {
background: aqua url(assets/img/croix2.png);
background-size: cover;
border: none;
}
#creerTag {
background: aqua url(assets/img/coche2.png);
background-size: cover;
border: none;
margin-left: 3px;
}
</style>
\ No newline at end of file
<template> <template>
<div > <div>
<div id="titreContenu"> <div id="titreContenu">
<!-- <select v-show="(contenuCliqueProvenance === 'banque' <!-- <select v-show="(contenuCliqueProvenance === 'banque'
|| contenuCliqueProvenance === 'perso') || contenuCliqueProvenance === 'perso')
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
Note de la version : {{noteContenu}}<br> Note de la version : {{noteContenu}}<br>
Popularité : {{contenuClique.popularite}}<br> Popularité : {{contenuClique.popularite}}<br>
</div> </div>
<button id="tagsLibres" v-on:click="modifierTags">{{ titreModifierTags }}</button>
<div id="modifTitre"> <div id="modifTitre">
<div id="changerTitre"> <div id="changerTitre">
...@@ -43,10 +45,11 @@ ...@@ -43,10 +45,11 @@
</div> </div>
</div> </div>
<br> <br>
<div class="mavonEditor"> <div class="mavonEditor" v-show="!isModeTag">
<mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/> <mavon-editor :language="'fr'" style="position: static; height: 79vh; margin-top: -0.5%" v-model="texteDuContenu"/>
</div> </div>
<TagsLibres v-show="isModeTag" v-bind:contenu="this.contenuClique" v-bind:auteur="auteur" style="position: static; height: 79vh; margin-top: -0.5%"></TagsLibres>
<div class="markdown"> <div class="markdown">
<br> <br>
<button id="validerModif" v-on:click="action('valider')">modifier </button> <button id="validerModif" v-on:click="action('valider')">modifier </button>
...@@ -61,11 +64,13 @@ ...@@ -61,11 +64,13 @@
import Service from "@/service/Service"; import Service from "@/service/Service";
import StarRating from 'vue-star-rating' import StarRating from 'vue-star-rating'
import TagsLibres from "@/TagsLibres";
export default { export default {
name: "Modifier_Contenu", name: "Modifier_Contenu",
components: { components: {
TagsLibres,
StarRating StarRating
}, },
props: { props: {
...@@ -92,6 +97,8 @@ export default { ...@@ -92,6 +97,8 @@ export default {
messageNoter: "noter", messageNoter: "noter",
populariteContenu: 0, populariteContenu: 0,
noteContenu: 0, noteContenu: 0,
isModeTag: false,
titreModifierTags: "modifier Tags"
} }
}, },
methods: { methods: {
...@@ -100,7 +107,7 @@ export default { ...@@ -100,7 +107,7 @@ export default {
* Gestion de l'action choisie par l'utilisateur : soit valider une modification de l'intérieur du contenu, soit revenir en arrière * Gestion de l'action choisie par l'utilisateur : soit valider une modification de l'intérieur du contenu, soit revenir en arrière
*/ */
action: function (actionChoisie) { action: function (actionChoisie) {
this.isModeTag = false
if (actionChoisie === 'valider'){ if (actionChoisie === 'valider'){
// evenement de modification du texte d'un contenu // evenement de modification du texte d'un contenu
// @arg l'action choisie, ici 'valider' // @arg l'action choisie, ici 'valider'
...@@ -142,19 +149,40 @@ export default { ...@@ -142,19 +149,40 @@ export default {
*/ */
setRating: function () { setRating: function () {
let that = this let that = this
let data={id_contenu: JSON.stringify(this.contenuClique._id), note: this.rating, auteur: this.auteur, version: this.contenuClique.version} alert(this.contenuClique.version)
let data = {
id_contenu: JSON.stringify(this.contenuClique._id),
note: this.rating,
auteur: this.auteur,
version: this.contenuClique.version
}
Service.noterContenu(data).then(function (response) { Service.noterContenu(data).then(function (response) {
document.getElementById('noterContenu').click() document.getElementById('noterContenu').click()
that.notePresente = true that.notePresente = true
that.messageNoter = "Voir votre note" that.messageNoter = "Voir votre note"
let notes = JSON.parse(response.data) let notes = JSON.parse(response.data)
that.$emit("majMoyenne", {id: that.contenuClique._id, note: notes[0], nbreNotes: notes[1], notePerso: that.rating}) that.$emit("majMoyenne", {
id: that.contenuClique._id,
note: notes[0],
nbreNotes: notes[1],
notePerso: that.rating
}) })
})
},
/**
* Déclencheur du mode "edition de tag"
*/
modifierTags: function () {
this.isModeTag = !this.isModeTag
if (this.isModeTag){
this.titreModifierTags = "modifier contenu"
} else {
this.titreModifierTags = "modifier tags"
} }
}
},computed: { },computed: {
/** /**
...@@ -189,7 +217,6 @@ export default { ...@@ -189,7 +217,6 @@ export default {
contenuClique: function () { contenuClique: function () {
this.titreContenu = this.contenuClique.titre this.titreContenu = this.contenuClique.titre
this.noteContenu = this.calculerNoteContenu this.noteContenu = this.calculerNoteContenu
this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse'); this.isContenuRefuse = Object.prototype.hasOwnProperty.call(this.contenuClique, 'refuse');
...@@ -230,6 +257,12 @@ button { ...@@ -230,6 +257,12 @@ button {
width: auto; width: auto;
} }
#tagsLibres {
margin: 20px 10px;
flex-basis: 9%;
}
#titreDuContenu { #titreDuContenu {
margin-left: 5px; margin-left: 5px;
} }
...@@ -248,7 +281,7 @@ button { ...@@ -248,7 +281,7 @@ button {
#typeEtSource, #notePopularite { #typeEtSource, #notePopularite {
margin-top: 10px; margin-top: 10px;
flex-basis: 12.5%; flex-basis: 9%;
margin-bottom: 10px; margin-bottom: 10px;
} }
...@@ -262,7 +295,7 @@ button { ...@@ -262,7 +295,7 @@ button {
#modifTitre { #modifTitre {
margin-top: 5px; margin-top: 5px;
flex-basis: 50%; flex-basis: 43%;
margin-right: 5px; margin-right: 5px;
display: flex; display: flex;
justify-content: center; justify-content: center;
......
...@@ -86,9 +86,9 @@ ...@@ -86,9 +86,9 @@
<td v-if="item.provenance === 'en-cours'"> - </td> <td v-if="item.provenance === 'en-cours'"> - </td>
<td v-else>{{ calculerNote(item) }}</td> <td v-else>{{ calculerNote(item) }}</td>
<td>{{ item.note_perso }}</td> <td>{{ item.note_perso }}</td>
<td v-show="!isActif" v-if="item.provenance !== 'en-cours'" v-b-popover.hover.bottom="item.tags_banque_fixes.toString()">{{item.tags_banque_fixes.toString()}}</td> <td v-show="!isActif" v-if="item.provenance !== 'en-cours'" v-b-popover.hover.bottom="item.tags_fixes.toString()">{{item.tags_fixes.toString()}}</td>
<td v-show="!isActif" v-else v-b-popover.hover.bottom="'tags non disponibles'">tags non disponibles</td> <td v-show="!isActif" v-else v-b-popover.hover.bottom="'tags non disponibles'">tags non disponibles</td>
<td v-show="!isActif" v-if="item.provenance !== 'en-cours'" v-b-popover.hover.bottom="item.tags_banque_libres.toString()">{{item.tags_banque_libres.toString()}}</td> <td v-show="!isActif" v-if="item.provenance !== 'en-cours'" v-b-popover.hover.bottom="'tags_libres'">tags_libres</td>
<td v-show="!isActif" v-else v-b-popover.hover.bottom="'tags non disponibles'">tags non disponibles</td> <td v-show="!isActif" v-else v-b-popover.hover.bottom="'tags non disponibles'">tags non disponibles</td>
<td>{{ item.type }}</td> <td>{{ item.type }}</td>
<td>{{ item.source }}</td> <td>{{ item.source }}</td>
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<td>{{item.versionEnCours.date}}</td> <td>{{item.versionEnCours.date}}</td>
<td class="prout">{{item.popularite}}</td> <td class="prout">{{item.popularite}}</td>
<td>{{calculerNote(item)}}</td> <td>{{calculerNote(item)}}</td>
<td v-show="!isActif" v-b-popover.hover.bottom="item.tags_banque_fixes.toString()">{{item.tags_banque_fixes.toString()}}</td> <td v-show="!isActif" v-b-popover.hover.bottom="item.tags_fixes.toString()">{{item.tags_fixes.toString()}}</td>
<td>{{ item.type }}</td> <td>{{ item.type }}</td>
<td>{{ item.source }}</td> <td>{{ item.source }}</td>
<td class="boutonSupprimer"> <input type="checkbox" v-on:change="ajouterCoche(item._id, item.versionEnCours)" class="horns" name="horns"/></td> <td class="boutonSupprimer"> <input type="checkbox" v-on:change="ajouterCoche(item._id, item.versionEnCours)" class="horns" name="horns"/></td>
...@@ -740,14 +740,14 @@ export default { ...@@ -740,14 +740,14 @@ export default {
let filtre_tags_libres = (event.filtres.filter(contenu => contenu.type === 'tags libres').map(contenu => contenu.filtre)) let filtre_tags_libres = (event.filtres.filter(contenu => contenu.type === 'tags libres').map(contenu => contenu.filtre))
for (let i = 0; i < filtre_tags_libres.length; i++) { for (let i = 0; i < filtre_tags_libres.length; i++) {
contenusFiltres = contenusFiltres.filter(contenu => contenu.tags_banque_libres.includes(filtre_tags_libres[i])) contenusFiltres = contenusFiltres.filter(contenu => contenu.tags_libres.includes(filtre_tags_libres[i]))
} }
} }
if (event.filtres.filter(contenu => contenu.type === 'tags officiels').length > 0) { if (event.filtres.filter(contenu => contenu.type === 'tags officiels').length > 0) {
// tags officiels // tags officiels
let filtre_tags_fixes = (event.filtres.filter(contenu => contenu.type === 'tags officiels').map(contenu => contenu.filtre)) let filtre_tags_fixes = (event.filtres.filter(contenu => contenu.type === 'tags officiels').map(contenu => contenu.filtre))
for (let i = 0; i < filtre_tags_fixes.length; i++) { for (let i = 0; i < filtre_tags_fixes.length; i++) {
contenusFiltres = contenusFiltres.filter(contenu => contenu.tags_banque_fixes.includes(filtre_tags_fixes[i])) contenusFiltres = contenusFiltres.filter(contenu => contenu.tags_fixes.includes(filtre_tags_fixes[i]))
} }
} }
if (event.filtres.filter(contenu => contenu.type === 'type').length > 0) { if (event.filtres.filter(contenu => contenu.type === 'type').length > 0) {
...@@ -839,7 +839,6 @@ export default { ...@@ -839,7 +839,6 @@ export default {
break break
case "Date Version actuelle": case "Date Version actuelle":
this.dateTriee = !this.dateTriee this.dateTriee = !this.dateTriee
alert("Mais oui")
if (this.dateTriee) if (this.dateTriee)
this.contenus.sort((a,b) => (a.versionEnCours.date > b.versionEnCours.date) ? 1 : ((b.versionEnCours.date > a.versionEnCours.date) ? -1 : 0)) this.contenus.sort((a,b) => (a.versionEnCours.date > b.versionEnCours.date) ? 1 : ((b.versionEnCours.date > a.versionEnCours.date) ? -1 : 0))
else else
...@@ -899,7 +898,6 @@ export default { ...@@ -899,7 +898,6 @@ export default {
if (item.version !== undefined && item.version !== item.versionEnCours.numero){ if (item.version !== undefined && item.version !== item.versionEnCours.numero){
for (let it in item.historique){ for (let it in item.historique){
alert(item.historique[it].numero + " " + item.version)
if (item.historique[it].numero === item.version){ if (item.historique[it].numero === item.version){
if (item.historique[it].note === 0){ if (item.historique[it].note === 0){
return 0 return 0
......
...@@ -111,6 +111,25 @@ export default { ...@@ -111,6 +111,25 @@ export default {
recupererNoteContenu(idContenu, auteur, version){ recupererNoteContenu(idContenu, auteur, version){
return axios.get(urlBase + contenus + "recupererNote?auteur=" + auteur + "&version=" + version + "&id_contenu=" + idContenu, this.getHeader(localStorage.token)) return axios.get(urlBase + contenus + "recupererNote?auteur=" + auteur + "&version=" + version + "&id_contenu=" + idContenu, this.getHeader(localStorage.token))
}, },
// gestion des contenus - fonctions spéciales tags
ajouterTagLibre(data){
return axios.patch(urlBase + contenus + "newTagLibre", data, this.getHeader(localStorage.token))
},
recupererTagLibre(auteur){
return axios.get(urlBase + contenus + "getTagLibre/" + auteur, this.getHeader(localStorage.token))
},
recupererTagLibreContenu(idContenu, auteur){
return axios.get(urlBase + contenus + "getTagLibreContenu/" + idContenu + "/" + auteur, this.getHeader(localStorage.token))
},
associerTagLibre(data){
return axios.patch(urlBase + contenus + "associerTagLibre", data, this.getHeader(localStorage.token))
},
dissocierTagLibre(data){
return axios.patch(urlBase + contenus + "dissocierTagLibre", data, this.getHeader(localStorage.token))
},
/* supprimerTagLibre(idContenu, auteur, version){
//return axios.delete(urlBase + contenus + "recupererNote?auteur=" + auteur + "&version=" + version + "&id_contenu=" + idContenu, this.getHeader(localStorage.token))
},*/
// gestion des en-cours // gestion des en-cours
creerEnCours(data) { creerEnCours(data) {
return axios.post(urlBase + en_cours + "newEnCours", data, this.getHeader(localStorage.token)) return axios.post(urlBase + en_cours + "newEnCours", data, this.getHeader(localStorage.token))
......
import Login from "../Login.vue";
import {mount} from "@vue/test-utils";
import { shallowMount } from '@vue/test-utils'
import Service from "../service/Service";
import Tags from "../GererTags";
// Rien a tester dans Index.vue, car c'est juste un "aggrégateur" pour d'autres composants.
test('Tags', () => {
const wrapper = shallowMount(Tags)
expect(wrapper.vm).toBeTruthy();
})
\ No newline at end of file
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