Release v1.3
Ajout des noms et logins sur la page d'acceuil de la gestion du semestre
This commit is contained in:
parent
d50beeb4d7
commit
6e41809da7
@ -26,10 +26,23 @@ class Accueil extends Component {
|
|||||||
let dept = window.location.href.split('/')[7]
|
let dept = window.location.href.split('/')[7]
|
||||||
let sem = window.location.href.split('/')[9]
|
let sem = window.location.href.split('/')[9]
|
||||||
let BASE_URL = window.$api_url
|
let BASE_URL = window.$api_url
|
||||||
|
// Recuperation des infos de semestre
|
||||||
getJson(BASE_URL + dept + '/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id=' + sem)
|
getJson(BASE_URL + dept + '/Scolarite/Notes/formsemestre_list?format=json&formsemestre_id=' + sem)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.setState({ semestre: res.data[0], resp: res.data[0].responsables, loading: false});
|
this.setState({ semestre: res.data[0], resp_l: res.data[0].responsables});
|
||||||
});
|
// Recuperation des noms complets des responsables
|
||||||
|
res.data[0].responsables.map((resp) =>
|
||||||
|
getJson(BASE_URL + dept + '/Scolarite/Users/user_info?format=json&user_name=' + resp)
|
||||||
|
.then(res => {
|
||||||
|
let joined = this.state.resp.concat(res.data.nomplogin)
|
||||||
|
this.setState({resp: joined, loading: false})
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.setState({resp: this.state.resp_l, loading: false})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@ -45,6 +58,7 @@ class Accueil extends Component {
|
|||||||
})}
|
})}
|
||||||
</h1>
|
</h1>
|
||||||
:
|
:
|
||||||
|
// En cas de chargement
|
||||||
<Spinner animation="border"/>
|
<Spinner animation="border"/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user