mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-04 23:09:50 +00:00
some setup in frontend
This commit is contained in:
parent
b172ebdf76
commit
b5f7f578da
@ -131,6 +131,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch('getDashboardItems', {userId: 1})
|
||||
for (const m of [
|
||||
'MyNotifications',
|
||||
'MyAccompanyingCourses',
|
||||
|
@ -39,10 +39,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
<div class="custom2">
|
||||
Mon dashboard personnalisé
|
||||
News
|
||||
<MyWidget :chart-data="chartData" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
@ -50,12 +51,6 @@
|
||||
Mon dashboard personnalisé
|
||||
</div>
|
||||
</div>
|
||||
<div class="mbloc col col-sm-6 col-lg-4">
|
||||
<div class="custom4">
|
||||
Mon dashboard personnalisé
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
@ -70,7 +65,7 @@ export default {
|
||||
return {
|
||||
counterClass: {
|
||||
counter: true //hack to pass class 'counter' in i18n-t
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -24,7 +24,7 @@ const store = createStore({
|
||||
workflows: {},
|
||||
workflowsCc: {},
|
||||
errorMsg: [],
|
||||
newsItems: {},
|
||||
dashboardItems: {},
|
||||
loading: false
|
||||
},
|
||||
getters: {
|
||||
@ -98,26 +98,26 @@ const store = createStore({
|
||||
catchError(state, error) {
|
||||
state.errorMsg.push(error);
|
||||
},
|
||||
addNewsItems(state, newsItems) {
|
||||
state.newsItems = newsItems;
|
||||
addDashboardItems(state, dashboardItems) {
|
||||
state.dashboardItems = dashboardItems;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
getDashboardItems({commit, getters}, { userId }) {
|
||||
const url = `/api/1.0/main/dashboard-item/${userId}.json`;
|
||||
makeFetch('GET', url)
|
||||
.then((response) => {
|
||||
console.log('dashboardItems', response.results)
|
||||
commit('addDashboardItems', response);
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
throw error;
|
||||
})
|
||||
;
|
||||
},
|
||||
getByTab({ commit, getters }, { tab, param }) {
|
||||
switch (tab) {
|
||||
case 'MyCustoms':
|
||||
const url = `/api/1.0/main/news.json`;
|
||||
makeFetch('GET', url)
|
||||
.then((response) => {
|
||||
console.log('news', response.results)
|
||||
commit('addNewsItems', response);
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
throw error;
|
||||
})
|
||||
;
|
||||
break;
|
||||
// case 'MyWorks':
|
||||
// if (!getters.isWorksLoaded) {
|
||||
// commit('setLoading', true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user