Skip to content

Commit

Permalink
feat: trombi rebuild from files
Browse files Browse the repository at this point in the history
  • Loading branch information
ikit committed Feb 22, 2022
1 parent c746eeb commit 80a1186
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions absg-client/src/views/Agenda/Trombi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<v-spacer />

<v-btn-toggle :disabled="isLoading">
<v-tooltip bottom v-if="isAdmin">
<template #activator="{ on }">
<v-btn @click.stop="rebuildTrombis()" v-on="on">
<v-icon>fas fa-redo</v-icon>
</v-btn>
</template>
<span>Reconstruire la liste des trombi</span>
</v-tooltip>

<v-tooltip bottom>
<template #activator="{ on }">
<v-btn @click.stop="switchHidden()" v-on="on">
Expand Down Expand Up @@ -213,6 +222,7 @@ import {Chart} from 'highcharts-vue';
import Highcharts from 'highcharts';
import HC_sankey from 'highcharts/modules/sankey';
import HC_depwheel from 'highcharts/modules/dependency-wheel';
import { mapState } from 'vuex';
HC_sankey(Highcharts);
HC_depwheel(Highcharts);
Expand All @@ -224,6 +234,7 @@ export default {
store,
data: () => ({
isLoading: false,
isAdmin: false,
persons: [],
displayedPersons: [],
layoutMode: "GRID",
Expand Down Expand Up @@ -268,12 +279,18 @@ export default {
}),
computed: {
...mapState([
'user'
]),
numberOfPages () {
return Math.ceil(this.photos.length / this.filter.pageSize)
}
},
mounted () {
if (this.user) {
this.isAdmin = this.user.roles.indexOf("admin") > -1;
}
this.isLoading = true;
// On récupère la liste des photos
axios.get(`/api/agenda/persons/`).then(response => {
Expand Down Expand Up @@ -499,6 +516,21 @@ export default {
}
}
store.commit('photosGalleryReset', photos);
},
rebuildTrombis() {
this.isLoading = true;
// On récupère la liste des photos
axios.get(`/api/agenda/trombi/`).then(response => {
this.persons = parseAxiosResponse(response).map(e => ({
...e,
trombiCount: e.trombis.length,
cssStatus: this.computeCssStatus(e)
}));
this.applyFilter();
this.isLoading = false;
});
}
}
}
Expand Down

0 comments on commit 80a1186

Please sign in to comment.